Sha256: 4d995f7a19d610d6e58e2783a1252c9877807d996ee8f3657766bb77950c9a15

Contents?: true

Size: 565 Bytes

Versions: 23

Compression:

Stored size: 565 Bytes

Contents

require 'ostruct'

module Solokit
  class Configuration < OpenStruct
    def initialize(*envs)
      shared_config = { "debug_ssh" => false, "debug_chef" => false }
      if File.exists?("config.yml")
        shared_config = YAML.load_file("config.yml").merge(shared_config)
      end

      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

23 entries across 23 versions & 1 rubygems

Version Path
solokit-0.0.7 lib/configuration.rb
solokit-0.0.6 lib/configuration.rb
solokit-0.0.5 lib/configuration.rb