debian-mirror-gitlab/lib/tasks/grape.rake

15 lines
391 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
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