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

Removed duplicated method find_root_with_flag

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
Piotr Sarnacki 2010-10-15 18:12:05 +03:00 committed by Santiago Pastorino
parent 21ff8849bb
commit b0157f8d04

View file

@ -343,21 +343,6 @@ module Rails
super
end
def find_root_with_flag(flag, default=nil)
root_path = self.called_from
while root_path && File.directory?(root_path) && !File.exist?("#{root_path}/#{flag}")
parent = File.dirname(root_path)
root_path = parent != root_path && parent
end
root = File.exist?("#{root_path}/#{flag}") ? root_path : default
raise "Could not find root path for #{self}" unless root
RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ?
Pathname.new(root).expand_path : Pathname.new(root).realpath
end
def endpoint(endpoint = nil)
@endpoint = endpoint if endpoint
@endpoint