record_store 8.0.3 → 8.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e8b87ae901142fc4396da4b2e67b9f7b5f7ff70c9bdc2046dbbb4967feeee76
4
- data.tar.gz: 9572767d6cfc0b0e5ed3ad9d962fe7e9b37fe057c50d734ed7cc73d74a29b18a
3
+ metadata.gz: 077fdafcb637ff49252d1e8aba5af4803cc4c458dee23465354ca77df48b9f7f
4
+ data.tar.gz: 4fe82c6141e811289c9cdd7d978e53d68693a3e22a564b846252a585ec25115b
5
5
  SHA512:
6
- metadata.gz: 236d61311fa1639e0223e9553b8616da334333d01b328c54e549d543eed2b0abfaeb32b568416e29736c57fcf4a6ad277eec2b7783e3456d0f206749c35a724e
7
- data.tar.gz: 624c5bb6dbeebc0cea107cdf4e87d20e228e690f54aacad5a4a3ab31538a5c5e6aa9adb522c63812ac3c6d49c6e52cb44e49adc2470049e87812f6593e894f25
6
+ metadata.gz: 8c82a2c86d3ed27449b231695bd3edfba7b5d9b0c2e21f64c11cf52af89ad76e6c2364eb957022fc7743e90ecd3818c46c409f0332234ea16a41ea7e5c935ca6
7
+ data.tar.gz: 4d144671d258a63f11e8684efe80f2119a9bcc2a4a3786253eba28ba8adf1a648fc0439c2b22ef8d0b508cc52c4453c1300e7a74d4ffce23088e0fdfcb1c6248
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 8.0.4
4
+ - Normalize (compress) addresses in A and AAAA records
5
+
3
6
  ## 8.0.3
4
7
  - Fix SRV records in Cloudflare
5
8
 
@@ -1,13 +1,17 @@
1
1
  module RecordStore
2
2
  class Record::A < Record
3
- attr_accessor :address
3
+ attr_reader :address
4
4
 
5
5
  validates_presence_of :address
6
6
  validate :valid_address?
7
7
 
8
8
  def initialize(record)
9
9
  super
10
- @address = record.fetch(:address)
10
+ self.address = record.fetch(:address)
11
+ end
12
+
13
+ def address=(value)
14
+ @address = normalize_address(value)
11
15
  end
12
16
 
13
17
  def rdata
@@ -26,5 +30,11 @@ module RecordStore
26
30
  rescue IPAddr::InvalidAddressError
27
31
  errors.add(:address, 'is invalid')
28
32
  end
33
+
34
+ def normalize_address(value)
35
+ IPAddr.new(value).to_s
36
+ rescue IPAddr::InvalidAddressError
37
+ value
38
+ end
29
39
  end
30
40
  end
@@ -1,13 +1,17 @@
1
1
  module RecordStore
2
2
  class Record::AAAA < Record
3
- attr_accessor :address
3
+ attr_reader :address
4
4
 
5
5
  validates_presence_of :address
6
6
  validate :valid_address?
7
7
 
8
8
  def initialize(record)
9
9
  super
10
- @address = record.fetch(:address)
10
+ self.address = record.fetch(:address)
11
+ end
12
+
13
+ def address=(value)
14
+ @address = normalize_address(value)
11
15
  end
12
16
 
13
17
  def rdata
@@ -26,5 +30,11 @@ module RecordStore
26
30
  rescue IPAddr::InvalidAddressError
27
31
  errors.add(:address, 'is invalid')
28
32
  end
33
+
34
+ def normalize_address(value)
35
+ IPAddr.new(value).to_s
36
+ rescue IPAddr::InvalidAddressError
37
+ value
38
+ end
29
39
  end
30
40
  end
@@ -1,3 +1,3 @@
1
1
  module RecordStore
2
- VERSION = '8.0.3'.freeze
2
+ VERSION = '8.0.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: record_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.3
4
+ version: 8.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Bergen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-11-05 00:00:00.000000000 Z
12
+ date: 2024-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -455,7 +455,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
455
455
  - !ruby/object:Gem::Version
456
456
  version: '0'
457
457
  requirements: []
458
- rubygems_version: 3.5.22
458
+ rubygems_version: 3.5.23
459
459
  signing_key:
460
460
  specification_version: 4
461
461
  summary: Manage DNS using git