lib/pry-rails/commands/find_route.rb in pry-rails-0.3.4 vs lib/pry-rails/commands/find_route.rb in pry-rails-0.3.5
- old
+ new
@@ -49,17 +49,17 @@
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
output.puts "No routes found."
end