dnsimple 5.1.0 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -0
  3. data/.github/dependabot.yml +13 -0
  4. data/.github/workflows/ci.yml +63 -0
  5. data/.gitignore +3 -0
  6. data/.markdownlint.yaml +3 -0
  7. data/.rubocop.yml +9 -14
  8. data/.rubocop_dnsimple.yml +28 -55
  9. data/.rubocop_todo.yml +45 -5
  10. data/CHANGELOG.md +24 -10
  11. data/CONTRIBUTING.md +8 -11
  12. data/Gemfile +3 -1
  13. data/LICENSE.txt +1 -1
  14. data/README.md +7 -11
  15. data/UPGRADING.md +4 -5
  16. data/dnsimple.gemspec +1 -1
  17. data/lib/dnsimple/client/clients.rb +3 -2
  18. data/lib/dnsimple/client/domains.rb +0 -18
  19. data/lib/dnsimple/client/domains_delegation_signer_records.rb +5 -4
  20. data/lib/dnsimple/client/registrar.rb +23 -0
  21. data/lib/dnsimple/client/registrar_whois_privacy.rb +1 -1
  22. data/lib/dnsimple/client.rb +11 -3
  23. data/lib/dnsimple/default.rb +2 -2
  24. data/lib/dnsimple/error.rb +1 -1
  25. data/lib/dnsimple/extra.rb +2 -2
  26. data/lib/dnsimple/response.rb +1 -3
  27. data/lib/dnsimple/struct/certificate.rb +2 -2
  28. data/lib/dnsimple/struct/delegation_signer_record.rb +3 -0
  29. data/lib/dnsimple/struct/domain.rb +0 -20
  30. data/lib/dnsimple/struct/domain_price.rb +24 -0
  31. data/lib/dnsimple/struct/tld.rb +3 -0
  32. data/lib/dnsimple/struct.rb +1 -0
  33. data/lib/dnsimple/version.rb +1 -1
  34. data/spec/dnsimple/client/certificates_spec.rb +33 -33
  35. data/spec/dnsimple/client/client_service_spec.rb +1 -1
  36. data/spec/dnsimple/client/contacts_spec.rb +2 -2
  37. data/spec/dnsimple/client/domains_collaborators_spec.rb +2 -2
  38. data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +2 -1
  39. data/spec/dnsimple/client/domains_email_forwards_spec.rb +8 -8
  40. data/spec/dnsimple/client/domains_pushes_spec.rb +2 -2
  41. data/spec/dnsimple/client/domains_spec.rb +1 -29
  42. data/spec/dnsimple/client/registrar_delegation_spec.rb +2 -2
  43. data/spec/dnsimple/client/registrar_spec.rb +46 -3
  44. data/spec/dnsimple/client/services_domains_spec.rb +2 -4
  45. data/spec/dnsimple/client/services_spec.rb +1 -3
  46. data/spec/dnsimple/client/templates_records_spec.rb +1 -1
  47. data/spec/dnsimple/client/templates_spec.rb +2 -2
  48. data/spec/dnsimple/client/tlds_spec.rb +1 -0
  49. data/spec/dnsimple/client/webhooks_spec.rb +1 -1
  50. data/spec/dnsimple/client/zones_records_spec.rb +2 -2
  51. data/spec/dnsimple/client/zones_spec.rb +1 -1
  52. data/spec/dnsimple/client_spec.rb +15 -15
  53. data/spec/dnsimple/extra_spec.rb +1 -1
  54. data/spec/dnsimple/options/list_options_spec.rb +4 -4
  55. data/spec/fixtures.http/accounts/success-account.http +0 -1
  56. data/spec/fixtures.http/accounts/success-user.http +0 -1
  57. data/spec/fixtures.http/addCollaborator/invite-success.http +0 -1
  58. data/spec/fixtures.http/addCollaborator/success.http +0 -1
  59. data/spec/fixtures.http/appliedServices/success.http +0 -1
  60. data/spec/fixtures.http/cancelDomainTransfer/success.http +0 -1
  61. data/spec/fixtures.http/changeDomainDelegation/success.http +0 -1
  62. data/spec/fixtures.http/changeDomainDelegationToVanity/success.http +0 -1
  63. data/spec/fixtures.http/checkDomain/success.http +0 -1
  64. data/spec/fixtures.http/checkDomainPremiumPrice/error_400_not_a_premium_domain.http +18 -0
  65. data/spec/fixtures.http/checkDomainPremiumPrice/error_400_tld_not_supported.http +18 -0
  66. data/spec/fixtures.http/checkDomainPremiumPrice/success.http +20 -0
  67. data/spec/fixtures.http/checkZoneDistribution/error.http +0 -1
  68. data/spec/fixtures.http/checkZoneDistribution/failure.http +0 -1
  69. data/spec/fixtures.http/checkZoneDistribution/success.http +0 -1
  70. data/spec/fixtures.http/checkZoneRecordDistribution/error.http +0 -1
  71. data/spec/fixtures.http/checkZoneRecordDistribution/failure.http +0 -1
  72. data/spec/fixtures.http/checkZoneRecordDistribution/success.http +0 -1
  73. data/spec/fixtures.http/createContact/created.http +0 -1
  74. data/spec/fixtures.http/createDelegationSignerRecord/created.http +1 -2
  75. data/spec/fixtures.http/createDelegationSignerRecord/validation-error.http +0 -1
  76. data/spec/fixtures.http/createDomain/created.http +0 -1
  77. data/spec/fixtures.http/createEmailForward/created.http +21 -17
  78. data/spec/fixtures.http/createPrimaryServer/created.http +21 -0
  79. data/spec/fixtures.http/createSecondaryZone/created.http +21 -0
  80. data/spec/fixtures.http/createTemplate/created.http +0 -1
  81. data/spec/fixtures.http/createTemplateRecord/created.http +0 -1
  82. data/spec/fixtures.http/createWebhook/created.http +0 -1
  83. data/spec/fixtures.http/createZoneRecord/created-apex.http +0 -1
  84. data/spec/fixtures.http/createZoneRecord/created.http +0 -1
  85. data/spec/fixtures.http/deleteContact/error-contact-in-use.http +18 -0
  86. data/spec/fixtures.http/deleteEmailForward/success.http +12 -7
  87. data/spec/fixtures.http/disableDnssec/not-enabled.http +0 -1
  88. data/spec/fixtures.http/disableWhoisPrivacy/success.http +0 -1
  89. data/spec/fixtures.http/downloadCertificate/success.http +0 -1
  90. data/spec/fixtures.http/enableDnssec/success.http +0 -1
  91. data/spec/fixtures.http/enableVanityNameServers/success.http +0 -1
  92. data/spec/fixtures.http/enableWhoisPrivacy/created.http +0 -1
  93. data/spec/fixtures.http/enableWhoisPrivacy/success.http +0 -1
  94. data/spec/fixtures.http/getCertificate/success.http +10 -11
  95. data/spec/fixtures.http/getCertificatePrivateKey/success.http +0 -1
  96. data/spec/fixtures.http/getContact/success.http +0 -1
  97. data/spec/fixtures.http/getDelegationSignerRecord/success.http +1 -2
  98. data/spec/fixtures.http/getDnssec/success.http +0 -1
  99. data/spec/fixtures.http/getDomain/success.http +0 -1
  100. data/spec/fixtures.http/getDomainDelegation/success-empty.http +0 -1
  101. data/spec/fixtures.http/getDomainDelegation/success.http +0 -1
  102. data/spec/fixtures.http/getDomainPremiumPrice/failure.http +0 -1
  103. data/spec/fixtures.http/getDomainPremiumPrice/success.http +0 -1
  104. data/spec/fixtures.http/getDomainPrices/failure.http +19 -0
  105. data/spec/fixtures.http/getDomainPrices/success.http +21 -0
  106. data/spec/fixtures.http/getDomainTransfer/success.http +0 -1
  107. data/spec/fixtures.http/getEmailForward/success.http +14 -10
  108. data/spec/fixtures.http/getPrimaryServer/success.http +21 -0
  109. data/spec/fixtures.http/getService/success.http +0 -1
  110. data/spec/fixtures.http/getTemplate/success.http +0 -1
  111. data/spec/fixtures.http/getTemplateRecord/success.http +0 -1
  112. data/spec/fixtures.http/getTld/success.http +1 -2
  113. data/spec/fixtures.http/getTldExtendedAttributes/success-attributes.http +0 -1
  114. data/spec/fixtures.http/getTldExtendedAttributes/success-noattributes.http +0 -1
  115. data/spec/fixtures.http/getTldExtendedAttributes/success.http +0 -1
  116. data/spec/fixtures.http/getWebhook/success.http +0 -1
  117. data/spec/fixtures.http/getWhoisPrivacy/success.http +0 -1
  118. data/spec/fixtures.http/getZone/success.http +0 -1
  119. data/spec/fixtures.http/getZoneFile/success.http +0 -1
  120. data/spec/fixtures.http/getZoneRecord/success.http +0 -1
  121. data/spec/fixtures.http/initiatePush/success.http +0 -1
  122. data/spec/fixtures.http/issueLetsencryptCertificate/success.http +18 -21
  123. data/spec/fixtures.http/issueRenewalLetsencryptCertificate/success.http +18 -21
  124. data/spec/fixtures.http/linkPrimaryServer/success.http +21 -0
  125. data/spec/fixtures.http/listAccounts/success-account.http +0 -1
  126. data/spec/fixtures.http/listAccounts/success-user.http +0 -1
  127. data/spec/fixtures.http/listCertificates/success.http +10 -11
  128. data/spec/fixtures.http/listCollaborators/success.http +0 -1
  129. data/spec/fixtures.http/listContacts/success.http +0 -1
  130. data/spec/fixtures.http/listDelegationSignerRecords/success.http +1 -2
  131. data/spec/fixtures.http/listDomains/success.http +0 -1
  132. data/spec/fixtures.http/listEmailForwards/success.http +0 -1
  133. data/spec/fixtures.http/listPrimaryServers/success.http +21 -0
  134. data/spec/fixtures.http/listPushes/success.http +0 -1
  135. data/spec/fixtures.http/listServices/success.http +0 -1
  136. data/spec/fixtures.http/listTemplateRecords/success.http +0 -1
  137. data/spec/fixtures.http/listTemplates/success.http +0 -1
  138. data/spec/fixtures.http/listTlds/success.http +1 -2
  139. data/spec/fixtures.http/listWebhooks/success.http +0 -1
  140. data/spec/fixtures.http/listZoneRecords/success.http +0 -1
  141. data/spec/fixtures.http/listZones/success.http +0 -1
  142. data/spec/fixtures.http/method-not-allowed.http +0 -1
  143. data/spec/fixtures.http/notfound-certificate.http +0 -1
  144. data/spec/fixtures.http/notfound-collaborator.http +0 -1
  145. data/spec/fixtures.http/notfound-contact.http +0 -1
  146. data/spec/fixtures.http/notfound-delegationsignerrecord.http +0 -1
  147. data/spec/fixtures.http/notfound-domain.http +0 -1
  148. data/spec/fixtures.http/notfound-domainpush.http +0 -1
  149. data/spec/fixtures.http/notfound-emailforward.http +0 -1
  150. data/spec/fixtures.http/notfound-record.http +0 -1
  151. data/spec/fixtures.http/notfound-template.http +0 -1
  152. data/spec/fixtures.http/notfound-webhook.http +0 -1
  153. data/spec/fixtures.http/notfound-whoisprivacy.http +0 -1
  154. data/spec/fixtures.http/notfound-zone.http +0 -1
  155. data/spec/fixtures.http/oauthAccessToken/error-invalid-request.http +0 -1
  156. data/spec/fixtures.http/oauthAccessToken/success.http +0 -1
  157. data/spec/fixtures.http/pages-1of3.http +0 -1
  158. data/spec/fixtures.http/pages-2of3.http +0 -1
  159. data/spec/fixtures.http/pages-3of3.http +0 -1
  160. data/spec/fixtures.http/purchaseLetsencryptCertificate/success.http +20 -21
  161. data/spec/fixtures.http/purchaseRenewalLetsencryptCertificate/success.http +20 -21
  162. data/spec/fixtures.http/registerDomain/success.http +0 -1
  163. data/spec/fixtures.http/renewDomain/error-tooearly.http +0 -1
  164. data/spec/fixtures.http/renewDomain/success.http +0 -1
  165. data/spec/fixtures.http/renewWhoisPrivacy/success.http +0 -1
  166. data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-duplicated-order.http +0 -1
  167. data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-not-found.http +0 -1
  168. data/spec/fixtures.http/response.http +0 -1
  169. data/spec/fixtures.http/transferDomain/error-indnsimple.http +0 -1
  170. data/spec/fixtures.http/transferDomain/error-missing-authcode.http +0 -1
  171. data/spec/fixtures.http/transferDomain/success.http +0 -1
  172. data/spec/fixtures.http/unlinkPrimaryServer/success.http +21 -0
  173. data/spec/fixtures.http/updateContact/success.http +0 -1
  174. data/spec/fixtures.http/updateTemplate/success.http +0 -1
  175. data/spec/fixtures.http/updateZoneRecord/success.http +0 -1
  176. data/spec/fixtures.http/validation-error.http +0 -1
  177. data/spec/fixtures.http/whoami/success-account.http +0 -1
  178. data/spec/fixtures.http/whoami/success-user.http +0 -1
  179. data/spec/fixtures.http/whoami/success.http +0 -1
  180. data/spec/spec_helper.rb +2 -2
  181. metadata +36 -11
  182. data/.dependabot/config.yml +0 -9
  183. data/.travis.yml +0 -17
  184. data/spec/fixtures.http/resetDomainToken/success.http +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 740c15a07bacc12086f2c0c3282e78150735247a9e85b6be0c84019a9a1a4de3
4
- data.tar.gz: 4caef1a3ce2d61bcb59f882f5195990e64eeef2fe17294afe68ec31922460c23
3
+ metadata.gz: 599aae97228fa50e3a918d98e618849d91aa7aa011afcbd06d7fe61a2fb1e281
4
+ data.tar.gz: f1c811c95ab28badb5438cf56470b15c8794f31c7da241c28982fb08585ae1fe
5
5
  SHA512:
6
- metadata.gz: 365c3a046910052fdc92c0c7a9f014f8dee87766097fcb00a182fe15b87916de86fe9649c9ec491cb9095237ee5e91cdda660142a1dccc72777b3f017ceb1351
7
- data.tar.gz: a55e3f6c772e4667086d4b007c2af15618f8555564fca8a548d3eafcfd5fe8067e06f47057c19b981aeaf55086f32019f7a9055d4b7ae51eb11715e015e3d58c
6
+ metadata.gz: 23e64d29706bac2d104de41666b272d4ec89185be32d3def31d1e4fe6ee776c89e082b0c15ba084338d34b47df950c35159f8d01c6d6cc5191b3fec22129f3c8
7
+ data.tar.gz: eb126f66a71dd8bc5e7eb7cd329645a5f1cefdce5652b91218d5b0108d5e4a77f3000cc9eff2fd0fe24b149ac185dad7ec61560ce1797006e643b98750c5e463
@@ -0,0 +1 @@
1
+ * @dnsimple/client-ruby
@@ -0,0 +1,13 @@
1
+ ---
2
+ version: 2
3
+ updates:
4
+ - package-ecosystem: bundler
5
+ directory: /
6
+ schedule:
7
+ interval: daily
8
+ time: '12:00'
9
+ open-pull-requests-limit: 10
10
+ labels:
11
+ - task
12
+ - dependencies
13
+ - backlog-dependencies
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: ci
3
+
4
+ "on":
5
+ pull_request:
6
+ push:
7
+
8
+ # Allows you to run this workflow manually from the Actions tab
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ markdownlint-cli:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout Code
16
+ uses: actions/checkout@v2
17
+ - name: Run markdownlint-cli
18
+ uses: nosborn/github-action-markdown-cli@v2.0.0
19
+ with:
20
+ files: .
21
+ config_file: ".markdownlint.yaml"
22
+
23
+ yamllint:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - name: Checkout Code
27
+ uses: actions/checkout@v2
28
+ - name: Run YAML Lint
29
+ uses: actionshub/yamllint@main
30
+
31
+ build:
32
+ needs: [markdownlint-cli, yamllint]
33
+ runs-on: ubuntu-latest
34
+ name: Ruby ${{ matrix.ruby-version }}
35
+ strategy:
36
+ matrix:
37
+ ruby-version:
38
+ - '2.6'
39
+ - '2.7'
40
+ - '3.0'
41
+ - 'ruby-head'
42
+ - 'truffleruby-head'
43
+ steps:
44
+ - uses: actions/checkout@v2
45
+ - name: Set up Ruby
46
+ uses: ruby/setup-ruby@v1
47
+ with:
48
+ ruby-version: ${{ matrix.ruby-version }}
49
+ bundler-cache: true
50
+ - run: bundle exec rake
51
+
52
+ slack-workflow-status:
53
+ if: always()
54
+ name: Post Workflow Status To Slack
55
+ needs:
56
+ - build
57
+ runs-on: ubuntu-latest
58
+ steps:
59
+ - name: Slack Workflow Notification
60
+ uses: Gamesight/slack-workflow-status@master
61
+ with:
62
+ repo_token: ${{secrets.GITHUB_TOKEN}}
63
+ slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL_DEVELOPMENT}}
data/.gitignore CHANGED
@@ -7,3 +7,6 @@ Gemfile.lock
7
7
  .yardoc
8
8
  yardoc/
9
9
  doc/
10
+
11
+ #ASDF
12
+ .tool-versions
@@ -0,0 +1,3 @@
1
+ ---
2
+ default: true
3
+ line-length: false
data/.rubocop.yml CHANGED
@@ -1,25 +1,20 @@
1
+ ---
1
2
  inherit_from:
2
3
  - .rubocop_todo.yml
3
4
  - .rubocop_dnsimple.yml
4
5
 
5
- require: rubocop-performance
6
+ require:
7
+ - rubocop-performance
8
+ - rubocop-rake
9
+ - rubocop-rspec
6
10
 
7
11
  AllCops:
12
+ TargetRubyVersion: 3.0
8
13
  Exclude:
9
14
  - '*.gemspec'
10
15
  - 'Rakefile'
16
+ - 'vendor/**/*'
11
17
 
12
- # [codesmell]
13
- # It's irrelevant here, but it could be a code smell.
14
- # Hence keep it disabled, but don't include it in the DNSimple suite.
15
- Lint/Loop:
16
- Enabled: false
17
-
18
- # It doesn't seem to work as expected.
19
- Style/IfUnlessModifier:
20
- Enabled: false
21
-
22
- # This rule suggest to use safe navigation (&.) operator which was introduced
23
- # with Ruby 2.3. Because we are supporting Ruby 2.0+ we can't use this operator.
24
- Style/SafeNavigation:
18
+ # This rule conflicts with our specs codebase using Ruby 2.x and 3.x
19
+ Lint/NonDeterministicRequireOrder:
25
20
  Enabled: false
@@ -1,3 +1,4 @@
1
+ ---
1
2
  # Defaults https://github.com/bbatsov/rubocop/blob/master/config/default.yml
2
3
  #
3
4
  # References:
@@ -8,6 +9,7 @@ AllCops:
8
9
  Exclude:
9
10
  # Exclude .gemspec files because they are generally auto-generated
10
11
  - '*.gemspec'
12
+ NewCops: enable
11
13
 
12
14
  # In most cases, Gems are sorted alphabetically.
13
15
  # However, in some few cases the order is relevant due to dependencies.
@@ -23,8 +25,8 @@ Layout/AccessModifierIndentation:
23
25
  Layout/BlockEndNewline:
24
26
  Enabled: false
25
27
 
26
- # Generally, the keyword style uses a lot of space. This is particularly true when
27
- # you use case/if statements, in combination with a long-name variable.
28
+ # Generally, the keyword style uses a lot of space. This is particularly true
29
+ # when you use case/if statements, in combination with a long-name variable.
28
30
  #
29
31
  # invoice_error_message = case error
30
32
  # when 1 == 1
@@ -146,7 +148,8 @@ Style/EmptyElse:
146
148
  EnforcedStyle: empty
147
149
 
148
150
  # There is no specific preference for empty methods.
149
- # One-line methods are not exceptionally nice in Ruby. Just ignore this cop for now.
151
+ # One-line methods are not exceptionally nice in Ruby.
152
+ # Just ignore this cop for now.
150
153
  Style/EmptyMethod:
151
154
  Enabled: false
152
155
 
@@ -156,8 +159,10 @@ Style/EmptyMethod:
156
159
  Style/FormatString:
157
160
  Enabled: false
158
161
 
159
- # Annotated tokens (like %<foo>s) are a good thing, but in most cases we don't need them.
160
- # %s is a simpler and straightforward version that works in almost all cases. So don't complain.
162
+ # Annotated tokens (like %<foo>s) are a good thing,
163
+ # but in most cases we don't need them.
164
+ # %s is a simpler and straightforward version that works in almost all cases.
165
+ # So don't complain.
161
166
  Style/FormatStringToken:
162
167
  Enabled: false
163
168
 
@@ -169,15 +174,18 @@ Style/HashSyntax:
169
174
  # that looks nicer with the old rocket syntax.
170
175
  - 'Rakefile'
171
176
 
172
- # Enforces usage of Hash#each_key and Hash#each_value (vs. Hash#keys.each and Hash#values.each).
177
+ # Enforces usage of Hash#each_key and Hash#each_value (vs. Hash#keys.each
178
+ # and Hash#values.each).
173
179
  Style/HashEachMethods:
174
180
  Enabled: true
175
181
 
176
- # Enforce the use of Hash#TransformKeys introduced in Ruby 2.5 to transform Hash keys.
182
+ # Enforce the use of Hash#TransformKeys introduced in Ruby 2.5 to transform
183
+ # Hash keys.
177
184
  Style/HashTransformKeys:
178
185
  Enabled: true
179
186
 
180
- # Enforce the use of Hash#TransformValues introduced in Ruby 2.5 to transform Hash values.
187
+ # Enforce the use of Hash#TransformValues introduced in Ruby 2.5 to transform
188
+ # Hash values.
181
189
  Style/HashTransformValues:
182
190
  Enabled: true
183
191
 
@@ -212,8 +220,8 @@ Style/NumericLiterals:
212
220
  - 'spec/**/*_spec.rb'
213
221
  - 'test/**/*_test.rb'
214
222
 
215
- # For years, %w() has been the de-facto standard. A lot of libraries are using ().
216
- # Switching to [] would be a nightmare.
223
+ # For years, %w() has been the de-facto standard.
224
+ # A lot of libraries are using (). Switching to [] would be a nightmare.
217
225
  Style/PercentLiteralDelimiters:
218
226
  Enabled: false
219
227
 
@@ -232,12 +240,13 @@ Style/RedundantReturn:
232
240
  Style/RegexpLiteral:
233
241
  Enabled: false
234
242
 
235
- # There are cases were the inline rescue is ok. We can either downgrade the severity,
236
- # or rely on the developer judgement on a case-by-case basis.
243
+ # There are cases were the inline rescue is ok. We can either downgrade
244
+ # the severity, or rely on the developer judgement on a case-by-case basis.
237
245
  Style/RescueModifier:
238
246
  Enabled: false
239
247
 
240
- # This is quite annoying, especially in cases where we don't control it (e.g. schema.rb).
248
+ # This is quite annoying, especially in cases where we don't control it
249
+ # (e.g. schema.rb).
241
250
  Style/SymbolArray:
242
251
  Enabled: false
243
252
 
@@ -293,8 +302,8 @@ Style/WordArray:
293
302
  Style/YodaCondition:
294
303
  Enabled: false
295
304
 
296
- # For the same reason of EndAlignment, aligning with the case may have a bad impact
297
- # on a case after a very long variable.
305
+ # For the same reason of EndAlignment, aligning with the case may have
306
+ # a bad impact on a case after a very long variable.
298
307
  #
299
308
  # invoice_error_message = case error
300
309
  # when 1 == 1
@@ -316,14 +325,16 @@ Layout/DotPosition:
316
325
  Layout/EmptyLines:
317
326
  Enabled: false
318
327
 
319
- # This is buggy. It detects as a style violation a few `class` and `module` definitions
328
+ # This is buggy. It detects as a style violation a few `class`
329
+ # and `module` definitions
320
330
  Layout/EmptyLinesAroundArguments:
321
331
  Enabled: false
322
332
 
323
333
  Layout/EmptyLinesAroundBlockBody:
324
334
  Exclude:
325
335
  # RSpec is all made of blocks. Disable this config in RSpec
326
- # to be consistent with EmptyLinesAroundClassBody and EmptyLinesAroundModuleBody
336
+ # to be consistent with EmptyLinesAroundClassBody
337
+ # and EmptyLinesAroundModuleBody
327
338
  - 'spec/**/*_spec.rb'
328
339
  - 'test/**/*_test.rb'
329
340
 
@@ -377,41 +388,3 @@ Layout/MultilineOperationIndentation:
377
388
  #
378
389
  Layout/SpaceInsidePercentLiteralDelimiters:
379
390
  Enabled: false
380
-
381
-
382
- # New cops
383
- # We'll remove them once they become defaults.
384
- # See https://docs.rubocop.org/en/latest/versioning/
385
-
386
-
387
- Layout/SpaceAroundMethodCallOperator:
388
- Enabled: true
389
-
390
- Lint/RaiseException:
391
- Enabled: true
392
-
393
- Lint/StructNewOverride:
394
- Enabled: true
395
-
396
- Style/ExponentialNotation:
397
- Enabled: true
398
-
399
- Layout/EmptyLinesAroundAttributeAccessor:
400
- Enabled: true
401
-
402
- Style/SlicingWithRange:
403
- Enabled: true
404
-
405
- # Introduced in rubocop 0.84.0
406
- Lint/DeprecatedOpenSSLConstant:
407
- Enabled: true
408
-
409
- # Introduced in rubocop 0.85.0
410
- Lint/MixedRegexpCaptureTypes:
411
- Enabled: true
412
-
413
- Style/RedundantRegexpCharacterClass:
414
- Enabled: true
415
-
416
- Style/RedundantRegexpEscape:
417
- Enabled: true
data/.rubocop_todo.yml CHANGED
@@ -1,14 +1,54 @@
1
+ ---
1
2
  # This configuration was generated by
2
3
  # `rubocop --auto-gen-config`
3
- # on 2016-03-27 01:01:12 +0100 using RuboCop version 0.38.0.
4
+ # on 2021-10-04 12:28:12 UTC using RuboCop version 1.22.1.
4
5
  # The point is for the user to remove these configuration records
5
6
  # one by one as the offenses are removed from the code base.
6
7
  # Note that changes in the inspected code, or installation of new
7
8
  # versions of RuboCop, may require this file to be generated again.
8
9
 
9
- Style/Documentation:
10
- # Silence this check for now until we fix it.
10
+ # Offense count: 71
11
+ # Configuration parameters: CountAsOne.
12
+ RSpec/ExampleLength:
13
+ Max: 17
14
+
15
+ # Offense count: 1
16
+ RSpec/LeakyConstantDeclaration:
17
+ Exclude:
18
+ - 'spec/dnsimple/client/client_service_spec.rb'
19
+
20
+ # Offense count: 11
21
+ # Configuration parameters: .
22
+ # SupportedStyles: have_received, receive
23
+ RSpec/MessageSpies:
24
+ EnforcedStyle: receive
25
+
26
+ # Offense count: 112
27
+ RSpec/MultipleExpectations:
28
+ Max: 15
29
+
30
+ # Offense count: 375
31
+ # Configuration parameters: IgnoreSharedExamples.
32
+ RSpec/NamedSubject:
11
33
  Enabled: false
34
+
35
+ # Offense count: 16
36
+ RSpec/SubjectStub:
12
37
  Exclude:
13
- - 'spec/**/*'
14
- - 'test/**/*'
38
+ - 'spec/dnsimple/client/certificates_spec.rb'
39
+ - 'spec/dnsimple/client/contacts_spec.rb'
40
+ - 'spec/dnsimple/client/domains_delegation_signer_records_spec.rb'
41
+ - 'spec/dnsimple/client/domains_email_forwards_spec.rb'
42
+ - 'spec/dnsimple/client/domains_spec.rb'
43
+ - 'spec/dnsimple/client/services_spec.rb'
44
+ - 'spec/dnsimple/client/templates_records_spec.rb'
45
+ - 'spec/dnsimple/client/templates_spec.rb'
46
+ - 'spec/dnsimple/client/tlds_spec.rb'
47
+ - 'spec/dnsimple/client/zones_records_spec.rb'
48
+ - 'spec/dnsimple/client/zones_spec.rb'
49
+ - 'spec/dnsimple/client_spec.rb'
50
+
51
+ # Offense count: 37
52
+ # Configuration parameters: AllowedConstants.
53
+ Style/Documentation:
54
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  This project uses [Semantic Versioning 2.0.0](http://semver.org/).
4
4
 
5
+ ## main
6
+
7
+ ## 7.1.0
8
+
9
+ - CHANGED: Updated DNSSEC-related structs and entrypoints to support DS record key-data interface. (dnsimple/dnsimple-ruby#252)
10
+
11
+ ## 7.0.0
12
+
13
+ - CHANGED: Minimum Ruby version is now 2.6
14
+ - CHANGED: Deprecates `registrar.getDomainPremiumPrice` in favour of `registrar.getDomainPrices`
15
+
16
+ ## 6.0.0
17
+
18
+ - NEW: Added `registrar.get_domain_prices` to retrieve whether a domain is premium and the prices to register, transfer, and renew. (dnsimple/dnsimple-ruby#230)
19
+ - REMOVED: `domain.reset_domain_token` endpoint no longer exists and the client method is removed. (dnsimple/dnsimple-ruby#231)
20
+ - REMOVED: The deprecated `Domain.expires_on` is removed. (dnsimple/dnsimple-ruby#232)
21
+ - REMOVED: The deprecated `Certificate.expires_on` is removed. (dnsimple/dnsimple-ruby#232)
22
+
23
+ ## 5.2.0
24
+
25
+ - CHANGED: `Certificate#expires_on` (date only) is deprecated in favor of `Certificate#expires_at` (timestamp). (dnsimple/dnsimple-ruby#190)
26
+
5
27
  ## 5.1.0
6
28
 
7
29
  - CHANGED: `Domain#expires_on` (date only) is deprecated in favor of `Domain#expires_at` (timestamp). (dnsimple/dnsimple-ruby#186)
@@ -18,7 +40,6 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).
18
40
 
19
41
  - NEW: Added WHOIS privacy renewal (GH-171)
20
42
 
21
-
22
43
  ## 4.5.0
23
44
 
24
45
  - NEW: Added zone distribution and zone record distribution (GH-160)
@@ -29,26 +50,22 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).
29
50
 
30
51
  - REMOVED: Removed extra alias (GH-168). You should use `dnsimple.foo.list_foo` instead of `dnsimple.foo.list`. Same for create/update. The change ensures consistency across the various clients. We prefer fully qualified methods.
31
52
 
32
-
33
53
  ## 4.4.0
34
54
 
35
55
  - NEW: Added Let's Encrypt certificate methods (GH-159)
36
56
 
37
57
  - REMOVED: Removed premium_price attribute from registrar order responses (GH-163). Please do not rely on that attribute, as it returned an incorrect value. The attribute is going to be removed, and the API now returns a null value.
38
58
 
39
-
40
59
  ## 4.3.0
41
60
 
42
61
  - NEW: Added `certificates.all_certificates` (dnsimple/dnsimple-ruby#155)
43
62
 
44
63
  - CHANGED: Updated registrar URLs (dnsimple/dnsimple-ruby#153)
45
64
 
46
-
47
65
  ## 4.2.0
48
66
 
49
67
  - NEW: Added DNSSEC support support (dnsimple/dnsimple-ruby#152)
50
68
 
51
-
52
69
  ## 4.1.0
53
70
 
54
71
  - NEW: Added domain premium price support (dnsimple/dnsimple-ruby#143)
@@ -56,7 +73,6 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).
56
73
  - CHANGED: Updated registration, transfer, renewal response payload (dnsimple/dnsimple-developer#111, dnsimple/dnsimple-ruby#140).
57
74
  - CHANGED: Normalize unique string identifiers to SID (dnsimple/dnsimple-ruby#141)
58
75
 
59
-
60
76
  ## 4.0.0
61
77
 
62
78
  - NEW: Added domain collaborators support (GH-137).
@@ -73,7 +89,6 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).
73
89
  - CHANGED: Updated Tld payload (GH-133, GH-129).
74
90
  - CHANGED: Renamed registrar `auth_info` into `auth_code` (GH-136).
75
91
 
76
-
77
92
  ## 3.1.0
78
93
 
79
94
  - NEW: Added accounts support (GH-113).
@@ -87,7 +102,6 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).
87
102
 
88
103
  - REMOVED: Removed support for wildcard accounts (GH-107).
89
104
 
90
-
91
105
  ## 3.0.0
92
106
 
93
107
  ### stable
@@ -130,7 +144,7 @@ Internal changes were made to match conventions adopted in other clients, such a
130
144
 
131
145
  ## 2.0.0
132
146
 
133
- **2.0.0.alpha**
147
+ ### 2.0.0.alpha
134
148
 
135
149
  2.0 is a complete client redesign.
136
150
 
@@ -148,7 +162,7 @@ Internal changes were made to match conventions adopted in other clients, such a
148
162
 
149
163
  - REMOVED: The library no longer provides built-in support for loading the credentials from a config file.
150
164
 
151
- **2.0**
165
+ ### 2.0
152
166
 
153
167
  - FIXED: Fixed a bug where API token environment variables were not properly detected (GH-59, GH-62). Thanks @oguzbilgic and @rupurt.
154
168
 
data/CONTRIBUTING.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Getting started
4
4
 
5
- #### 1. Clone the repository
5
+ ### 1. Clone the repository
6
6
 
7
7
  Clone the repository and move into it:
8
8
 
@@ -11,19 +11,18 @@ git clone git@github.com:dnsimple/dnsimple-ruby.git
11
11
  cd dnsimple-ruby
12
12
  ```
13
13
 
14
- #### 2. Install the dependencies
14
+ ### 2. Install the dependencies
15
15
 
16
16
  Install the dependencies using [Bundler](http://bundler.io/):
17
17
 
18
- ```
18
+ ```shell
19
19
  bundle
20
20
  ```
21
21
 
22
- #### 3. Build and test
22
+ ### 3. Build and test
23
23
 
24
24
  [Run the test suite](#testing) to check everything works as expected.
25
25
 
26
-
27
26
  ## Releasing
28
27
 
29
28
  The following instructions uses `$VERSION` as a placeholder, where `$VERSION` is a `MAJOR.MINOR.BUGFIX` release such as `1.2.0`.
@@ -36,13 +35,13 @@ The following instructions uses `$VERSION` as a placeholder, where `$VERSION` is
36
35
 
37
36
  1. Run the test suite and ensure all the tests pass.
38
37
 
39
- 1. Finalize the `## master` section in `CHANGELOG.md` assigning the version.
38
+ 1. Finalize the `## main` section in `CHANGELOG.md` assigning the version.
40
39
 
41
40
  1. Commit and push the changes
42
41
 
43
42
  ```shell
44
43
  git commit -a -m "Release $VERSION"
45
- git push origin master
44
+ git push origin main
46
45
  ```
47
46
 
48
47
  1. Wait for CI to complete.
@@ -66,18 +65,16 @@ The following instructions uses `$VERSION` as a placeholder, where `$VERSION` is
66
65
  gem push pkg/<filename>
67
66
  ```
68
67
 
69
-
70
68
  ## Testing
71
69
 
72
70
  To run the test suite:
73
71
 
74
- ```
72
+ ```shell
75
73
  rake
76
74
  ```
77
75
 
78
-
79
76
  ## Tests
80
77
 
81
78
  Submit unit tests for your changes. You can test your changes on your machine by [running the test suite](#testing).
82
79
 
83
- When you submit a PR, tests will also be run on the [continuous integration environment via Travis](https://travis-ci.org/dnsimple/dnsimple-ruby).
80
+ When you submit a PR, tests will also be run on the [continuous integration environment via GitHub Actions](https://github.com/dnsimple/dnsimple-ruby/actions).
data/Gemfile CHANGED
@@ -5,5 +5,7 @@ source 'https://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  gem 'coveralls', require: false
8
- gem 'rubocop', '0.85.1', require: false
8
+ gem 'rubocop', '1.22.1', require: false
9
9
  gem 'rubocop-performance', require: false
10
+ gem 'rubocop-rake', require: false
11
+ gem 'rubocop-rspec', require: false
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2010-2020 DNSimple Corporation
3
+ Copyright (c) 2010-2021 DNSimple Corporation
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -2,25 +2,24 @@
2
2
 
3
3
  A Ruby client for the [DNSimple API v2](https://developer.dnsimple.com/v2/).
4
4
 
5
- [![Build Status](https://travis-ci.com/dnsimple/dnsimple-ruby.svg?branch=master)](https://travis-ci.com/dnsimple/dnsimple-ruby)
6
- [![Coverage Status](https://img.shields.io/coveralls/dnsimple/dnsimple-ruby.svg)](https://coveralls.io/r/dnsimple/dnsimple-ruby?branch=master)
5
+ [![Build Status](https://github.com/dnsimple/dnsimple-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/dnsimple/dnsimple-ruby/actions/workflows/ci.yml)
6
+ [![Coverage Status](https://img.shields.io/coveralls/dnsimple/dnsimple-ruby.svg)](https://coveralls.io/r/dnsimple/dnsimple-ruby?branch=main)
7
7
 
8
8
  [DNSimple](https://dnsimple.com/) provides DNS hosting and domain registration that is simple and friendly.
9
9
  We provide a full API and an easy-to-use web interface so you can get your domain registered and set up with a minimal amount of effort.
10
10
 
11
-
12
11
  ## Installation
13
12
 
14
13
  You can install the gem manually:
15
14
 
16
- ```
15
+ ```shell
17
16
  gem install dnsimple
18
17
  ```
19
18
 
20
19
  Or use Bundler and define it as a dependency in your Gemfile:
21
20
 
22
- ```
23
- gem 'dnsimple', '~> 4.0'
21
+ ```ruby
22
+ gem 'dnsimple', '~> 6.0'
24
23
  ```
25
24
 
26
25
  ## Usage
@@ -59,8 +58,7 @@ response = client.domains.domain(account_id, "example.com")
59
58
  puts response.data
60
59
  ```
61
60
 
62
- For the full library documentation visit http://rubydoc.info/gems/dnsimple
63
-
61
+ For the full library documentation visit <http://rubydoc.info/gems/dnsimple>
64
62
 
65
63
  ## Sandbox Environment
66
64
 
@@ -74,7 +72,6 @@ client = Dnsimple::Client.new(base_url: "https://api.sandbox.dnsimple.com", acce
74
72
 
75
73
  You will need to ensure that you are using an access token created in the sandbox environment. Production tokens will *not* work in the sandbox environment.
76
74
 
77
-
78
75
  ## Setting a custom `User-Agent` header
79
76
 
80
77
  You can customize the `User-Agent` header for the calls made to the DNSimple API:
@@ -87,7 +84,6 @@ The value you provide will be prepended to the default `User-Agent` the client u
87
84
 
88
85
  We recommend to customize the user agent. If you are building a library or integration on top of the official client, customizing the client will help us to understand what is this client used for, and allow to contribute back or get in touch.
89
86
 
90
-
91
87
  ## License
92
88
 
93
- Copyright (c) 2010-2020 DNSimple Corporation. This is Free Software distributed under the MIT license.
89
+ Copyright (c) 2010-2021 DNSimple Corporation. This is Free Software distributed under the MIT license.
data/UPGRADING.md CHANGED
@@ -7,8 +7,7 @@ and take advantage of Ruby 1.9.3 and Ruby 2.0.
7
7
 
8
8
  If you are upgrading your code from v1.x, here's the major changes you should be aware of.
9
9
 
10
-
11
- 1. The client is now an instance.
10
+ 1. The client is now an instance.
12
11
 
13
12
  All the API calls are performed within the scope of an instance, rather than a class,
14
13
  making it possible to pass the client around, write thread-safe code and create multiple client instances
@@ -25,7 +24,7 @@ If you are upgrading your code from v1.x, here's the major changes you should be
25
24
  domain = client.domains.domain("example.com")
26
25
  ```
27
26
 
28
- 1. API call responses are now simple struct-like objects, rather Model-like objects.
27
+ 1. API call responses are now simple struct-like objects, rather Model-like objects.
29
28
 
30
29
  ```ruby
31
30
  domain = client.domains.domain("example.com")
@@ -35,7 +34,7 @@ If you are upgrading your code from v1.x, here's the major changes you should be
35
34
  A struct-like object is designed to be a simple container of key/value attributes,
36
35
  as opposite to a fully-features instance you can interact with.
37
36
 
38
- 1. API methods are now defined as methods of the client instance.
37
+ 1. API methods are now defined as methods of the client instance.
39
38
 
40
39
  This is a consequence (or the cause, depending on the POV) of the previous point. It is no longer possible to call
41
40
  persistence methods on an object returned from the API, as it was in v1.
@@ -99,4 +98,4 @@ If you are upgrading your code from v1.x, here's the major changes you should be
99
98
 
100
99
  ```ruby
101
100
  client.domains.update_record("example.com", 12, name: "updated", content: "127.0.0.1")
102
- ```
101
+ ```
data/dnsimple.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.summary = 'The DNSimple API client for Ruby'
12
12
  s.description = 'The DNSimple API client for Ruby.'
13
13
 
14
- s.required_ruby_version = ">= 2.4"
14
+ s.required_ruby_version = ">= 2.6"
15
15
 
16
16
  s.require_paths = ['lib']
17
17
  s.files = `git ls-files`.split("\n")
@@ -98,14 +98,15 @@ module Dnsimple
98
98
  options = args.pop
99
99
  response = nil
100
100
 
101
- begin
101
+ loop do
102
102
  current_page += 1
103
103
  query = Extra.deep_merge(options, query: { page: current_page, per_page: 100 })
104
104
 
105
105
  response = send(method, *(args + [query]))
106
106
  total_pages ||= response.total_pages
107
107
  collection.concat(response.data)
108
- end while current_page < total_pages
108
+ break unless current_page < total_pages
109
+ end
109
110
 
110
111
  CollectionResponse.new(response.http_response, collection)
111
112
  end