Class: ActionDispatch::Routing::ConsoleFormatter::Unused

Inherits:
Sheet show all
Defined in:
actionpack/lib/action_dispatch/routing/inspector.rb

Instance Method Summary collapse

Methods inherited from Sheet

#section, #section_title

Methods inherited from Base

#initialize, #result, #section, #section_title

Constructor Details

This class inherits a constructor from ActionDispatch::Routing::ConsoleFormatter::Base

Instance Method Details

#header(routes) ⇒ Object



264
265
266
267
268
269
270
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 264

def header(routes)
  @buffer << "    Found \#{routes.count} unused \#{\"route\".pluralize(routes.count)}:\n  MSG\n\n  super\nend\n"

#no_routes(routes, filter) ⇒ Object



272
273
274
275
276
277
278
279
280
281
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 272

def no_routes(routes, filter)
  @buffer <<
    if filter.none?
      "No unused routes found."
    elsif filter.key?(:controller)
      "No unused routes found for this controller."
    elsif filter.key?(:grep)
      "No unused routes found for this grep pattern."
    end
end