rake routes command on grape gem
At April 2013 I write a small article in Portuguese about rails rake routes command on grape gem. I will translate here:
First create a Rakefile
:
desc "API Routes"
task :routes do
MyProject::API.routes.each do |api|
method = api.route_method.ljust(10)
path = api.route_path
puts " {method} {path}"
end
end
Don’t forget change MyProject::API to your class, não run:
$ rake routes
GET /resourceX(.:format)
GET /resourceX/:id(.:format)
POST /resourceX
...