aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorChad Fowler <chad@chadfowler.com>2010-07-26 15:35:54 -0600
committerDavid Heinemeier Hansson <david@loudthinking.com>2010-07-26 16:40:46 -0500
commitb6f99325613baf0534c10677da9c82ac27b628c0 (patch)
treea5fe39e97bb96057375a6ed8e4123b00163fd832 /railties
parentd283ca34a95fddc5d7e982432e0b5ea61269c133 (diff)
downloadrails-b6f99325613baf0534c10677da9c82ac27b628c0.tar.gz
rails-b6f99325613baf0534c10677da9c82ac27b628c0.tar.bz2
rails-b6f99325613baf0534c10677da9c82ac27b628c0.zip
fix bad logic in determining if in rails app subdir
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/script_rails_loader.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/rails/script_rails_loader.rb b/railties/lib/rails/script_rails_loader.rb
index 8fbd3bf492..91672e5d81 100644
--- a/railties/lib/rails/script_rails_loader.rb
+++ b/railties/lib/rails/script_rails_loader.rb
@@ -7,6 +7,7 @@ module Rails
def self.exec_script_rails!
cwd = Dir.pwd
+ return unless in_rails_application? || in_rails_application_subdirectory?
exec RUBY, SCRIPT_RAILS, *ARGV if in_rails_application?
Dir.chdir("..") do
# Recurse in a chdir block: if the search fails we want to be sure
@@ -18,7 +19,7 @@ module Rails
end
def self.in_rails_application?
- File.exists?(SCRIPT_RAILS) || in_rails_application_subdirectory?
+ File.exists?(SCRIPT_RAILS)
end
def self.in_rails_application_subdirectory?(path = Pathname.new(Dir.pwd))