Sha256: 3fa632429bf0fbe24b810cd4a22ba27b63e96622ced67705baafad9426ccc648
Contents?: true
Size: 746 Bytes
Versions: 11
Compression:
Stored size: 746 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 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
11 entries across 11 versions & 1 rubygems