aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/inspector.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:55:02 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 20:16:27 +0200
commit80e66cc4d90bf8c15d1a5f6e3152e90147f00772 (patch)
treee7e75464af04f3cf1935b29238dbd7cb2337b0dd /actionpack/lib/action_dispatch/routing/inspector.rb
parent411ccbdab2608c62aabdb320d52cb02d446bb39c (diff)
downloadrails-80e66cc4d90bf8c15d1a5f6e3152e90147f00772.tar.gz
rails-80e66cc4d90bf8c15d1a5f6e3152e90147f00772.tar.bz2
rails-80e66cc4d90bf8c15d1a5f6e3152e90147f00772.zip
normalizes indentation and whitespace across the project
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/inspector.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/inspector.rb64
1 files changed, 32 insertions, 32 deletions
diff --git a/actionpack/lib/action_dispatch/routing/inspector.rb b/actionpack/lib/action_dispatch/routing/inspector.rb
index a66a1d4ca4..b91ffb8419 100644
--- a/actionpack/lib/action_dispatch/routing/inspector.rb
+++ b/actionpack/lib/action_dispatch/routing/inspector.rb
@@ -80,48 +80,48 @@ module ActionDispatch
private
- def normalize_filter(filter)
- if filter.is_a?(Hash) && filter[:controller]
- { controller: /#{filter[:controller].downcase.sub(/_?controller\z/, '').sub('::', '/')}/ }
- elsif filter
- { controller: /#{filter}/, action: /#{filter}/, verb: /#{filter}/, name: /#{filter}/, path: /#{filter}/ }
+ def normalize_filter(filter)
+ if filter.is_a?(Hash) && filter[:controller]
+ { controller: /#{filter[:controller].downcase.sub(/_?controller\z/, '').sub('::', '/')}/ }
+ elsif filter
+ { controller: /#{filter}/, action: /#{filter}/, verb: /#{filter}/, name: /#{filter}/, path: /#{filter}/ }
+ end
end
- end
- def filter_routes(filter)
- if filter
- @routes.select do |route|
- route_wrapper = RouteWrapper.new(route)
- filter.any? { |default, value| route_wrapper.send(default) =~ value }
+ def filter_routes(filter)
+ if filter
+ @routes.select do |route|
+ route_wrapper = RouteWrapper.new(route)
+ filter.any? { |default, value| route_wrapper.send(default) =~ value }
+ end
+ else
+ @routes
end
- else
- @routes
end
- end
- def collect_routes(routes)
- routes.collect do |route|
- RouteWrapper.new(route)
- end.reject(&:internal?).collect do |route|
- collect_engine_routes(route)
+ def collect_routes(routes)
+ routes.collect do |route|
+ RouteWrapper.new(route)
+ end.reject(&:internal?).collect do |route|
+ collect_engine_routes(route)
- { name: route.name,
- verb: route.verb,
- path: route.path,
- reqs: route.reqs }
+ { name: route.name,
+ verb: route.verb,
+ path: route.path,
+ reqs: route.reqs }
+ end
end
- end
- def collect_engine_routes(route)
- name = route.endpoint
- return unless route.engine?
- return if @engines[name]
+ def collect_engine_routes(route)
+ name = route.endpoint
+ return unless route.engine?
+ return if @engines[name]
- routes = route.rack_app.routes
- if routes.is_a?(ActionDispatch::Routing::RouteSet)
- @engines[name] = collect_routes(routes.routes)
+ routes = route.rack_app.routes
+ if routes.is_a?(ActionDispatch::Routing::RouteSet)
+ @engines[name] = collect_routes(routes.routes)
+ end
end
- end
end
class ConsoleFormatter