Project

confiture

0.01
No commit activity in last 3 years
No release in over 3 years
Confiture helps with configuring your gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.9.9
~> 0.9.2
~> 2.7
 Project Readme

Infos

Build

Installation

gem install confiture

or in your Gemfile:

gem "confiture"

Usage

In order to use confiture, just include it into a configuration klass:

module Your
  class Configuration
    include Confiture::Configuration
    
    confiture_allowed_keys(:secret, :key)
    confiture_defaults(secret: 'SECRET_STUFF', key: 'EVEN_MOAR_SECRET')
  end
end

Rails style initializer (config/initializers/asin.rb):

Your::Configuration.configure do |config|
  config.secret = 'your-secret'
  config.key    = 'your-key'
end

YAML style configuration:

Your::Configuration.configure yaml: 'config/some.yml'

Inline style configuration:

Your::Configuration.configure secret: 'your-secret', key: 'your-key'
# or
client.configure secret: 'your-secret', key: 'your-key'

Temporary configuration:

Your::Configuration.with_config(key: "temp-key") do
  [...]
end

License

"THE BEER-WARE LICENSE" (Revision 42): ps@nofail.de wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Peter Schröder