2015-11-26 14:37:03 +05:30
|
|
|
namespace :grape do
|
|
|
|
desc 'Print compiled grape routes'
|
|
|
|
task routes: :environment do
|
|
|
|
API::API.routes.each do |route|
|
2017-08-17 22:00:37 +05:30
|
|
|
puts "#{route.options[:method]} #{route.path} - #{route_description(route.options)}"
|
2015-11-26 14:37:03 +05:30
|
|
|
end
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
def route_description(options)
|
|
|
|
options[:settings][:description][:description] if options[:settings][:description]
|
|
|
|
end
|
2015-11-26 14:37:03 +05:30
|
|
|
end
|