reprah / grape-raketasks Goto Github PK
View Code? Open in Web Editor NEWRake tasks to ease the development and debugging of Grape APIs.
License: MIT License
Rake tasks to ease the development and debugging of Grape APIs.
License: MIT License
Example:
class Base < Grape::API
mount Mounted
end
Seems like I cannot use rake grape_raketasks:routes GRAPE_API=mounted
=>
You don't have any Grape routes defined!
A single Grape API can have two different versions. Users of the gem should be able to filter routes by API version.
I like rails-style format for printing routes :)
"#{description} #{method} #{:path}"
That do you think?
The current formatting is horrible (say it with a Spanish accent, please!).
This is what I have hacked up.
In the style of rails routes... (nicely formatted)
namespace :grape do
desc "Condensed API Routes"
task :routes => :environment do
mapped_prefix = '/whatevs' # where mounted in routes.rb
format = "%46s %3s %7s %50s %12s: %s"
API.routes.each do |grape_route|
info = grape_route.instance_variable_get :@options
puts format % [
info[:description] ? info[:description][0..45] : '',
info[:version],
info[:method],
mapped_prefix + info[:path],
'# params: ' + info[:params].length.to_s,
info[:params].first.inspect
]
if info[:params].length > 1
info[:params].each_with_index do |param_info, index|
next if index == 0
puts format % ['','','','','',param_info.inspect]
end
end
end
end
end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.