
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Rake tasks to ease the development and debugging of Grape APIs.
rake grape_raketasks:routes
is like rake routes
for your Grape APIs. All routes within every Grape API in your web application will be printed to the terminal, along with parameter requiremements, HTTP verb, the API it belongs to, etc.
If you want to see routes belonging to only one API:
Pass an environment variable set to your API name after writing the task. Given the API below, and assuming we only want to see routes belonging to this CatPictures API...
module CatPictures
class API < Grape::API
# API stuff
end
end
I'd execute rake grape_raketasks:routes API=CatPictures::API
. Notice how we have to list which constants the API is nested in (if any), separated by a double colon, like in Ruby code.
1.) Add grape-raketasks
to your Gemfile:
# Gemfile
gem 'grape-raketasks'
2.) Install the gem via Bundler:
$ bundle install
or on the command line:
$ gem install grape-raketasks
3.) If your Grape APIs are defined in a Sinatra or Rack web application, you need to write a rake task called :environment
that loads the application's environment first. This gem's tasks are dependent on it. You could put this in the root of your project directory:
# Rakefile
require 'rake'
require 'bundler'
Bundler.setup
require 'grape-raketasks'
require 'grape-raketasks/tasks'
desc 'load the Sinatra environment.'
task :environment do
require File.expand_path('your_app_file', File.dirname(__FILE__))
end
Rails applications with mounted Grape APIs don't require an extra step here.
4.) Run rake -T
to see all available rake tasks. Tasks with a grape_raketasks
namespace should appear somewhere.
5.) Use the tasks! Find bugs or ideas for improvement! Report them here!
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)See LICENSE
FAQs
Unknown package
We found that grape-raketasks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.