lib/maestrano/api/operation/base.rb in maestrano-0.5.0 vs lib/maestrano/api/operation/base.rb in maestrano-0.6.0

- old
+ new

@@ -5,11 +5,11 @@ # class << self # attr_accessor :api_token, :api_base, :verify_ssl_certs, :api_version # end def self.api_url(url='') - Maestrano.param('api_host') + Maestrano.param('api_base') + url + Maestrano.param('api.host') + Maestrano.param('api.base') + url end # Perform remote request def self.request(method, url, api_token, params={}, headers={}) unless api_token ||= Maestrano.param('api_token') @@ -67,11 +67,11 @@ end private def self.ssl_preflight_passed? - if !Maestrano.param('verify_ssl_certs') + if !Maestrano.param('api.verify_ssl_certs') #$stderr.puts "WARNING: Running without SSL cert verification. " + # "Execute 'Maestrano.configure { |config| config.verify_ssl_certs = true' } to enable verification." return false elsif !Util.file_readable(Maestrano.param('ssl_bundle_path')) $stderr.puts "WARNING: Running without SSL cert verification " + @@ -83,16 +83,15 @@ return true end def self.user_agent @uname ||= get_uname - lang_version = "#{RUBY_VERSION} p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE})" { - :bindings_version => Maestrano::VERSION, - :lang => 'ruby', - :lang_version => lang_version, + :bindings_version => Maestrano.param('api.version'), + :lang => Maestrano.param('api.lang'), + :lang_version => Maestrano.param('api.lang_version'), :platform => RUBY_PLATFORM, :publisher => 'maestrano', :uname => @uname } @@ -109,10 +108,10 @@ map { |k,v| "#{k}=#{Util.url_encode(v)}" }.join('&') end def self.request_headers(api_token) headers = { - :user_agent => "Maestrano/v1 RubyBindings/#{Maestrano::VERSION}", + :user_agent => "Maestrano/v1 RubyBindings/#{Maestrano.param('api.version')}", :authorization => "Basic #{Base64.encode64(api_token)}", :content_type => 'application/x-www-form-urlencoded' } api_version = Maestrano.param('api_version') \ No newline at end of file