dnsimple-ruby 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  pkg
2
2
  rdoc
3
3
  turbulence
4
+ .rvmrc
@@ -59,10 +59,10 @@ class DNSimple::Client
59
59
  def self.load_credentials(path=config_path)
60
60
  begin
61
61
  credentials = YAML.load(File.new(File.expand_path(path)))
62
- self.username = credentials['username']
63
- self.password = credentials['password']
64
- self.api_token = credentials['api_token']
65
- self.base_uri = credentials['site']
62
+ self.username ||= credentials['username']
63
+ self.password ||= credentials['password']
64
+ self.api_token ||= credentials['api_token']
65
+ self.base_uri ||= credentials['site']
66
66
  self.http_proxy = { :addr => credentials['proxy_addr'], :port => credentials['proxy_port'] }
67
67
  @credentials_loaded = true
68
68
  "Credentials loaded from #{path}"
@@ -80,10 +80,15 @@ class DNSimple::Client
80
80
  options = {
81
81
  :format => :json,
82
82
  :headers => {'Accept' => 'application/json'},
83
- :http_proxyaddr => self.http_proxy[:addr],
84
- :http_proxyport => self.http_proxy[:port]
85
83
  }
86
84
 
85
+ if http_proxy
86
+ options.merge!(
87
+ :http_proxyaddr => self.http_proxy[:addr],
88
+ :http_proxyport => self.http_proxy[:port]
89
+ )
90
+ end
91
+
87
92
  if password
88
93
  options[:basic_auth] = {:username => username, :password => password}
89
94
  elsif api_token
@@ -1,3 +1,3 @@
1
1
  module DNSimple
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnsimple-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-29 00:00:00.000000000 Z
12
+ date: 2012-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty