lib/aptly_load.rb in aptly_cli-0.2.9 vs lib/aptly_load.rb in aptly_cli-0.3.0

- old
+ new

@@ -18,26 +18,29 @@ proto: 'http', server: '127.0.0.1', port: 8082 } - @valid_config_keys = @config.keys + @valid_config_keys = @config.keys + [:username, :password, :debug] end # Configure through hash def configure(opts = {}) opts.each do |k, v| config[k.to_sym] = v if @valid_config_keys.include? k.to_sym end + + @config end # Configure through yaml file def configure_with(path_to_yaml_file) begin config = YAML.load(IO.read(path_to_yaml_file)) rescue Errno::ENOENT @log.warn( - 'YAML configuration file couldn\'t be found at /etc/aptly-cli.conf. Using defaults.') + "YAML configuration file couldn\'t be found at " \ + "#{path_to_yaml_file}. Using defaults.") return @config rescue Psych::SyntaxError @log.warn( 'YAML configuration file contains invalid syntax. Using defaults.') return @config