Skip to content

Instantly share code, notes, and snippets.

@sharipov-ru
Created April 5, 2012 18:06
Show Gist options
  • Save sharipov-ru/2312899 to your computer and use it in GitHub Desktop.
Save sharipov-ru/2312899 to your computer and use it in GitHub Desktop.
rake routes with hirb
namespace :routes do
desc "cool routes"
task :cool => :environment do
require 'rails/application/route_inspector'
module Rails
class Application
class RouteInspector
include Hirb::Console
def formatted_routes(routes)
table routes.map{ |r|
{
:name => r[:name],
:verb => r[:verb],
:path => r[:path]
}
}, :fields => [:verb, :name, :path]
[]
end
end
end
end
Rake::Task['routes'].invoke
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment