gandi_v5 0.4.0 → 0.5.0
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/.travis.yml +1 -0
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/gandi_v5.rb +2 -0
- data/lib/gandi_v5/data/converter/integer.rb +26 -0
- data/lib/gandi_v5/live_dns/record_set.rb +1 -1
- data/lib/gandi_v5/version.rb +1 -1
- data/spec/features/livedns_zone_spec.rb +12 -13
- data/spec/units/gandi_v5/data/converter/integer_spec.rb +16 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eac7a49d78a12be6f28ce2a12aab37a8fcbe25e24ffd40f215a7bf088df81125
|
4
|
+
data.tar.gz: bb0e28904dc4869a6846c6cd4204b7c9c9e97937f9a1d7ef9dcbf1ceef7b7ea2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fa831c1c527c6b06f97627d36ba3085586f5675690ff120a075f9a88a24bde2493d83c4b7b04803e00295459af2a49f92e049f0172af288634c04d32d4c1f6c
|
7
|
+
data.tar.gz: 7116bae0e14637e37ff361e530d711a3d2d68177554df107963a020049746b955cc9cfbb61e9dca5ad354ced47b5d88d4c3047ec2a3b7f9d4bf8005426b1ebdc
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -10,8 +10,8 @@ This gem supports the following versions of ruby, it may work on other versions
|
|
10
10
|
* ruby:
|
11
11
|
* 2.6.0 - 2.6.6
|
12
12
|
* 2.7.0 - 2.7.1
|
13
|
+
* truffleruby 20.1.0
|
13
14
|
* jruby, once it's reached parity with ruby 2.6.x
|
14
|
-
* truffleruby, once it's reached parity with ruby 2.6.x
|
15
15
|
* rubinius, once it's reached parity with ruby 2.6.x
|
16
16
|
|
17
17
|
|
data/lib/gandi_v5.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class GandiV5
|
4
|
+
module Data
|
5
|
+
class Converter
|
6
|
+
# Methods for converting strings to/from integerss.
|
7
|
+
class Integer
|
8
|
+
# @param value [Integer]
|
9
|
+
# @return [String]
|
10
|
+
def self.to_gandi(value)
|
11
|
+
return nil if value.nil?
|
12
|
+
|
13
|
+
value.to_s
|
14
|
+
end
|
15
|
+
|
16
|
+
# @param [String]
|
17
|
+
# @return value [Integer]
|
18
|
+
def self.from_gandi(value)
|
19
|
+
return nil if value.nil?
|
20
|
+
|
21
|
+
value.to_i
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -15,7 +15,7 @@ class GandiV5
|
|
15
15
|
include GandiV5::Data
|
16
16
|
|
17
17
|
member :type, gandi_key: 'rrset_type'
|
18
|
-
member :ttl, gandi_key: 'rrset_ttl'
|
18
|
+
member :ttl, gandi_key: 'rrset_ttl', converter: GandiV5::Data::Converter::Integer
|
19
19
|
member :name, gandi_key: 'rrset_name'
|
20
20
|
member :values, gandi_key: 'rrset_values'
|
21
21
|
|
data/lib/gandi_v5/version.rb
CHANGED
@@ -25,21 +25,20 @@ describe 'LiveDNS Zone features' do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'Make and save snapshot', :vcr do
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
expect(File).to receive(:write).with('/path/to/file', yaml)
|
28
|
+
hash = {
|
29
|
+
uuid: 'snapshot-uuid',
|
30
|
+
zone_uuid: 'zone-uuid',
|
31
|
+
created_at: Time.new(2016, 12, 16, 16, 51, 26),
|
32
|
+
records: [
|
33
|
+
type: 'A',
|
34
|
+
ttl: 10_800,
|
35
|
+
name: 'www',
|
36
|
+
values: ['10.0.1.42']
|
37
|
+
]
|
38
|
+
}
|
40
39
|
|
41
40
|
zone = GandiV5::LiveDNS::Zone.new uuid: 'zone-uuid'
|
42
41
|
snapshot = zone.take_snapshot
|
43
|
-
|
42
|
+
expect(snapshot.to_h).to eq hash
|
44
43
|
end
|
45
44
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe GandiV5::Data::Converter::Integer do
|
4
|
+
it '.from_gandi' do
|
5
|
+
expect(described_class.from_gandi('123')).to eq 123
|
6
|
+
end
|
7
|
+
|
8
|
+
it '.to_gandi' do
|
9
|
+
expect(described_class.to_gandi(123)).to eq '123'
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'nil value' do
|
13
|
+
expect(described_class.from_gandi(nil)).to be nil
|
14
|
+
expect(described_class.to_gandi(nil)).to be nil
|
15
|
+
end
|
16
|
+
end
|
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Gauld
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -308,6 +308,7 @@ files:
|
|
308
308
|
- lib/gandi_v5/data.rb
|
309
309
|
- lib/gandi_v5/data/converter.rb
|
310
310
|
- lib/gandi_v5/data/converter/array_of.rb
|
311
|
+
- lib/gandi_v5/data/converter/integer.rb
|
311
312
|
- lib/gandi_v5/data/converter/symbol.rb
|
312
313
|
- lib/gandi_v5/data/converter/time.rb
|
313
314
|
- lib/gandi_v5/domain.rb
|
@@ -386,6 +387,7 @@ files:
|
|
386
387
|
- spec/units/gandi_v5/billing/info_spec.rb
|
387
388
|
- spec/units/gandi_v5/billing_spec.rb
|
388
389
|
- spec/units/gandi_v5/data/converter/array_of_spec.rb
|
390
|
+
- spec/units/gandi_v5/data/converter/integer_spec.rb
|
389
391
|
- spec/units/gandi_v5/data/converter/symbol_spec.rb
|
390
392
|
- spec/units/gandi_v5/data/converter/time_spec.rb
|
391
393
|
- spec/units/gandi_v5/data/converter_spec.rb
|