aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2012-05-15 04:28:10 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2012-05-15 04:28:10 +0200
commit0d3172c4e42d547fa41007a3c3895e240110a58d (patch)
tree9fee5d6cbd4bd20587c21a9ddc6e763b0eaa41e5 /actionpack/lib/action_dispatch/routing/mapper.rb
parent2c0add7103e967a7de2df42675eb49e093327c58 (diff)
downloadrails-0d3172c4e42d547fa41007a3c3895e240110a58d.tar.gz
rails-0d3172c4e42d547fa41007a3c3895e240110a58d.tar.bz2
rails-0d3172c4e42d547fa41007a3c3895e240110a58d.zip
add tests and external file backtrace for Routing::Mapper#draw
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb7
1 files changed, 4 insertions, 3 deletions
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'