Skip to content

A custom rake task that provides complex parameter functionality.

Notifications You must be signed in to change notification settings

aetheric/rake-params

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rake Params

Build Status Coverage Status

A custom rake task that provides complex parameter functionality.

Usage

Add it to your gemfile:

gem 'rake-params'

Require it in your rakefile:

require 'rake-params'

Initialise the configuration:

# Minimal required
param_init

# Customise options (defaults listed here)
param_init({
	hash_dir:           '.params',
	vault_secret_param: :vault_secret,
	vault_env_suffixes: [ '_ENC', '_SYM', '_VAULT' ],
	yaml_config_file:   nil,
})

Define a parameter:

# Minimal required
param :branch_name

# Customise options (defaults listed here)
param :branch_name, {
	env_key:   'BRANCH_NAME',
	hash_file: '.params/branch_name',
	sensitive: false,
	default:   nil
}

# param saved to variable
$branch_name = param :branch_name

Use it as a dependency:

# Reference by symbol
task :print => [ :branch_name ] do
	puts param(:branch_name).resolve
end

# Reference by variable
task :print => [ $branch_name ] do
	puts $branch_name.resolve
end

About

A custom rake task that provides complex parameter functionality.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages