removing more pathnameisms

This commit is contained in:
Aaron Patterson 2012-05-23 15:56:49 -07:00
parent 4e5175e957
commit 4001835db0
2 changed files with 4 additions and 6 deletions

View File

@ -416,9 +416,9 @@ module Rails
# Finds engine with given path
def find(path)
expanded_path = File.expand_path path.to_s
expanded_path = File.expand_path path
Rails::Engine::Railties.engines.find { |engine|
File.expand_path(engine.root.to_s) == expanded_path
File.expand_path(engine.root) == expanded_path
}
end
end
@ -652,7 +652,7 @@ module Rails
root = File.exist?("#{root_path}/#{flag}") ? root_path : default
raise "Could not find root path for #{self}" unless root
Pathname.new File.realpath root
File.realpath root
end
def default_middleware_stack

View File

@ -1,5 +1,3 @@
require "pathname"
module Rails
module Paths
# This object is an extended hash that behaves as root of the <tt>Rails::Paths</tt> system.
@ -186,7 +184,7 @@ module Rails
raise "You need to set a path root" unless @root.path
map do |p|
Pathname.new(@root.path).join(p)
File.join @root.path, p
end
end