Created
August 5, 2013 11:56
-
-
Save filipesperandio/6155391 to your computer and use it in GitHub Desktop.
Rake routes for a Sinatra App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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