From 0d3172c4e42d547fa41007a3c3895e240110a58d Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Tue, 15 May 2012 04:28:10 +0200 Subject: add tests and external file backtrace for Routing::Mapper#draw --- actionpack/lib/action_dispatch/routing/mapper.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 7a22b65c44..d6eaed4845 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1336,10 +1336,11 @@ module ActionDispatch msg = "Your router tried to #draw the external file #{name}.rb,\n" \ "but the file was not found in:\n\n" msg += @draw_paths.map { |_path| " * #{_path}" }.join("\n") - raise msg + raise ArgumentError, msg end - - instance_eval(path.join("#{name}.rb").read) + + route_path = path.join("#{name}.rb") + instance_eval(route_path.read, route_path.to_s) end # match 'path' => 'controller#action' -- cgit v1.2.3