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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02621cbb8405cbec872ddcf3d549770535377dc1e6b158e9488f6bddcf65a771
4
- data.tar.gz: 73901bcd9e8cb66d5c56c1802915dc849bd66d17d8c013a2895f472ef93f9543
3
+ metadata.gz: eac7a49d78a12be6f28ce2a12aab37a8fcbe25e24ffd40f215a7bf088df81125
4
+ data.tar.gz: bb0e28904dc4869a6846c6cd4204b7c9c9e97937f9a1d7ef9dcbf1ceef7b7ea2
5
5
  SHA512:
6
- metadata.gz: e3caf30dc92addf609acb1e5e7f69841a5f896579f55c839813790200170222ede6df0e2c6448af2b3fa5848de5acb1a1cd50dbd1a19d538afc5c24e2d84e217
7
- data.tar.gz: e1efdd6ed8ab463d7379b8040aeff61c62be58485464ed09e00bba3d28a4af9e27ac74f9333a74500f98e094b48832ed00439c01909fd9a1e5fb1a9677a7da76
6
+ metadata.gz: 3fa831c1c527c6b06f97627d36ba3085586f5675690ff120a075f9a88a24bde2493d83c4b7b04803e00295459af2a49f92e049f0172af288634c04d32d4c1f6c
7
+ data.tar.gz: 7116bae0e14637e37ff361e530d711a3d2d68177554df107963a020049746b955cc9cfbb61e9dca5ad354ced47b5d88d4c3047ec2a3b7f9d4bf8005426b1ebdc
@@ -9,6 +9,7 @@ rvm:
9
9
  - 2.6.6
10
10
  - 2.7.0
11
11
  - 2.7.1
12
+ - truffleruby-20.1.0
12
13
  gemfile:
13
14
  - Gemfile
14
15
  branches:
@@ -1,5 +1,10 @@
1
1
  # Gandi V5 API Gem Changelog
2
2
 
3
+ ## Version 0.5.0
4
+
5
+ * Add support for truffleruby 20.1.0
6
+ * Fix issue with rails in production
7
+
3
8
  ## Version 0.4.0
4
9
 
5
10
  * Fix exception when delete returns no content-type
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
 
@@ -17,6 +17,8 @@ class MyInflector < Zeitwerk::Inflector
17
17
  'LiveDNS'
18
18
  when 'tld'
19
19
  'TLD'
20
+ when 'version'
21
+ 'VERSION'
20
22
  else
21
23
  super
22
24
  end
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GandiV5
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  end
@@ -25,21 +25,20 @@ describe 'LiveDNS Zone features' do
25
25
  end
26
26
 
27
27
  it 'Make and save snapshot', :vcr do
28
- yaml = "--- !ruby/object:GandiV5::LiveDNS::Zone::Snapshot\n" \
29
- "uuid: snapshot-uuid\n" \
30
- "zone_uuid: zone-uuid\n" \
31
- "created_at: 2016-12-16 16:51:26.000000000 Z\n" \
32
- "records:\n" \
33
- "- !ruby/object:GandiV5::LiveDNS::RecordSet\n" \
34
- " type: A\n" \
35
- " ttl: 10800\n" \
36
- " name: www\n" \
37
- " values:\n" \
38
- " - 10.0.1.42\n"
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
- File.write '/path/to/file', snapshot.to_yaml
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.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-05-17 00:00:00.000000000 Z
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