gandi_v5 0.10.0 → 0.10.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -4
- data/lib/gandi_v5/data.rb +10 -12
- data/lib/gandi_v5/domain/transfer_in.rb +1 -1
- data/lib/gandi_v5/domain.rb +4 -6
- data/lib/gandi_v5/email/mailbox.rb +3 -3
- data/lib/gandi_v5/email/slot.rb +1 -1
- data/lib/gandi_v5/live_dns/domain.rb +1 -0
- data/lib/gandi_v5/simple_hosting/instance/virtual_host.rb +1 -1
- data/lib/gandi_v5/version.rb +1 -1
- data/lib/gandi_v5.rb +1 -0
- data/spec/features/list_email_addresses_spec.rb +2 -2
- data/spec/units/gandi_v5/template_spec.rb +4 -4
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1040cd55b98ae6f6d747d769a74e5b2cd92b09b1a8cbe5a4115851d76485f1da
|
4
|
+
data.tar.gz: afd99593144ae4650027b3bfa316bf2a49430954a2cfc846e4782a4123853ca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1124d5fc0cc35cb3e9c41629ba9286b40c0b31a7f47f8dc7e76f7135143770c29b8da8acbecb6869ec1a9c93cd30115287f9f42b0a5e1126ee89b6ef4ff08aa2
|
7
|
+
data.tar.gz: 800b4b45ea100c39929ba4bae9ab0479b5c9d552e1d10a56029df2ff8b023a90d5794b939fb4de9ba0dc2f1b2abd71fe62f661cb5c85346ee5b53acf02d6b8f3
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -7,10 +7,10 @@
|
|
7
7
|
This gem supports the following versions of ruby, it may work on other versions but is not tested against them so don't rely on it.
|
8
8
|
|
9
9
|
* ruby:
|
10
|
-
* 2.6.0 - 2.6.
|
11
|
-
* 2.7.0 - 2.7.
|
12
|
-
* 3.0.0
|
13
|
-
* truffleruby 20.1.0 -
|
10
|
+
* 2.6.0 - 2.6.7
|
11
|
+
* 2.7.0 - 2.7.3
|
12
|
+
* 3.0.0 - 3.0.1
|
13
|
+
* truffleruby 20.1.0 - 21.0.0
|
14
14
|
|
15
15
|
This gem doesn't yet support the following versions of ruby, although hopefully it soon will.
|
16
16
|
|
data/lib/gandi_v5/data.rb
CHANGED
@@ -22,19 +22,17 @@ class GandiV5
|
|
22
22
|
# Get a hash representation of the object.
|
23
23
|
# @return [Hash<Symbol => Object>]
|
24
24
|
def to_h
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
value = value.to_h
|
34
|
-
end
|
35
|
-
[key, value]
|
25
|
+
data_members.map do |key|
|
26
|
+
value = send(key)
|
27
|
+
next [key, value] if value.nil?
|
28
|
+
|
29
|
+
if value.is_a?(Enumerable)
|
30
|
+
value = to_h_transform_enumerable(value)
|
31
|
+
elsif value.respond_to?(:to_h)
|
32
|
+
value = value.to_h
|
36
33
|
end
|
37
|
-
|
34
|
+
[key, value]
|
35
|
+
end.to_h
|
38
36
|
end
|
39
37
|
|
40
38
|
# Get a hash representation of this object suitable for passing back to Gandi.
|
@@ -136,7 +136,7 @@ class GandiV5
|
|
136
136
|
transfer.instance_exec { @duration = data.dig('params', 'duration') }
|
137
137
|
if data.key?('foa')
|
138
138
|
transfer.instance_exec do
|
139
|
-
@foa_status =
|
139
|
+
@foa_status = data['foa'].map { |hash| hash.values_at('email', 'answer') }.to_h
|
140
140
|
end
|
141
141
|
end
|
142
142
|
transfer
|
data/lib/gandi_v5/domain.rb
CHANGED
@@ -84,10 +84,10 @@ class GandiV5
|
|
84
84
|
hash = hash.transform_keys(&:to_sym)
|
85
85
|
.transform_values { |value| GandiV5::Domain::Contact.from_gandi value }
|
86
86
|
|
87
|
-
hash.define_singleton_method(:owner) { send :
|
88
|
-
hash.define_singleton_method(:admin) { send :
|
89
|
-
hash.define_singleton_method(:bill) { send :
|
90
|
-
hash.define_singleton_method(:tech) { send :
|
87
|
+
hash.define_singleton_method(:owner) { send :[], :owner }
|
88
|
+
hash.define_singleton_method(:admin) { send :[], :admin }
|
89
|
+
hash.define_singleton_method(:bill) { send :[], :bill }
|
90
|
+
hash.define_singleton_method(:tech) { send :[], :tech }
|
91
91
|
|
92
92
|
hash
|
93
93
|
}
|
@@ -138,10 +138,8 @@ class GandiV5
|
|
138
138
|
|
139
139
|
alias domain_uuid uuid
|
140
140
|
|
141
|
-
# rubocop:disable Style/AsciiComments
|
142
141
|
# Returns the string representation of the domain.
|
143
142
|
# @return [String] e.g. "example.com", "😀.com (xn--e28h.uk.com)"
|
144
|
-
# rubocop:enable Style/AsciiComments
|
145
143
|
def to_s
|
146
144
|
string = fqdn_unicode
|
147
145
|
string += " (#{fqdn})" unless fqdn == fqdn_unicode
|
@@ -29,9 +29,9 @@ class GandiV5
|
|
29
29
|
|
30
30
|
TYPES = %i[standard premium free].freeze
|
31
31
|
QUOTAS = {
|
32
|
-
free: 3 * 1024**3,
|
33
|
-
standard: 3 * 1024**3,
|
34
|
-
premium: 50 * 1024**3
|
32
|
+
free: 3 * (1024**3),
|
33
|
+
standard: 3 * (1024**3),
|
34
|
+
premium: 50 * (1024**3)
|
35
35
|
}.freeze
|
36
36
|
|
37
37
|
members :address, :login, :quota_used, :aliases, :fallback_email
|
data/lib/gandi_v5/email/slot.rb
CHANGED
@@ -75,6 +75,7 @@ class GandiV5
|
|
75
75
|
# @overload fetch_zone_lines()
|
76
76
|
# Fetch all records for this domain.
|
77
77
|
# @see https://api.gandi.net/docs/livedns/#get-v5-livedns-domains-fqdn-records
|
78
|
+
# @see https://rubygems.org/gems/dns-zonefile dns-zonefile gem may be helpful too
|
78
79
|
# @overload fetch_zone_lines(name)
|
79
80
|
# Fetch records for a name.
|
80
81
|
# @see https://api.gandi.net/docs/livedns/#get-v5-livedns-domains-fqdn-records-rrset_name
|
data/lib/gandi_v5/version.rb
CHANGED
data/lib/gandi_v5.rb
CHANGED
@@ -19,8 +19,8 @@ describe 'Examples', :vcr do
|
|
19
19
|
mailboxes.each do |mailbox|
|
20
20
|
mailbox.refresh
|
21
21
|
emails["#{mailbox.login}@#{domain.fqdn}"] = "#{mailbox.type} mailbox " \
|
22
|
-
|
23
|
-
|
22
|
+
"(#{mailbox.quota_usage.to_i}% " \
|
23
|
+
"of #{(mailbox.quota / (1024**3)).round}GB used)"
|
24
24
|
mailbox.aliases.each do |alias_name|
|
25
25
|
emails["#{alias_name}@#{domain.fqdn}"] = "alias for #{mailbox.login}@#{domain.fqdn}"
|
26
26
|
end
|
@@ -224,10 +224,10 @@ describe GandiV5::Template do
|
|
224
224
|
create = {
|
225
225
|
name: 'template name',
|
226
226
|
description: 'description of template',
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
227
|
+
dns_records: [{ name: 'host', ttl: 600, type: 'TXT', values: ['value'] }],
|
228
|
+
mailboxes: %w[user1 user2],
|
229
|
+
name_servers: ['1.1.1.1', '2.2.2.2'],
|
230
|
+
web_forwardings: [
|
231
231
|
{ type: :http302, target: 'example.com', host: 'here', override: true, protocol: :https_only }
|
232
232
|
]
|
233
233
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gandi_v5
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Gauld
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -477,6 +477,7 @@ metadata:
|
|
477
477
|
documentation_uri: https://rubydoc.info/github/robertgauld/gandi_v5/main
|
478
478
|
homepage_uri: https://github.com/robertgauld/gandi_v5
|
479
479
|
source_code_uri: https://github.com/robertgauld/gandi_v5
|
480
|
+
rubygems_mfa_required: 'true'
|
480
481
|
post_install_message:
|
481
482
|
rdoc_options:
|
482
483
|
- "--title"
|
@@ -499,7 +500,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
499
500
|
- !ruby/object:Gem::Version
|
500
501
|
version: 2.6.14
|
501
502
|
requirements: []
|
502
|
-
rubygems_version: 3.2.
|
503
|
+
rubygems_version: 3.2.22
|
503
504
|
signing_key:
|
504
505
|
specification_version: 4
|
505
506
|
summary: Make use of Gandi's V5 API.
|