Class: Dotenvious::Loaders::Environments
- Inherits:
-
Object
- Object
- Dotenvious::Loaders::Environments
- Defined in:
- lib/dotenvious/loaders/environments.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Environments
constructor
A new instance of Environments.
- #load_environments ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Environments
Returns a new instance of Environments.
7 8 9 10 |
# File 'lib/dotenvious/loaders/environments.rb', line 7 def initialize( = {}) @example_file = [:example_file] || DEFAULT_EXAMPLE_ENV_FILE @env_file = [:env_file] || DEFAULT_ENV_FILE end |
Instance Method Details
#load_environments ⇒ Object
12 13 14 15 16 |
# File 'lib/dotenvious/loaders/environments.rb', line 12 def load_environments ENV.merge!(DotenvFile.load_from(env_file)) environment_loader = example_file.match(/\.ya?ml/) ? YamlFile : DotenvFile ENV_EXAMPLE.merge!(environment_loader.load_from(example_file)) end |