2015-11-12 10:26:23 -05:00
|
|
|
namespace :grape do
|
|
|
|
desc 'Print compiled grape routes'
|
|
|
|
task routes: :environment do
|
|
|
|
API::API.routes.each do |route|
|
2017-02-06 04:28:03 -05:00
|
|
|
puts "#{route.options[:method]} #{route.path} - #{route_description(route.options)}"
|
2015-11-12 10:26:23 -05:00
|
|
|
end
|
|
|
|
end
|
2017-02-06 04:28:03 -05:00
|
|
|
|
|
|
|
def route_description(options)
|
2017-02-07 05:00:47 -05:00
|
|
|
options[:settings][:description][:description] if options[:settings][:description]
|
2017-02-06 04:28:03 -05:00
|
|
|
end
|
2015-11-12 10:26:23 -05:00
|
|
|
end
|