diff --git a/lib/arbre.rb b/lib/arbre.rb index cbd1ff3..17c12ab 100644 --- a/lib/arbre.rb +++ b/lib/arbre.rb @@ -6,16 +6,16 @@ module Arbre end -require 'arbre/element' -require 'arbre/context' -require 'arbre/html/attributes' -require 'arbre/html/class_list' -require 'arbre/html/tag' -require 'arbre/html/text_node' -require 'arbre/html/document' -require 'arbre/html/html5_elements' -require 'arbre/component' +require_relative 'arbre/element' +require_relative 'arbre/context' +require_relative 'arbre/html/attributes' +require_relative 'arbre/html/class_list' +require_relative 'arbre/html/tag' +require_relative 'arbre/html/text_node' +require_relative 'arbre/html/document' +require_relative 'arbre/html/html5_elements' +require_relative 'arbre/component' if defined?(Rails) - require 'arbre/railtie' + require_relative 'arbre/railtie' end diff --git a/lib/arbre/context.rb b/lib/arbre/context.rb index 819bec4..bdc9f36 100644 --- a/lib/arbre/context.rb +++ b/lib/arbre/context.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'arbre/element' +require_relative 'element' module Arbre diff --git a/lib/arbre/railtie.rb b/lib/arbre/railtie.rb index a7d260a..8240c49 100644 --- a/lib/arbre/railtie.rb +++ b/lib/arbre/railtie.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'arbre/rails/template_handler' -require 'arbre/rails/forms' -require 'arbre/rails/rendering' +require_relative 'rails/template_handler' +require_relative 'rails/forms' +require_relative 'rails/rendering' require 'rails' Arbre::Element.include(Arbre::Rails::Rendering)