Sha256: f3fc3fa49b5d1d5a934717f7cae6161ab891a876caaa3f9cbb3fa2a5b2f443da

Contents?: true

Size: 335 Bytes

Versions: 10

Compression:

Stored size: 335 Bytes

Contents

unless defined?(Rails)
  desc "display all routes for Grape"
  task :routes do
    grape_apis = ObjectSpace.each_object(Class).select do |klass|
      begin
        klass < Grape::API
      rescue
        false
      end
    end
    grape_apis.each do |api|
      api.routes.each do |r|
        puts "#{r}"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
napa-0.1.29 lib/tasks/routes.rake
napa-0.1.28 lib/tasks/routes.rake
napa-0.1.26 lib/tasks/routes.rake
napa-0.1.25 lib/tasks/routes.rake
napa-0.1.24 lib/tasks/routes.rake
napa-0.1.23 lib/tasks/routes.rake
napa-0.1.22 lib/tasks/routes.rake
napa-0.1.21 lib/tasks/routes.rake
napa-0.1.20 lib/tasks/routes.rake
napa-0.1.19 lib/tasks/routes.rake