lib/tasks/analysis/smallog.rake
# group a path into a string key (eg, representing an endpoint)
group a path into a string key
group a path into a string key
def endpoint_key(path, options = {})
  if path.start_with?('/assets')
    '[assets]'
  elsif path.start_with?('/build')
    '[build]'
  elsif path.start_with?('/wp-content') || path == '/modules/mod_artuploader/upload.php'
    '[hacking]'
  elsif path == '/robots.txt' || path == '/favicon.ico' || path == '/browserconfig.xml'
    '[config]'
  else
    begin
      match = Rails.application.routes.recognize_path(path, options)
      "#{match[:controller]}##{match[:action]}"
    rescue => err
      path
    end
  end
end
def endpoint_key ( path , options = { } ) if path . start_with? ( '/assets' ) '[assets]' elsif path . start_with? ( '/build' ) '[build]' elsif path . start_with? ( '/wp-content' ) || path == '/modules/mod_artuploader/upload.php' '[hacking]' elsif path == '/robots.txt' || path == '/favicon.ico' || path == '/browserconfig.xml' '[config]' else begin match = Rails . application . routes . recognize_path ( path , options ) "#{match[:controller]}##{match[:action]}" rescue => err path end end end
group a path into a string key (eg, representing an endpoint)
group a path into a string key ( eg representing an endpoint )
path
<not_specific>
options
<not_specific>