Project

suzanne

0.0
No commit activity in last 3 years
No release in over 3 years
Minimal Figaro-style env variables management
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.1, >= 2.1.4
~> 11.1
~> 2.16
~> 5.11
~> 1.11
~> 0.13
~> 13.0
~> 0.85
~> 0.18.5
 Project Readme

Suzanne

A striped-down fork of Figaro, allowing env variables to be managed through YAML files.

Currently meant to be used within a Rails project. Currently, like Figaro, we assume that the config file is in config/application.yml.

Suggested rails use

Place you configuration file in config/application.yml. (Make sure it is not tracked by git.)

Add this line to your application's Gemfile:

# Gemfile
gem 'suzanne', '~> 0.1', require: false

At the very bottom of config/application.rb:

require 'suzanne'
Suzanne.env

Within your app:

Suzanne.env.super_secret_key

(just like you would with Figaro.)

Migrating from Figaro

  • Follow instructions in the section above (except you probably have a config file already).
  • Make sure you have a section named development (see section below).
  • Substitute "Suzanne" for "Figaro" everywhere in your code base. Hopefully this is safe.
  • Test

Configuration file

It should have a section for each environment (except production). There is no default section.

development:
  my_aws_key: 'abcdef'

test:
  my_aws_key: 'fedcba'

Usage

Define a YAML file:

development:
  super_secret_key: abcdef

test:
  super_secret_key: fedcba

Initialize Suzanne:

require 'suzanne'

Rails.env
=> 'development'
Suzanne.env.super_secret_key
=> 'abcdef'
Suzanne.env.no_such_key
=> nil

Use a different a file path

To be explained

Use outside Rails

To be tested

Development

Run bundle exec rake test to run the tests.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Naming

In case you are wondering about the gem name => The_Marriage_of_Figaro.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Facilecomm/suzanne. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Suzanne project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.