diff options
author | José Valim <jose.valim@gmail.com> | 2012-05-25 09:27:39 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-05-25 09:27:39 +0200 |
commit | 73db73fee931e087317261fe9373228b5c0f1ed1 (patch) | |
tree | 9c10cd275668dc5470d51c6133c9e973ba6be5e1 /actionpack | |
parent | ec8c4b5a833526c7f1f9d5d1f3fd566cf386f47e (diff) | |
download | rails-73db73fee931e087317261fe9373228b5c0f1ed1.tar.gz rails-73db73fee931e087317261fe9373228b5c0f1ed1.tar.bz2 rails-73db73fee931e087317261fe9373228b5c0f1ed1.zip |
Remove implicit dependency on pathname
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 6 | ||||
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 67a208263b..e43e897783 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1318,7 +1318,7 @@ module ActionDispatch 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 @@ module ActionDispatch 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' diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 00d09282ca..fa4cb301eb 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -2331,7 +2331,7 @@ class TestDrawExternalFile < ActionDispatch::IntegrationTest 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 |