record_store 8.0.2 → 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: 6e518dfc9c19dd1015387da818e7771977370cd0d4bf461eda200d378978b29e
4
- data.tar.gz: f056671c6d1f39a9b0a12a0574be13fe4adb152a9dbcf90015a4642bb241e4ea
3
+ metadata.gz: 077fdafcb637ff49252d1e8aba5af4803cc4c458dee23465354ca77df48b9f7f
4
+ data.tar.gz: 4fe82c6141e811289c9cdd7d978e53d68693a3e22a564b846252a585ec25115b
5
5
  SHA512:
6
- metadata.gz: 95ac97176d1adc48e315db207c32aa1e1c394906e0b3026cac517ee43f130fcedd3d62003a08cbcfb387e36844aa5bdb580797588370278829002e0c3b952976
7
- data.tar.gz: d6c9176b3a0a85e7a34076a04a226f9e4311b23ec6c32f569c69d6a460b0f75a3e5bc8f69b6a637781d5f6ca4950270ce0338adba73c742a5f0dda18f558113a
6
+ metadata.gz: 8c82a2c86d3ed27449b231695bd3edfba7b5d9b0c2e21f64c11cf52af89ad76e6c2364eb957022fc7743e90ecd3818c46c409f0332234ea16a41ea7e5c935ca6
7
+ data.tar.gz: 4d144671d258a63f11e8684efe80f2119a9bcc2a4a3786253eba28ba8adf1a648fc0439c2b22ef8d0b508cc52c4453c1300e7a74d4ffce23088e0fdfcb1c6248
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 8.0.4
4
+ - Normalize (compress) addresses in A and AAAA records
5
+
6
+ ## 8.0.3
7
+ - Fix SRV records in Cloudflare
8
+
3
9
  ## 8.0.2
4
10
  - Fix Changesets to be case-insensitive
5
11
 
@@ -132,7 +132,7 @@ module RecordStore
132
132
  when Record::CAA
133
133
  api_body[:data] = record.rdata
134
134
  when Record::SRV
135
- api_body[:data] = rdata
135
+ api_body[:data] = record.rdata
136
136
  when Record::ALIAS
137
137
  api_body[:type] = 'CNAME'
138
138
  api_body[:content] = record.rdata_txt
@@ -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.2'.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.2
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-04 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