Sha256: 3af7c57610fff85639c3c656018e68a65733b8764804adcf68aeb57305d6021b
Contents?: true
Size: 822 Bytes
Versions: 5
Compression:
Stored size: 822 Bytes
Contents
require 'extlib' module NexusCli module Configuration class << self def parse(overrides) config_path = File.expand_path("~/.nexus_cli") config = File.exists?(config_path) ? YAML::load_file(config_path) : Hash.new if config.nil? && (overrides.nil? || overrides.empty?) raise MissingSettingsFileException end overrides.each{|key, value| config[key] = value} unless overrides.nil? || overrides.empty? validate_config(config) config["repository"] = config["repository"].gsub(" ", "_").downcase config end def validate_config(configuration) ["url", "repository", "username", "password"].each do |key| raise InvalidSettingsException.new(key) if configuration[key].blank? end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems