From 13d66cdf2544af0d465d596383743b16b5005996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 23 Jan 2010 16:59:32 +0100 Subject: Extract Railtie load from application. --- railties/lib/rails/engine.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'railties/lib/rails/engine.rb') 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 -- cgit v1.2.3