class Orch::Config

Public Class Methods

new(options) click to toggle source
# File lib/config.rb, line 8
def initialize(options)
  @options = options

  @config_path = "#{Dir.home}/.orch/config.yml"
  if File.file?(@config_path)
    @APP_CONFIG = YAML.load_file(@config_path)
  else
    @APP_CONFIG = nil
  end
end

Public Instance Methods

bamboo_url(spec, app) click to toggle source
# File lib/config.rb, line 27
def bamboo_url(spec, app)
  return key_search("bamboo_url", spec, app)
end
chronos_url(spec, app) click to toggle source
# File lib/config.rb, line 19
def chronos_url(spec, app)
  return key_search("chronos_url", spec, app)
end
marathon_url(spec, app) click to toggle source
# File lib/config.rb, line 23
def marathon_url(spec, app)
  return key_search("marathon_url", spec, app)
end
setup_config(settings) click to toggle source
# File lib/config.rb, line 60
def setup_config(settings)

  if @APP_CONFIG.nil?
    @APP_CONFIG = {}
  end

  settings.each do |key, value|
    if settings[key] != ""
      @APP_CONFIG[key] = value
    end
  end

  if ! File.directory?("#{Dir.home}/.orch")
    Dir.mkdir("#{Dir.home}/.orch")
  end
  File.open(@config_path, 'w') {|f| f.write @APP_CONFIG.to_yaml}
end