mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Removed duplicated method find_root_with_flag
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
committed by
Santiago Pastorino
parent
21ff8849bb
commit
b0157f8d04
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user