Permalink
Browse files

adjust route inspection to work with Journey

  • Loading branch information...
tenderlove committed Sep 12, 2011
1 parent a08bee7 commit d21e0e2af3d9b21399244c3f3f73378d75cd4697
Showing with 2 additions and 1 deletion.
  1. +2 −1 railties/lib/rails/application/route_inspector.rb
@@ -23,7 +23,8 @@ def format all_routes, filter = nil
reqs = reqs.empty? ? constraints.inspect : "#{reqs} #{constraints.inspect}"
end
- {:name => route.name.to_s, :verb => route.verb.to_s, :path => route.path, :reqs => reqs}
+ verb = route.verb.source.gsub(/[$^]/, '')

This comment has been minimized.

Show comment Hide comment
@vijaydev

vijaydev Sep 13, 2011

Member

What does this regex do?

@vijaydev

vijaydev Sep 13, 2011

Member

What does this regex do?

This comment has been minimized.

Show comment Hide comment
@mat

mat Sep 13, 2011

I guess it just removes literal $ and ^

>> "$$$foo^^^".gsub(/[$^]/, '')
=> "foo"
@mat

mat Sep 13, 2011

I guess it just removes literal $ and ^

>> "$$$foo^^^".gsub(/[$^]/, '')
=> "foo"

This comment has been minimized.

Show comment Hide comment
@vijaydev

vijaydev Sep 13, 2011

Member

I know that :) I meant to ask what purpose that gsub serves. But realised only now, that it's verb.source and not verb that is getting gsubbed!

@vijaydev

vijaydev Sep 13, 2011

Member

I know that :) I meant to ask what purpose that gsub serves. But realised only now, that it's verb.source and not verb that is getting gsubbed!

+ {:name => route.name.to_s, :verb => verb, :path => route.path.spec.to_s, :reqs => reqs}
end
# Skip the route if it's internal info route

0 comments on commit d21e0e2

Please sign in to comment.