diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-23 16:59:32 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-23 16:59:37 +0100 |
commit | 13d66cdf2544af0d465d596383743b16b5005996 (patch) | |
tree | 32a44fbf28cc65679caa665acaefa6af2df38a64 /railties/lib/rails/engine.rb | |
parent | 4f036032152518791d379f47260236f619713fbb (diff) | |
download | rails-13d66cdf2544af0d465d596383743b16b5005996.tar.gz rails-13d66cdf2544af0d465d596383743b16b5005996.tar.bz2 rails-13d66cdf2544af0d465d596383743b16b5005996.zip |
Extract Railtie load from application.
Diffstat (limited to 'railties/lib/rails/engine.rb')
-rw-r--r-- | railties/lib/rails/engine.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index aaa669ef32..cf6ca7c3f5 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -4,6 +4,7 @@ module Rails class Engine < Railtie class << self attr_accessor :called_from + delegate :middleware, :root, :paths, :to => :config def original_root @original_root ||= find_root_with_file_flag("lib") @@ -18,7 +19,6 @@ module Rails call_stack = caller.map { |p| p.split(':').first } File.dirname(call_stack.detect { |p| p !~ %r[railties/lib/rails|rack/lib/rack] }) end - super end @@ -33,17 +33,14 @@ module Rails end root = File.exist?("#{root_path}/#{flag}") ? root_path : default - raise "Could not find root path for #{self}" unless root RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? - Pathname.new(root).expand_path : - Pathname.new(root).realpath + Pathname.new(root).expand_path : Pathname.new(root).realpath end end - delegate :config, :to => :'self.class' - delegate :middleware, :root, :to => :config + delegate :middleware, :paths, :root, :config, :to => :'self.class' # Add configured load paths to ruby load paths and remove duplicates. initializer :set_load_path do |