dnsimple-ruby 0.9.4 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -10,17 +10,17 @@ GEM
10
10
  ffi (~> 1.0.6)
11
11
  columnize (0.3.2)
12
12
  crack (0.1.8)
13
- cucumber (0.10.0)
13
+ cucumber (0.10.2)
14
14
  builder (>= 2.1.2)
15
- diff-lcs (~> 1.1.2)
16
- gherkin (~> 2.3.2)
17
- json (~> 1.4.6)
18
- term-ansicolor (~> 1.0.5)
15
+ diff-lcs (>= 1.1.2)
16
+ gherkin (>= 2.3.5)
17
+ json (>= 1.4.6)
18
+ term-ansicolor (>= 1.0.5)
19
19
  diff-lcs (1.1.2)
20
20
  ffi (1.0.7)
21
21
  rake (>= 0.8.7)
22
- gherkin (2.3.4)
23
- json (~> 1.4.6)
22
+ gherkin (2.3.5)
23
+ json (>= 1.4.6)
24
24
  git (1.2.5)
25
25
  httparty (0.7.4)
26
26
  crack (= 0.1.8)
@@ -28,7 +28,7 @@ GEM
28
28
  bundler (~> 1.0.0)
29
29
  git (>= 1.2.5)
30
30
  rake
31
- json (1.4.6)
31
+ json (1.5.1)
32
32
  linecache (0.43)
33
33
  rake (0.8.7)
