lib/aptly_misc.rb in aptly_cli-0.2.3 vs lib/aptly_misc.rb in aptly_cli-0.2.4

- old
+ new

@@ -1,36 +1,33 @@ -require "aptly_cli/version" -require "aptly_load" -require "httmultiparty" -require "json" +require 'aptly_cli/version' +require 'aptly_load' +require 'httmultiparty' +require 'json' module AptlyCli + # Misc Aptly Class class AptlyMisc - include HTTMultiParty # Load aptly-cli.conf and establish base_uri - config = AptlyCli::AptlyLoad.new.configure_with("/etc/aptly-cli.conf") + config = AptlyCli::AptlyLoad.new.configure_with('/etc/aptly-cli.conf') base_uri "http://#{config[:server]}:#{config[:port]}/api" if config[:username] if config[:password] - basic_auth "#{config[:username]}", "#{config[:password]}" + basic_auth config[:username].to_s, config[:password].to_s end end - if config[:debug] == true - debug_output $stdout - end + debug_output $stdout if config[:debug] == true def get_graph(extension) uri = "/graph.#{extension}" self.class.get(uri) end - def get_version() - uri = "/version" + def get_version + uri = '/version' self.class.get(uri) end - end end