1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

fix bad logic in determining if in rails app subdir

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
This commit is contained in:
Chad Fowler 2010-07-26 15:35:54 -06:00 committed by David Heinemeier Hansson
parent d283ca34a9
commit b6f9932561

View file

@ -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))