Class Brakeman::Rails2RoutesProcessor
In: lib/brakeman/processors/lib/rails2_route_processor.rb
Parent: Brakeman::BasicProcessor

Processes the Sexp from routes.rb. Stores results in tracker.routes.

Note that it is only interested in determining what methods on which controllers are used as routes, not the generated URLs for routes.

Methods

Included Modules

Brakeman::RouteHelper

Attributes

current_controller  [R] 
map  [R] 
nested  [R] 

Public Class methods

Public Instance methods

Looking for mapping of routes

Process collection option

 :collection => { :some_action => :http_actions }

Process

 map.connect '/something', :controller => 'blah', :action => 'whatever'

Look for map calls that take a block. Otherwise, just do the default processing.

Process a map.something call based on the method used

map.something_abnormal ’/blah’, :controller => ‘something’, :action => ‘wohoo‘

map.namespace :something do |something|

  something.resources :blah

end

Process route option :except => …

Process route option :only => …

map.resource :x, ..

Process all the options that might be in the hash passed to map.resource, et al.

Process

 map.resources :x, :controller => :y, :member => ...

etc.

Call this with parsed route file information.

This method first calls RouteAliasProcessor#process_safely on the exp, so it does not modify the exp.

map.with_options :controller => ‘something’ do |something|

  something.resources :blah

end

[Validate]