Sha256: bd4aa9c926fc94ed3eb77996017f5f4c14b9d0402686460f3946eba2e20e5437

Contents?: true

Size: 426 Bytes

Versions: 4

Compression:

Stored size: 426 Bytes

Contents

require 'ostruct'

module Solokit
  class Configuration < OpenStruct
    def initialize(*envs)
      shared_config = YAML.load_file("config.yml")

      config = shared_config
      envs.each do |env|
        env_config_file = "envs/#{env}/config.yml"

        config = File.exists?(env_config_file) ?
          YAML.load_file(env_config_file).merge(config) :
          config
      end

      super(config)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solokit-0.0.4.1 lib/configuration.rb
solokit-0.0.4 lib/configuration.rb
solokit-0.0.3 lib/configuration.rb
solokit-0.0.2 lib/configuration.rb