Sha256: 5eb577e57b918976ae19034f4bc34f88d4af8c1102878ce0f28c9065c39eac7a

Contents?: true

Size: 619 Bytes

Versions: 1

Compression:

Stored size: 619 Bytes

Contents

module Kite::Helpers
  # Check config/cloud.yml file to be complete
  def check_cloud_config(config)
    raise Kite::Error, 'The config/cloud.yml is not filled out!' unless config.find { |key, hash| hash.find { |k, v| v.nil? } }.nil?
  end

  # Parse config/cloud.yml, returning the output hash
  def parse_cloud_config(env = nil)
    cloud_config = YAML.load(File.read('config/cloud.yml'))
    check_cloud_config(cloud_config)

    if env
      unless cloud_config[env]
        fail "Environement `#{env}` missing in config/cloud.yml"
      end
      return cloud_config[env]
    end
    return cloud_config
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kite-1.0.10 lib/kite/helpers.rb