Loads a Foreman-style environment file.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
Gemfile
LICENSE
README.md
Rakefile
foreman-env.gemspec

README.md

foreman-env

Loads a Foreman-style environment file. To automagically load .env files into ENV use dotenv.

Installation

Add this line to your application Gemfile

gem 'foreman-env'

Usage

require 'foreman/env'

def foo filename
  env = {}
  Foreman::Env.new(filename).entries do |name, value|
    env[name] = value
  end
  env
end

The file should contain key/value pairs, separated by =, with one key/value pair per line.

FOO=bar
BAZ=qux

See Foreman for more info.

License

MIT