Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rake_args

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rake_args

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

RakeArguments

One of the features that Rake lacks are reasonable methods to pass arguments into a task. The most common method for doing so is using environment variable, for example: $ rake namespace:task VAR1=value VAR2=value

Then, the variable can be referred to using ENV['VAR1']. However, this is somewhat clumsy for users. This gem presents a more elegant solution. With this gem, can do this: $ rake namespace:task option1 option2

Simply do this in your Rakefile:

require 'rake_args'

task :hello_world do
  args = task_args :hello, :world # {:hello=>"hi", :world=>"planet"}
  args.each { |k,v| puts "#{k} => #{v}" }
end

The result:

$ rake hello_world hi planet
:hello => hi
:world => planet

FAQs

Package last updated on 07 Oct 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc