dnsimple 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -2
  3. data/README.md +5 -4
  4. data/dnsimple.gemspec +3 -3
  5. data/lib/dnsimple.rb +1 -0
  6. data/lib/dnsimple/client.rb +37 -11
  7. data/lib/dnsimple/client/accounts.rb +26 -0
  8. data/lib/dnsimple/client/clients.rb +15 -1
  9. data/lib/dnsimple/client/contacts.rb +16 -7
  10. data/lib/dnsimple/client/domains.rb +20 -6
  11. data/lib/dnsimple/client/domains_email_forwards.rb +17 -8
  12. data/lib/dnsimple/client/identity.rb +2 -5
  13. data/lib/dnsimple/client/registrar.rb +1 -1
  14. data/lib/dnsimple/client/registrar_auto_renewal.rb +2 -2
  15. data/lib/dnsimple/client/services.rb +15 -3
  16. data/lib/dnsimple/client/templates.rb +16 -4
  17. data/lib/dnsimple/client/templates_records.rb +135 -0
  18. data/lib/dnsimple/client/tlds.rb +13 -4
  19. data/lib/dnsimple/client/webhooks.rb +11 -2
  20. data/lib/dnsimple/client/zones.rb +19 -5
  21. data/lib/dnsimple/client/zones_records.rb +48 -11
  22. data/lib/dnsimple/default.rb +2 -2
  23. data/lib/dnsimple/extra.rb +3 -3
  24. data/lib/dnsimple/options.rb +53 -0
  25. data/lib/dnsimple/struct.rb +2 -0
  26. data/lib/dnsimple/struct/account.rb +3 -0
  27. data/lib/dnsimple/struct/contact.rb +0 -3
  28. data/lib/dnsimple/struct/record.rb +2 -2
  29. data/lib/dnsimple/struct/template_record.rb +34 -0
  30. data/lib/dnsimple/struct/whoami.rb +30 -0
  31. data/lib/dnsimple/version.rb +1 -1
  32. data/spec/dnsimple/client/accounts_spec.rb +31 -0
  33. data/spec/dnsimple/client/contacts_spec.rb +19 -2
  34. data/spec/dnsimple/client/domains_email_forwards_spec.rb +18 -1
  35. data/spec/dnsimple/client/domains_spec.rb +30 -1
  36. data/spec/dnsimple/client/identity_spec.rb +6 -6
  37. data/spec/dnsimple/client/services_spec.rb +30 -1
  38. data/spec/dnsimple/client/templates_records_spec.rb +226 -0
  39. data/spec/dnsimple/client/templates_spec.rb +30 -1
  40. data/spec/dnsimple/client/tlds_spec.rb +18 -1
  41. data/spec/dnsimple/client/webhooks_spec.rb +6 -0
  42. data/spec/dnsimple/client/zones_records_spec.rb +30 -1
  43. data/spec/dnsimple/client/zones_spec.rb +30 -1
  44. data/spec/dnsimple/client_spec.rb +35 -14
  45. data/spec/dnsimple/options/base_spec.rb +22 -0
  46. data/spec/dnsimple/options/list_options_spec.rb +100 -0
  47. data/spec/fixtures.http/accounts/success-account.http +21 -0
  48. data/spec/fixtures.http/accounts/success-user.http +21 -0
  49. data/spec/fixtures.http/createContact/created.http +1 -1
  50. data/spec/fixtures.http/createTemplateRecord/created.http +17 -0
  51. data/spec/fixtures.http/deleteTemplateRecord/success.http +13 -0
  52. data/spec/fixtures.http/getContact/success.http +1 -1
  53. data/spec/fixtures.http/getTemplateRecord/success.http +17 -0
  54. data/spec/fixtures.http/listContacts/success.http +1 -1
  55. data/spec/fixtures.http/listTemplateRecords/success.http +17 -0
  56. data/spec/fixtures.http/notfound-template.http +12 -0
  57. data/spec/fixtures.http/updateContact/success.http +1 -1
  58. data/spec/spec_helper.rb +0 -11
  59. metadata +35 -2
@@ -31,7 +31,7 @@ describe Dnsimple::Client do
31
31
  subject = described_class.new(username: "user", password: "pass")
32
32
  subject.execute(:get, "test", {})
33
33
 
34
- expect(WebMock).to have_requested(:get, "https://user:pass@api.dnsimple.com/test")
34
+ expect(WebMock).to have_requested(:get, "https://api.dnsimple.com/test").with(basic_auth: %w(user pass))
35
35
  end
36
36
 
37
37
  it "uses access token if there's an access token provided" do
@@ -43,14 +43,6 @@ describe Dnsimple::Client do
43
43
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.com/test").
44
44
  with { |req| req.headers["Authorization"] == "Bearer access-token" }
45
45
  end
46
-
47
- it "raises an error if there's no password, domain token or access token provided" do
48
- subject = described_class.new(username: "user", oauth_client_id: "id", oauth_client_secret: "secret")
49
-
50
- expect {
51
- subject.execute(:get, "test", {})
52
- }.to raise_error(Dnsimple::Error, "A password, domain API token or access token is required for all API requests.")
53
- end
54
46
  end
55
47
 
56
48
  describe "#get" do
@@ -124,8 +116,9 @@ describe Dnsimple::Client do
124
116
 
125
117
  subject.request(:get, 'foo', {})
126
118
 
127
- expect(WebMock).to have_requested(:get, "https://user:pass@api.dnsimple.com/foo").
128
- with(headers: { 'Accept' => 'application/json', 'User-Agent' => "dnsimple-ruby/#{Dnsimple::VERSION}" })
119
+ expect(WebMock).to have_requested(:get, "https://api.dnsimple.com/foo").
120
+ with(basic_auth: %w(user pass),
121
+ headers: { 'Accept' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT })
129
122
  end
130
123
 
131
124
  it "delegates to HTTParty" do
@@ -136,7 +129,7 @@ describe Dnsimple::Client do
136
129
  "#{subject.base_url}foo",
137
130
  format: :json,
138
131
  basic_auth: { username: "user", password: "pass" },
139
- headers: { 'Accept' => 'application/json', 'User-Agent' => "dnsimple-ruby/#{Dnsimple::VERSION}" }
132
+ headers: { 'Accept' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT }
140
133
  ).
141
134
  and_return(double('response', code: 200))
142
135
 
@@ -151,7 +144,7 @@ describe Dnsimple::Client do
151
144
  body: JSON.dump(something: "else"),
152
145
  query: { foo: "bar" },
153
146
  basic_auth: { username: "user", password: "pass" },
154
- headers: { 'Accept' => 'application/json', 'Content-Type' => 'application/json', 'User-Agent' => "dnsimple-ruby/#{Dnsimple::VERSION}", "Custom" => "Header" }
147
+ headers: { 'Accept' => 'application/json', 'Content-Type' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT, "Custom" => "Header" }
155
148
  ).
156
149
  and_return(double('response', code: 200))
157
150
 
@@ -165,12 +158,40 @@ describe Dnsimple::Client do
165
158
  format: :json,
166
159
  body: { something: "else" },
167
160
  basic_auth: { username: "user", password: "pass" },
168
- headers: { 'Accept' => 'application/json', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => "dnsimple-ruby/#{Dnsimple::VERSION}" }
161
+ headers: { 'Accept' => 'application/json', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => Dnsimple::Default::USER_AGENT }
169
162
  ).
170
163
  and_return(double('response', code: 200))
171
164
 
172
165
  subject.request(:post, 'foo', { something: "else" }, { headers: { "Content-Type" => "application/x-www-form-urlencoded" } })
173
166
  end
167
+
168
+ it "includes options for proxy support" do
169
+ expect(HTTParty).to receive(:get).
170
+ with(
171
+ "#{subject.base_url}test",
172
+ format: :json,
173
+ http_proxyaddr: "example-proxy.com",
174
+ http_proxyport: "4321",
175
+ headers: { 'Accept' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT }
176
+ ).
177
+ and_return(double('response', code: 200))
178
+
179
+ subject = described_class.new(proxy: "example-proxy.com:4321")
180
+ subject.request(:get, "test", nil, {})
181
+ end
182
+
183
+ it "supports custom user agent" do
184
+ expect(HTTParty).to receive(:get).
185
+ with(
186
+ "#{subject.base_url}test",
187
+ format: :json,
188
+ headers: hash_including("User-Agent" => "#{Dnsimple::Default::USER_AGENT} customAgent")
189
+ ).
190
+ and_return(double("response", code: 200))
191
+
192
+ subject = described_class.new(user_agent: "customAgent")
193
+ subject.request(:get, "test", nil)
194
+ end
174
195
  end
175
196
 
176
197
  end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Dnsimple::Options::Base do
4
+ describe '#initialize' do
5
+ it 'accepts a hash' do
6
+ hash = { a: 1 }
7
+ expect(described_class.new(hash).to_h).to eq(hash)
8
+ end
9
+
10
+ it 'accepts nil' do
11
+ expect(described_class.new(nil).to_h).to eq({})
12
+ end
13
+
14
+ it 'duplicates given hash' do
15
+ hash = { a: [1] }
16
+ base = described_class.new(hash)
17
+ base.to_h[:a] << 2
18
+
19
+ expect(base.to_h).to eq(hash)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,100 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Dnsimple::Options::ListOptions do
4
+ describe '#to_h' do
5
+ it 'returns empty hash if given options equal to nil' do
6
+ options = described_class.new(nil)
7
+ expect(options.to_h).to eq({})
8
+ end
9
+
10
+ it 'returns empty hash if given options are empty' do
11
+ options = described_class.new({})
12
+ expect(options.to_h).to eq({})
13
+ end
14
+
15
+ context 'query' do
16
+ it 'adds "query" key if given options are filled' do
17
+ options = described_class.new(a: 1)
18
+ expect(options.to_h).to have_key(:query)
19
+ end
20
+ end
21
+
22
+ context 'pagination' do
23
+ it 'adds "page" to "query"' do
24
+ raw = { page: '23' }
25
+ expected = { query: raw }
26
+ options = described_class.new(raw)
27
+
28
+ expect(options.to_h).to eq(expected)
29
+ end
30
+
31
+ it 'adds "per_page" to "query"' do
32
+ raw = { per_page: '500' }
33
+ expected = { query: raw }
34
+ options = described_class.new(raw)
35
+
36
+ expect(options.to_h).to eq(expected)
37
+ end
38
+
39
+ it 'combines "page" and "per_page"' do
40
+ raw = { page: '1', per_page: '100' }
41
+ expected = { query: raw }
42
+ options = described_class.new(raw)
43
+
44
+ expect(options.to_h).to eq(expected)
45
+ end
46
+ end
47
+
48
+ context 'sorting' do
49
+ it 'adds sorting policy to "query"' do
50
+ raw = { sort: 'name:desc' }
51
+ expected = { query: raw }
52
+ options = described_class.new(raw)
53
+
54
+ expect(options.to_h).to eq(expected)
55
+ end
56
+
57
+ it 'combines with filtering' do
58
+ raw = { sort: 'name:desc', filter: { name: 'foo' } }
59
+ expected = { query: { sort: raw.fetch(:sort) }.merge(raw.fetch(:filter)) }
60
+ options = described_class.new(raw)
61
+
62
+ expect(options.to_h).to eq(expected)
63
+ end
64
+
65
+ it 'combines with pagination' do
66
+ raw = { sort: 'name:desc', page: '2', per_page: '100' }
67
+ expected = { query: raw }
68
+ options = described_class.new(raw)
69
+
70
+ expect(options.to_h).to eq(expected)
71
+ end
72
+ end
73
+
74
+ context 'filtering' do
75
+ it 'adds filtering policy to "query"' do
76
+ raw = { filter: { name_like: 'example' } }
77
+ expected = { query: raw.fetch(:filter) }
78
+ options = described_class.new(raw)
79
+
80
+ expect(options.to_h).to eq(expected)
81
+ end
82
+
83
+ it 'combines with sorting' do
84
+ raw = { filter: { name_like: 'bar' }, sort: 'tld:desc' }
85
+ expected = { query: raw.fetch(:filter).merge(sort: raw.fetch(:sort)) }
86
+ options = described_class.new(raw)
87
+
88
+ expect(options.to_h).to eq(expected)
89
+ end
90
+
91
+ it 'combines with pagination' do
92
+ raw = { filter: { name_like: 'example' }, page: '1', per_page: '20' }
93
+ expected = { query: { page: raw.fetch(:page), per_page: raw.fetch(:per_page) }.merge(raw.fetch(:filter)) }
94
+ options = described_class.new(raw)
95
+
96
+ expect(options.to_h).to eq(expected)
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,21 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Tue, 14 Jun 2016 12:02:58 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ X-RateLimit-Limit: 2400
8
+ X-RateLimit-Remaining: 2391
9
+ X-RateLimit-Reset: 1465908577
10
+ ETag: W/"9ef3b4bf1f441a9b1cd6d7041bc181aa"
11
+ Cache-Control: max-age=0, private, must-revalidate
12
+ X-Request-Id: f705b65b-3589-43ad-97ca-3b2821d49d81
13
+ X-Runtime: 0.012661
14
+ X-Content-Type-Options: nosniff
15
+ X-Download-Options: noopen
16
+ X-Frame-Options: DENY
17
+ X-Permitted-Cross-Domain-Policies: none
18
+ X-XSS-Protection: 1; mode=block
19
+ Strict-Transport-Security: max-age=31536000
20
+
21
+ {"data":[{"id":123,"email":"john@example.com","plan_identifier":"dnsimple-personal","created_at":"2011-09-11T17:15:58.930Z","updated_at":"2016-06-03T15:02:26.325Z"}]}
@@ -0,0 +1,21 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Tue, 14 Jun 2016 12:05:38 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ X-RateLimit-Limit: 2400
8
+ X-RateLimit-Remaining: 2390
9
+ X-RateLimit-Reset: 1465908577
10
+ ETag: W/"b8dc5b6e94652da599d15d4668b723b5"
11
+ Cache-Control: max-age=0, private, must-revalidate
12
+ X-Request-Id: 745455ba-3871-440d-b703-1448b9708c14
13
+ X-Runtime: 0.014727
14
+ X-Content-Type-Options: nosniff
15
+ X-Download-Options: noopen
16
+ X-Frame-Options: DENY
17
+ X-Permitted-Cross-Domain-Policies: none
18
+ X-XSS-Protection: 1; mode=block
19
+ Strict-Transport-Security: max-age=31536000
20
+
21
+ {"data":[{"id":123,"email":"john@example.com","plan_identifier":"dnsimple-personal","created_at":"2011-09-11T17:15:58.930Z","updated_at":"2016-06-03T15:02:26.325Z"},{"id":456,"email":"ops@company.com","plan_identifier":"dnsimple-professional","created_at":"2012-03-16T16:02:54.736Z","updated_at":"2016-06-14T11:23:16.828Z"}]}
@@ -14,4 +14,4 @@ X-Request-Id: 9f577b9e-5bc4-4a8f-adfb-09dbb1992b0e
14
14
  X-Runtime: 0.061482
15
15
  Strict-Transport-Security: max-age=31536000
16
16
 
17
- {"data":{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email_address":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2016-01-19T20:50:26.066Z","updated_at":"2016-01-19T20:50:26.066Z"}}
17
+ {"data":{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2016-01-19T20:50:26.066Z","updated_at":"2016-01-19T20:50:26.066Z"}}
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 201 Created
2
+ Server: nginx
3
+ Date: Tue, 03 May 2016 07:51:33 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 201 Created
8
+ X-RateLimit-Limit: 2400
9
+ X-RateLimit-Remaining: 2398
10
+ X-RateLimit-Reset: 1462265481
11
+ ETag: W/"a8518ecf2fd31e6c22b0acccb5cef797"
12
+ Cache-Control: max-age=0, private, must-revalidate
13
+ X-Request-Id: b2d51e79-b3d2-4abe-9184-155fb5546617
14
+ X-Runtime: 0.190813
15
+ Strict-Transport-Security: max-age=31536000
16
+
17
+ {"data":{"id":300,"template_id":268,"name":"","content":"mx.example.com","ttl":600,"priority":10,"type":"MX","created_at":"2016-05-03T07:51:33.202Z","updated_at":"2016-05-03T07:51:33.202Z"}}
@@ -0,0 +1,13 @@
1
+ HTTP/1.1 204 No Content
2
+ Server: nginx
3
+ Date: Tue, 03 May 2016 08:00:35 GMT
4
+ Connection: keep-alive
5
+ Status: 204 No Content
6
+ X-RateLimit-Limit: 2400
7
+ X-RateLimit-Remaining: 2397
8
+ X-RateLimit-Reset: 1462265481
9
+ Cache-Control: no-cache
10
+ X-Request-Id: f0a48944-1c61-41f4-b379-04f8644d883b
11
+ X-Runtime: 0.122787
12
+ Strict-Transport-Security: max-age=31536000
13
+
@@ -14,4 +14,4 @@ X-Request-Id: 4c0679ed-5c79-41bf-84cb-0dc2250a07ce
14
14
  X-Runtime: 0.127802
15
15
  Strict-Transport-Security: max-age=31536000
16
16
 
17
- {"data":{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email_address":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2016-01-19T20:50:26.066Z","updated_at":"2016-01-19T20:50:26.066Z"}}
17
+ {"data":{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2016-01-19T20:50:26.066Z","updated_at":"2016-01-19T20:50:26.066Z"}}
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Tue, 03 May 2016 08:04:20 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 200 OK
8
+ X-RateLimit-Limit: 2400
9
+ X-RateLimit-Remaining: 2394
10
+ X-RateLimit-Reset: 1462265481
11
+ ETag: W/"743142eab9fecf3edb41e9b3f30a903f"
12
+ Cache-Control: max-age=0, private, must-revalidate
13
+ X-Request-Id: 6484e900-7255-4194-9ff8-ae5650ebd765
14
+ X-Runtime: 0.138017
15
+ Strict-Transport-Security: max-age=31536000
16
+
17
+ {"data":{"id":301,"template_id":268,"name":"","content":"mx.example.com","ttl":600,"priority":10,"type":"MX","created_at":"2016-05-03T08:03:26.444Z","updated_at":"2016-05-03T08:03:26.444Z"}}
@@ -14,4 +14,4 @@ X-Request-Id: 7871da61-ecf1-4771-8560-efbcf7f4b961
14
14
  X-Runtime: 0.067822
15
15
  Strict-Transport-Security: max-age=31536000
16
16
 
17
- {"data":[{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email_address":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2013-11-08T17:23:15.884Z","updated_at":"2015-01-08T21:30:50.228Z"},{"id":2,"account_id":1010,"label":"","first_name":"Second","last_name":"User","job_title":"","organization_name":"","email_address":"second@example.com","phone":"+18881234567","fax":"","address1":"French Street","address2":"c/o Someone","city":"Paris","state_province":"XY","postal_code":"00200","country":"FR","created_at":"2014-12-06T15:46:18.014Z","updated_at":"2014-12-06T15:46:18.014Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}}
17
+ {"data":[{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2013-11-08T17:23:15.884Z","updated_at":"2015-01-08T21:30:50.228Z"},{"id":2,"account_id":1010,"label":"","first_name":"Second","last_name":"User","job_title":"","organization_name":"","email_address":"second@example.com","phone":"+18881234567","fax":"","address1":"French Street","address2":"c/o Someone","city":"Paris","state_province":"XY","postal_code":"00200","country":"FR","created_at":"2014-12-06T15:46:18.014Z","updated_at":"2014-12-06T15:46:18.014Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}}
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Tue, 03 May 2016 08:07:17 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 200 OK
8
+ X-RateLimit-Limit: 2400
9
+ X-RateLimit-Remaining: 2391
10
+ X-RateLimit-Reset: 1462265481
11
+ ETag: W/"3e53584bcf1ce7c7ee4c0bdf734224fa"
12
+ Cache-Control: max-age=0, private, must-revalidate
13
+ X-Request-Id: 79c25a93-0660-4479-a71f-201c26309e00
14
+ X-Runtime: 0.252889
15
+ Strict-Transport-Security: max-age=31536000
16
+
17
+ {"data":[{"id":296,"template_id":268,"name":"","content":"192.168.1.1","ttl":3600,"priority":null,"type":"A","created_at":"2016-04-26T08:23:54.597Z","updated_at":"2016-04-26T08:23:54.597Z"},{"id":298,"template_id":268,"name":"www","content":"{{domain}}","ttl":3600,"priority":null,"type":"CNAME","created_at":"2016-04-26T08:25:11.959Z","updated_at":"2016-04-26T08:25:11.959Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}}
@@ -0,0 +1,12 @@
1
+ HTTP/1.1 404 Not Found
2
+ Server: nginx
3
+ Date: Wed, 04 May 2016 09:35:45 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 404 Not Found
8
+ Cache-Control: no-cache
9
+ X-Request-Id: 8d380d93-b974-4d51-82a3-5b10bce4167a
10
+ X-Runtime: 0.071884
11
+
12
+ {"message":"Template `beta` not found"}
@@ -14,4 +14,4 @@ X-Request-Id: c0e1e24f-d22d-4832-a30e-2f4ffc40b029
14
14
  X-Runtime: 0.053262
15
15
  Strict-Transport-Security: max-age=31536000
16
16
 
17
- {"data":{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email_address":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2016-01-19T20:50:26.066Z","updated_at":"2016-01-19T20:50:26.066Z"}}
17
+ {"data":{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2016-01-19T20:50:26.066Z","updated_at":"2016-01-19T20:50:26.066Z"}}
data/spec/spec_helper.rb CHANGED
@@ -12,15 +12,4 @@ unless defined?(SPEC_ROOT)
12
12
  SPEC_ROOT = File.expand_path("../", __FILE__)
13
13
  end
14
14
 
15
- RSpec.configure do |c|
16
- # Silent the puts call in the commands
17
- # c.before do
18
- # @_stdout = $stdout
19
- # $stdout = StringIO.new
20
- # end
21
- # c.after do
22
- # $stdout = @_stdout
23
- # end
24
- end
25
-
26
15
  Dir[File.join(SPEC_ROOT, "support/**/*.rb")].each { |f| require f }
metadata CHANGED
@@ -1,15 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnsimple
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Eden
8
8
  - Simone Carletti
9
+ - Javier Acero
10
+ - Joseph Caudle
11
+ - Luca Guidi
9
12
  autorequire:
10
13
  bindir: bin
11
14
  cert_chain: []
12
- date: 2016-04-19 00:00:00.000000000 Z
15
+ date: 2016-06-21 00:00:00.000000000 Z
13
16
  dependencies:
14
17
  - !ruby/object:Gem::Dependency
15
18
  name: httparty
@@ -85,6 +88,9 @@ description: The DNSimple API client for Ruby.
85
88
  email:
86
89
  - anthony.eden@dnsimple.com
87
90
  - simone.carletti@dnsimple.com
91
+ - javier.acero@dnsimple.com
92
+ - joseph.caudle@dnsimple.com
93
+ - luca.guidi@dnsimple.com
88
94
  executables: []
89
95
  extensions: []
90
96
  extra_rdoc_files:
@@ -108,6 +114,7 @@ files:
108
114
  - dnsimple.gemspec
109
115
  - lib/dnsimple.rb
110
116
  - lib/dnsimple/client.rb
117
+ - lib/dnsimple/client/accounts.rb
111
118
  - lib/dnsimple/client/clients.rb
112
119
  - lib/dnsimple/client/contacts.rb
113
120
  - lib/dnsimple/client/domains.rb
@@ -120,6 +127,7 @@ files:
120
127
  - lib/dnsimple/client/registrar_whois_privacy.rb
121
128
  - lib/dnsimple/client/services.rb
122
129
  - lib/dnsimple/client/templates.rb
130
+ - lib/dnsimple/client/templates_records.rb
123
131
  - lib/dnsimple/client/tlds.rb
124
132
  - lib/dnsimple/client/webhooks.rb
125
133
  - lib/dnsimple/client/zones.rb
@@ -127,6 +135,7 @@ files:
127
135
  - lib/dnsimple/default.rb
128
136
  - lib/dnsimple/error.rb
129
137
  - lib/dnsimple/extra.rb
138
+ - lib/dnsimple/options.rb
130
139
  - lib/dnsimple/response.rb
131
140
  - lib/dnsimple/struct.rb
132
141
  - lib/dnsimple/struct/account.rb
@@ -139,12 +148,15 @@ files:
139
148
  - lib/dnsimple/struct/record.rb
140
149
  - lib/dnsimple/struct/service.rb
141
150
  - lib/dnsimple/struct/template.rb
151
+ - lib/dnsimple/struct/template_record.rb
142
152
  - lib/dnsimple/struct/tld.rb
143
153
  - lib/dnsimple/struct/user.rb
144
154
  - lib/dnsimple/struct/webhook.rb
155
+ - lib/dnsimple/struct/whoami.rb
145
156
  - lib/dnsimple/struct/whois_privacy.rb
146
157
  - lib/dnsimple/struct/zone.rb
147
158
  - lib/dnsimple/version.rb
159
+ - spec/dnsimple/client/accounts_spec.rb
148
160
  - spec/dnsimple/client/client_service_spec.rb
149
161
  - spec/dnsimple/client/contacts_spec.rb
150
162
  - spec/dnsimple/client/domains_email_forwards_spec.rb
@@ -156,6 +168,7 @@ files:
156
168
  - spec/dnsimple/client/registrar_spec.rb
157
169
  - spec/dnsimple/client/registrar_whois_privacy_spec.rb
158
170
  - spec/dnsimple/client/services_spec.rb
171
+ - spec/dnsimple/client/templates_records_spec.rb
159
172
  - spec/dnsimple/client/templates_spec.rb
160
173
  - spec/dnsimple/client/tlds_spec.rb
161
174
  - spec/dnsimple/client/webhooks_spec.rb
@@ -163,6 +176,10 @@ files:
163
176
  - spec/dnsimple/client/zones_spec.rb
164
177
  - spec/dnsimple/client_spec.rb
165
178
  - spec/dnsimple/extra_spec.rb
179
+ - spec/dnsimple/options/base_spec.rb
180
+ - spec/dnsimple/options/list_options_spec.rb
181
+ - spec/fixtures.http/accounts/success-account.http
182
+ - spec/fixtures.http/accounts/success-user.http
166
183
  - spec/fixtures.http/badgateway.http
167
184
  - spec/fixtures.http/changeDomainDelegation/success.http
168
185
  - spec/fixtures.http/checkDomain/success.http
@@ -170,12 +187,14 @@ files:
170
187
  - spec/fixtures.http/createDomain/created.http
171
188
  - spec/fixtures.http/createEmailForward/created.http
172
189
  - spec/fixtures.http/createTemplate/created.http
190
+ - spec/fixtures.http/createTemplateRecord/created.http
173
191
  - spec/fixtures.http/createWebhook/created.http
174
192
  - spec/fixtures.http/createZoneRecord/created.http
175
193
  - spec/fixtures.http/deleteContact/success.http
176
194
  - spec/fixtures.http/deleteDomain/success.http
177
195
  - spec/fixtures.http/deleteEmailForward/success.http
178
196
  - spec/fixtures.http/deleteTemplate/success.http
197
+ - spec/fixtures.http/deleteTemplateRecord/success.http
179
198
  - spec/fixtures.http/deleteWebhook/success.http
180
199
  - spec/fixtures.http/deleteZoneRecord/success.http
181
200
  - spec/fixtures.http/disableAutoRenewal/success.http
@@ -190,6 +209,7 @@ files:
190
209
  - spec/fixtures.http/getEmailForward/success.http
191
210
  - spec/fixtures.http/getService/success.http
192
211
  - spec/fixtures.http/getTemplate/success.http
212
+ - spec/fixtures.http/getTemplateRecord/success.http
193
213
  - spec/fixtures.http/getTld/success.http
194
214
  - spec/fixtures.http/getTldExtendedAttributes/success-noattributes.http
195
215
  - spec/fixtures.http/getTldExtendedAttributes/success.http
@@ -201,6 +221,7 @@ files:
201
221
  - spec/fixtures.http/listDomains/success.http
202
222
  - spec/fixtures.http/listEmailForwards/success.http
203
223
  - spec/fixtures.http/listServices/success.http
224
+ - spec/fixtures.http/listTemplateRecords/success.http
204
225
  - spec/fixtures.http/listTemplates/success.http
205
226
  - spec/fixtures.http/listTlds/success.http
206
227
  - spec/fixtures.http/listWebhooks/success.http
@@ -211,6 +232,7 @@ files:
211
232
  - spec/fixtures.http/notfound-domain.http
212
233
  - spec/fixtures.http/notfound-emailforward.http
213
234
  - spec/fixtures.http/notfound-record.http
235
+ - spec/fixtures.http/notfound-template.http
214
236
  - spec/fixtures.http/notfound-webhook.http
215
237
  - spec/fixtures.http/notfound-zone.http
216
238
  - spec/fixtures.http/oauthAccessToken/success.http
@@ -259,6 +281,7 @@ signing_key:
259
281
  specification_version: 4
260
282
  summary: The DNSimple API client for Ruby
261
283
  test_files:
284
+ - spec/dnsimple/client/accounts_spec.rb
262
285
  - spec/dnsimple/client/client_service_spec.rb
263
286
  - spec/dnsimple/client/contacts_spec.rb
264
287
  - spec/dnsimple/client/domains_email_forwards_spec.rb
@@ -270,6 +293,7 @@ test_files:
270
293
  - spec/dnsimple/client/registrar_spec.rb
271
294
  - spec/dnsimple/client/registrar_whois_privacy_spec.rb
272
295
  - spec/dnsimple/client/services_spec.rb
296
+ - spec/dnsimple/client/templates_records_spec.rb
273
297
  - spec/dnsimple/client/templates_spec.rb
274
298
  - spec/dnsimple/client/tlds_spec.rb
275
299
  - spec/dnsimple/client/webhooks_spec.rb
@@ -277,6 +301,10 @@ test_files:
277
301
  - spec/dnsimple/client/zones_spec.rb
278
302
  - spec/dnsimple/client_spec.rb
279
303
  - spec/dnsimple/extra_spec.rb
304
+ - spec/dnsimple/options/base_spec.rb
305
+ - spec/dnsimple/options/list_options_spec.rb
306
+ - spec/fixtures.http/accounts/success-account.http
307
+ - spec/fixtures.http/accounts/success-user.http
280
308
  - spec/fixtures.http/badgateway.http
281
309
  - spec/fixtures.http/changeDomainDelegation/success.http
282
310
  - spec/fixtures.http/checkDomain/success.http
@@ -284,12 +312,14 @@ test_files:
284
312
  - spec/fixtures.http/createDomain/created.http
285
313
  - spec/fixtures.http/createEmailForward/created.http
286
314
  - spec/fixtures.http/createTemplate/created.http
315
+ - spec/fixtures.http/createTemplateRecord/created.http
287
316
  - spec/fixtures.http/createWebhook/created.http
288
317
  - spec/fixtures.http/createZoneRecord/created.http
289
318
  - spec/fixtures.http/deleteContact/success.http
290
319
  - spec/fixtures.http/deleteDomain/success.http
291
320
  - spec/fixtures.http/deleteEmailForward/success.http
292
321
  - spec/fixtures.http/deleteTemplate/success.http
322
+ - spec/fixtures.http/deleteTemplateRecord/success.http
293
323
  - spec/fixtures.http/deleteWebhook/success.http
294
324
  - spec/fixtures.http/deleteZoneRecord/success.http
295
325
  - spec/fixtures.http/disableAutoRenewal/success.http
@@ -304,6 +334,7 @@ test_files:
304
334
  - spec/fixtures.http/getEmailForward/success.http
305
335
  - spec/fixtures.http/getService/success.http
306
336
  - spec/fixtures.http/getTemplate/success.http
337
+ - spec/fixtures.http/getTemplateRecord/success.http
307
338
  - spec/fixtures.http/getTld/success.http
308
339
  - spec/fixtures.http/getTldExtendedAttributes/success-noattributes.http
309
340
  - spec/fixtures.http/getTldExtendedAttributes/success.http
@@ -315,6 +346,7 @@ test_files:
315
346
  - spec/fixtures.http/listDomains/success.http
316
347
  - spec/fixtures.http/listEmailForwards/success.http
317
348
  - spec/fixtures.http/listServices/success.http
349
+ - spec/fixtures.http/listTemplateRecords/success.http
318
350
  - spec/fixtures.http/listTemplates/success.http
319
351
  - spec/fixtures.http/listTlds/success.http
320
352
  - spec/fixtures.http/listWebhooks/success.http
@@ -325,6 +357,7 @@ test_files:
325
357
  - spec/fixtures.http/notfound-domain.http
326
358
  - spec/fixtures.http/notfound-emailforward.http
327
359
  - spec/fixtures.http/notfound-record.http
360
+ - spec/fixtures.http/notfound-template.http
328
361
  - spec/fixtures.http/notfound-webhook.http
329
362
  - spec/fixtures.http/notfound-zone.http
330
363
  - spec/fixtures.http/oauthAccessToken/success.http