提交 73db73fe 编写于 作者: J José Valim

Remove implicit dependency on pathname

上级 ec8c4b5a
......@@ -1318,7 +1318,7 @@ def shallow?
def draw(name)
path = @draw_paths.find do |_path|
_path.join("#{name}.rb").file?
File.exists? "#{_path}/#{name}.rb"
end
unless path
......@@ -1328,8 +1328,8 @@ def draw(name)
raise ArgumentError, msg
end
route_path = path.join("#{name}.rb")
instance_eval(route_path.read, route_path.to_s)
route_path = "#{path}/#{name}.rb"
instance_eval(File.read(route_path), route_path.to_s)
end
# match 'path' => 'controller#action'
......
......@@ -2331,7 +2331,7 @@ def index
end
end
DRAW_PATH = Pathname.new(File.expand_path('../../fixtures/routes', __FILE__))
DRAW_PATH = File.expand_path('../../fixtures/routes', __FILE__)
DefaultScopeRoutes = ActionDispatch::Routing::RouteSet.new.tap do |app|
app.draw_paths << DRAW_PATH
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册