class Dotenvious::Loaders::Environments

Attributes

env_file[R]
example_file[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/dotenvious/loaders/environments.rb, line 7
def initialize(options = {})
  @example_file = options[:example_file] || DEFAULT_EXAMPLE_ENV_FILE
  @env_file = options[:env_file] || DEFAULT_ENV_FILE
end

Public Instance Methods

load_environments() click to toggle source
# 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