Skip to content

Commit

Permalink
"warning: shadowing outer local variable - result"
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Jul 19, 2015
1 parent 69f5990 commit f96a667
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/pry-rails/commands/find_route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ def show_routes(&block)
all_routes = routes.select(&block)
if all_routes.any?
grouped_routes = all_routes.group_by { |route| route.defaults[:controller] }
result = grouped_routes.each_with_object("") do |(controller, routes), result|
result << "Routes for " + text.bold(controller.to_s.camelize + "Controller") + "\n"
result << "--\n"
result = grouped_routes.each_with_object("") do |(controller, routes), res|
res << "Routes for " + text.bold(controller.to_s.camelize + "Controller") + "\n"
res << "--\n"
routes.each do |route|
spec = route.path.is_a?(String) ? route.path : route.path.spec
result << "#{route.defaults[:action]} #{text.bold(verb_for(route))} #{spec} #{route_helper(route.name)}" + "\n"
res << "#{route.defaults[:action]} #{text.bold(verb_for(route))} #{spec} #{route_helper(route.name)}" + "\n"
end
result << "\n"
res << "\n"
end
stagger_output result
else
Expand Down

0 comments on commit f96a667

Please sign in to comment.