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.1.17 lib/configuration.rb
solokit-0.1.16 lib/configuration.rb
solokit-0.1.15 lib/configuration.rb
solokit-0.1.14 lib/configuration.rb
solokit-0.1.13 lib/configuration.rb
solokit-0.1.12 lib/configuration.rb
solokit-0.1.11 lib/configuration.rb
solokit-0.1.10 lib/configuration.rb
solokit-0.1.9 lib/configuration.rb
solokit-0.1.8 lib/configuration.rb
solokit-0.1.7 lib/configuration.rb
solokit-0.1.6 lib/configuration.rb
solokit-0.1.5 lib/configuration.rb
solokit-0.1.4 lib/configuration.rb
solokit-0.1.3 lib/configuration.rb
solokit-0.1.2 lib/configuration.rb
solokit-0.1.1 lib/configuration.rb
solokit-0.1.0 lib/configuration.rb
solokit-0.0.9 lib/configuration.rb
solokit-0.0.8 lib/configuration.rb