34
34
  rspec (2.5.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.4
1
+ 0.9.5
@@ -30,7 +30,7 @@ module DNSimple #:nodoc:
30
30
  # be undone.
31
31
  def delete(options={})
32
32
  options.merge!(DNSimple::Client.standard_options_with_credentials)
33
- self.class.delete("#{Client.base_uri}/domains/#{id}", options)
33
+ self.class.delete("#{DNSimple::Client.base_uri}/domains/#{id}", options)
34
34
  end
35
35
  alias :destroy :delete
36
36
 
@@ -39,7 +39,7 @@ module DNSimple #:nodoc:
39
39
  def apply(template, options={})
40
40
  options.merge!(DNSimple::Client.standard_options_with_credentials)
41
41
  template = resolve_template(template)
42
- self.class.post("#{Client.base_uri}/domains/#{id}/templates/#{template.id}/apply", options)
42
+ self.class.post("#{DNSimple::Client.base_uri}/domains/#{id}/templates/#{template.id}/apply", options)
43
43
  end
44
44
 
45
45
  #:nodoc:
@@ -55,10 +55,10 @@ module DNSimple #:nodoc:
55
55
  def applied_services(options={})
56
56
  options.merge!(DNSimple::Client.standard_options_with_credentials)
57
57
  response = self.class.get("#{Client.base_uri}/domains/#{id}/applied_services", options)
58
- pp response if Client.debug?
58
+ pp response if DNSimple::Client.debug?
59
59
  case response.code
60
60
  when 200
61
- response.map { |r| Service.new(r["service"]) }
61
+ response.map { |r| DNSimple::Service.new(r["service"]) }
62
62
  when 401
63
63
  raise RuntimeError, "Authentication failed"
64
64
  else
@@ -68,11 +68,11 @@ module DNSimple #:nodoc:
68
68
 
69
69
  def available_services(options={})
70
70
  options.merge!(DNSimple::Client.standard_options_with_credentials)
71
- response = self.class.get("#{Client.base_uri}/domains/#{id}/available_services", options)
72
- pp response if Client.debug?
71
+ response = self.class.get("#{DNSimple::Client.base_uri}/domains/#{id}/available_services", options)
72
+ pp response if DNSimple::Client.debug?
73
73
  case response.code
74
74
  when 200
75
- response.map { |r| Service.new(r["service"]) }
75
+ response.map { |r| DNSimple::Service.new(r["service"]) }
76
76
  when 401
77
77
  raise RuntimeError, "Authentication failed"
78
78
  else
@@ -83,8 +83,8 @@ module DNSimple #:nodoc:
83
83
  def add_service(id_or_short_name, options={})
84
84
  options.merge!(DNSimple::Client.standard_options_with_credentials)
85
85
  options.merge!(:body => {:service => {:id => id_or_short_name}})
86
- response = self.class.post("#{Client.base_uri}/domains/#{name}/applied_services", options)
87
- pp response if Client.debug?
86
+ response = self.class.post("#{DNSimple::Client.base_uri}/domains/#{name}/applied_services", options)
87
+ pp response if DNSimple::Client.debug?
88
88
  case response.code
89
89
  when 200
90
90
  true
@@ -97,8 +97,8 @@ module DNSimple #:nodoc:
97
97
 
98
98
  def remove_service(id, options={})
99
99
  options.merge!(DNSimple::Client.standard_options_with_credentials)
100
- response = self.class.delete("#{Client.base_uri}/domains/#{name}/applied_services/#{id}", options)
101
- pp response if Client.debug?
100
+ response = self.class.delete("#{DNSimple::Client.base_uri}/domains/#{name}/applied_services/#{id}", options)
101
+ pp response if DNSimple::Client.debug?
102
102
  case response.code
103
103
  when 200
104
104
  true
@@ -112,8 +112,8 @@ module DNSimple #:nodoc:
112
112
  # Check the availability of a name
113
113
  def self.check(name, options={})
114
114
  options.merge!(DNSimple::Client.standard_options_with_credentials)
115
- response = self.get("#{Client.base_uri}/domains/#{name}/check", options)
116
- pp response if Client.debug?
115
+ response = self.get("#{DNSimple::Client.base_uri}/domains/#{name}/check", options)
116
+ pp response if DNSimple::Client.debug?
117
117
  case response.code
118
118
  when 200
119
119
  "registered"
@@ -135,13 +135,13 @@ module DNSimple #:nodoc:
135
135
  domain_hash = {:name => name}
136
136
  options.merge!({:body => {:domain => domain_hash}})
137
137
 
138
- response = self.post("#{Client.base_uri}/domains", options)
138
+ response = self.post("#{DNSimple::Client.base_uri}/domains", options)
139
139
 
140
- pp response if Client.debug?
140
+ pp response if DNSimple::Client.debug?
141
141
 
142
142
  case response.code
143
143
  when 201
144
- return Domain.new(response["domain"])
144
+ return DNSimple::Domain.new(response["domain"])
145
145
  when 401
146
146
  raise RuntimeError, "Authentication failed"
147
147
  else
@@ -161,13 +161,13 @@ module DNSimple #:nodoc:
161
161
  body.merge!(:extended_attribute => extended_attributes)
162
162
  options.merge!({:body => body})
163
163
 
164
- response = self.post("#{Client.base_uri}/domain_registrations", options)
164
+ response = self.post("#{DNSimple::Client.base_uri}/domain_registrations", options)
165
165
 
166
- pp response if Client.debug?
166
+ pp response if DNSimple::Client.debug?
167
167
 
168
168
  case response.code
169
169
  when 201
170
- return Domain.new(response["domain"])
170
+ return DNSimple::Domain.new(response["domain"])
171
171
  when 401
172
172
  raise RuntimeError, "Authentication failed"
173
173
  else
@@ -179,13 +179,13 @@ module DNSimple #:nodoc:
179
179
  # or by the fully-qualified domain name.
180
180
  def self.find(id_or_name, options={})
181
181
  options.merge!(DNSimple::Client.standard_options_with_credentials)
182
- response = self.get("#{Client.base_uri}/domains/#{id_or_name}", options)
182
+ response = self.get("#{DNSimple::Client.base_uri}/domains/#{id_or_name}", options)
183
183
 
184
- pp response if Client.debug?
184
+ pp response if DNSimple::Client.debug?
185
185
 
186
186
  case response.code
187
187
  when 200
188
- return Domain.new(response["domain"])
188
+ return DNSimple::Domain.new(response["domain"])
189
189
  when 401
190
190
  raise RuntimeError, "Authentication failed"
191
191
  when 404
@@ -198,13 +198,13 @@ module DNSimple #:nodoc:
198
198
  # Get all domains for the account.
199
199
  def self.all(options={})
200
200
  options.merge!(DNSimple::Client.standard_options_with_credentials)
201
- response = self.get("#{Client.base_uri}/domains", options)
201
+ response = self.get("#{DNSimple::Client.base_uri}/domains", options)
202
202
 
203
- pp response if Client.debug?
203
+ pp response if DNSimple::Client.debug?
204
204
 
205
205
  case response.code
206
206
  when 200
207
- response.map { |r| Domain.new(r["domain"]) }
207
+ response.map { |r| DNSimple::Domain.new(r["domain"]) }
208
208
  when 401
209
209
  raise RuntimeError, "Authentication failed"
210
210
  else
@@ -31,15 +31,15 @@ module DNSimple
31
31
  def save(options={})
32
32
  record_hash = {}
33
33
  %w(name content ttl prio).each do |attribute|
34
- record_hash[Record.resolve(attribute)] = self.send(attribute)
34
+ record_hash[DNSimple::Record.resolve(attribute)] = self.send(attribute)
35
35
  end
36
36
 
37
37
  options.merge!(DNSimple::Client.standard_options_with_credentials)
38
38
  options.merge!(:body => {:record => record_hash})
39
39
 
40
- response = self.class.put("#{Client.base_uri}/domains/#{domain.id}/records/#{id}.json", options)
40
+ response = self.class.put("#{DNSimple::Client.base_uri}/domains/#{domain.id}/records/#{id}.json", options)
41
41
 
42
- pp response if Client.debug?
42
+ pp response if DNSimple::Client.debug?
43
43
 
44
44
  case response.code
45
45
  when 200
@@ -53,7 +53,7 @@ module DNSimple
53
53
 
54
54
  def delete(options={})
55
55
  options.merge!(DNSimple::Client.standard_options_with_credentials)
56
- self.class.delete("#{Client.base_uri}/domains/#{domain.id}/records/#{id}", options)
56
+ self.class.delete("#{DNSimple::Client.base_uri}/domains/#{domain.id}/records/#{id}", options)
57
57
  end
58
58
  alias :destroy :delete
59
59
 
@@ -66,7 +66,7 @@ module DNSimple
66
66
  end
67
67
 
68
68
  def self.create(domain_name, name, record_type, content, options={})
69
- domain = Domain.find(domain_name)
69
+ domain = DNSimple::Domain.find(domain_name)
70
70
 
71
71
  record_hash = {:name => name, :record_type => record_type, :content => content}
72
72
  record_hash[:ttl] = options.delete(:ttl) || 3600
@@ -76,13 +76,13 @@ module DNSimple
76
76
  options.merge!(DNSimple::Client.standard_options_with_credentials)
77
77
  options.merge!({:query => {:record => record_hash}})
78
78
 
79
- response = self.post("#{Client.base_uri}/domains/#{domain.id}/records", options)
79
+ response = self.post("#{DNSimple::Client.base_uri}/domains/#{domain.id}/records", options)
80
80
 
81
- pp response if Client.debug?
81
+ pp response if DNSimple::Client.debug?
82
82
 
83
83
  case response.code
84
84
  when 201
85
- return Record.new({:domain => domain}.merge(response["record"]))
85
+ return DNSimple::Record.new({:domain => domain}.merge(response["record"]))
86
86
  when 401
87
87
  raise RuntimeError, "Authentication failed"
88
88
  when 406
@@ -93,15 +93,15 @@ module DNSimple
93
93
  end
94
94
 
95
95
  def self.find(domain_name, id, options={})
96
- domain = Domain.find(domain_name)
96
+ domain = DNSimple::Domain.find(domain_name)
97
97
  options.merge!(DNSimple::Client.standard_options_with_credentials)
98
- response = self.get("#{Client.base_uri}/domains/#{domain.id}/records/#{id}", options)
98
+ response = self.get("#{DNSimple::Client.base_uri}/domains/#{domain.id}/records/#{id}", options)
99
99
 
100
- pp response if Client.debug?
100
+ pp response if DNSimple::Client.debug?
101
101
 
102
102
  case response.code
103
103
  when 200
104
- return Record.new({:domain => domain}.merge(response["record"]))
104
+ return DNSimple::Record.new({:domain => domain}.merge(response["record"]))
105
105
  when 401
106
106
  raise RuntimeError, "Authentication failed"
107
107
  when 404
@@ -112,15 +112,15 @@ module DNSimple
112
112
  end
113
113
 
114
114
  def self.all(domain_name, options={})
115
- domain = Domain.find(domain_name)
115
+ domain = DNSimple::Domain.find(domain_name)
116
116
  options.merge!(DNSimple::Client.standard_options_with_credentials)
117
- response = self.get("#{Client.base_uri}/domains/#{domain.id}/records", options)
117
+ response = self.get("#{DNSimple::Client.base_uri}/domains/#{domain.id}/records", options)
118
118
 
119
- pp response if Client.debug?
119
+ pp response if DNSimple::Client.debug?
120
120
 
121
121
  case response.code
122
122
  when 200
123
- response.map { |r| Record.new({:domain => domain}.merge(r["record"])) }
123
+ response.map { |r| DNSimple::Record.new({:domain => domain}.merge(r["record"])) }
124
124
  when 401
125
125
  raise RuntimeError, "Authentication failed"
126
126
  else
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnsimple-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
4
+ hash: 49
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 4
10
- version: 0.9.4
9
+ - 5
10
+ version: 0.9.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Anthony Eden
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-26 00:00:00 +01:00
18
+ date: 2011-04-02 00:00:00 +02:00
19
19
  default_executable: dnsimple
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency