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

Remove implicit dependency on pathname

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