Skip to content

Commit

Permalink
let output more compact
Browse files Browse the repository at this point in the history
  • Loading branch information
ayaya committed Mar 5, 2011
1 parent d26662c commit a5175bb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion routes-query.rake
Expand Up @@ -42,7 +42,18 @@ namespace :routes do

reqs = route.requirements.dup
reqs[:to] = route.app unless route.app.class.name.to_s =~ /^ActionDispatch::Routing/
reqs = reqs.empty? ? "" : reqs.inspect

if reqs[:controller]
reqs[:C] = reqs[:controller]
reqs.delete :controller
end

if reqs[:action]
reqs[:A] = reqs[:action]
reqs.delete :action
end

reqs = reqs.empty? ? "" : reqs.map { |k, v| "#{k}: #{v}" }.join(', ')

route_name = route.name.to_s
route_name = path_to_name[route.path] if route_name.blank?
Expand Down

0 comments on commit a5175bb

Please sign in to comment.