summaryrefslogtreecommitdiff
path: root/lib/tasks/grape.rake
blob: ea2698da60670c75f8e38309795f23588677b834 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
namespace :grape do
  desc 'Print compiled grape routes'
  task routes: :environment do
    API::API.routes.each do |route|
      puts "#{route.options[:method]} #{route.path} - #{route_description(route.options)}"
    end
  end

  def route_description(options)
    options[:settings][:description][:description] if options[:settings][:description]
  end
end