Skip to content

Instantly share code, notes, and snippets.

@filipesperandio
Created August 5, 2013 11:56
Show Gist options
  • Save filipesperandio/6155391 to your computer and use it in GitHub Desktop.
Save filipesperandio/6155391 to your computer and use it in GitHub Desktop.
Rake routes for a Sinatra App
require "sinatra/activerecord/rake"
require "./your_app"
task :routes do
["GET", "POST", "PUT", "DELETE"].each do |verb|
routes = Sinatra::Application.routes[verb] || []
routes.as_json.flatten.each do |params|
puts params["route_name"] if params.is_a? Hash
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment