diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-08 16:05:22 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-08 16:05:22 +0100 |
commit | 7f7dfd2babf0de37f64a1caf5c0f9e65a91112d1 (patch) | |
tree | 0e4ceb145bc215051bc845d5522cdca1dcf3c64d /railties/lib | |
parent | 17b451898c09f560cef105ea120d8e767256555a (diff) | |
download | rails-7f7dfd2babf0de37f64a1caf5c0f9e65a91112d1.tar.gz rails-7f7dfd2babf0de37f64a1caf5c0f9e65a91112d1.tar.bz2 rails-7f7dfd2babf0de37f64a1caf5c0f9e65a91112d1.zip |
Take into account gem versions (so script/rails server can work outside the application) and use Rails::Application.root instead of ROOT_PATH.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/generators/rails/app/templates/script/rails | 1 | ||||
-rw-r--r-- | railties/lib/rails/commands.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/engine.rb | 2 |
3 files changed, 2 insertions, 3 deletions
diff --git a/railties/lib/generators/rails/app/templates/script/rails b/railties/lib/generators/rails/app/templates/script/rails index 2fcf6d09b5..b01d1ee183 100644 --- a/railties/lib/generators/rails/app/templates/script/rails +++ b/railties/lib/generators/rails/app/templates/script/rails @@ -3,7 +3,6 @@ ENV_PATH = File.expand_path('../../config/environment', __FILE__) BOOT_PATH = File.expand_path('../../config/boot', __FILE__) APP_PATH = File.expand_path('../../config/application', __FILE__) -ROOT_PATH = File.expand_path('../..', __FILE__) require BOOT_PATH require 'rails/commands' diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb index 500dcf7f9e..5b73577e36 100644 --- a/railties/lib/rails/commands.rb +++ b/railties/lib/rails/commands.rb @@ -35,7 +35,7 @@ when 'c', 'console' when 's', 'server' require APP_PATH require 'rails/commands/server' - Dir.chdir(ROOT_PATH) + Dir.chdir(Rails::Application.root) Rails::Server.start when 'db', 'dbconsole' require 'rails/commands/dbconsole' diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 5983a9ee6b..53e54d7400 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -16,7 +16,7 @@ module Rails unless abstract_railtie?(base) base.called_from = begin call_stack = caller.map { |p| p.split(':').first } - File.dirname(call_stack.detect { |p| p !~ %r[railties/lib/rails|rack/lib/rack] }) + File.dirname(call_stack.detect { |p| p !~ %r[railties[\w\-]*/lib/rails|rack[\w\-]*/lib/rack] }) end end |