record_store 5.2.2 → 5.3.0

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
- SHA1:
3
- metadata.gz: d39d4eef870b4fb7d6634f320f94c1eafdc744e9
4
- data.tar.gz: dd9eba4966da027f358a0f82b0b515a916188774
2
+ SHA256:
3
+ metadata.gz: 44a86871965b0fa3db8951d4d9f9bdd0fbb2c1c64744508107b96eeb21499101
4
+ data.tar.gz: b6e329067a74eb41d277409f5531ff21b49cdcb824c9d5e326257e1adcf17585
5
5
  SHA512:
6
- metadata.gz: b5e25983fc1d7cafa44207f6c8e0ec38969eeda47da61b876bb60e783c19627f06e3468ed2f948553331523e5b8f3fa1bd2c355023dbfae1fa3dafba579eaf26
7
- data.tar.gz: 406d44994a2b93a02ec891f35ee1a86f95e56b5e88d325185016a4f0cecedf5a151e930b13ba1e8a6ed3f23fb4a306115defa85770e18d91df5548a6286714ac
6
+ metadata.gz: 57a79a8f04b021985cb19b44393f840e1d3febb4d774136e1ca0ad062cb3a2a6e4255cd13b6929a345a337c85cb36f9461a7c3cae9ec78d905d3c449ae5c15e5
7
+ data.tar.gz: 5bd60003b6d11fda8a52a7641a23b7fd3c64a6ae365b3a6d7a650e0dc1f7fd573f8cf0b4e9c4926b2b1763242d3da02a1dbaf184e26d506328fe84509a447d3b
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 5.3.0
4
+ - case insensitivity for fqns (force to lowercsase) [FEATURE]
5
+
3
6
  ## 5.2.2
4
7
  - support regex based ignore patterns [FEATURE]
5
8
 
@@ -64,11 +64,14 @@ module RecordStore
64
64
  end
65
65
 
66
66
  def build_from_api(api_record, zone)
67
+ fqdn = api_record.name.present? ? "#{api_record.name}.#{zone}" : zone
68
+ fqdn = "#{fqdn}." unless fqdn.ends_with?('.')
69
+
67
70
  record_type = api_record.type
68
71
  record = {
69
72
  record_id: api_record.id,
70
73
  ttl: api_record.ttl,
71
- fqdn: api_record.name.present? ? "#{api_record.name}.#{zone}" : zone,
74
+ fqdn: fqdn.downcase,
72
75
  }
73
76
 
74
77
  return if record_type == 'SOA'
@@ -97,10 +100,6 @@ module RecordStore
97
100
  )
98
101
  end
99
102
 
100
- unless record.fetch(:fqdn).ends_with?('.')
101
- record[:fqdn] += '.'
102
- end
103
-
104
103
  Record.const_get(record_type).new(record)
105
104
  end
106
105
 
@@ -105,7 +105,8 @@ module RecordStore
105
105
  record[:txtdata] = Record::TXT.unescape(record[:txtdata]) if %w[SPF TXT].include?(type)
106
106
 
107
107
  fqdn = record.fetch(:fqdn)
108
- record[:fqdn] = "#{fqdn}." unless fqdn.ends_with?('.')
108
+ fqdn = "#{fqdn}." unless fqdn.ends_with?('.')
109
+ record[:fqdn] = fqdn.downcase
109
110
 
110
111
  Record.const_get(type).new(record)
111
112
  end
@@ -79,10 +79,13 @@ module RecordStore
79
79
  end
80
80
 
81
81
  def build_from_api(record)
82
+ fqdn = record.name.downcase
83
+ fqdn = "#{fqdn}." unless fqdn.ends_with?('.')
84
+
82
85
  record_params = {
83
86
  id: record.object_id,
84
87
  ttl: record.ttl,
85
- fqdn: record.name,
88
+ fqdn: fqdn,
86
89
  }
87
90
 
88
91
  return if record.type == 'SOA'
@@ -111,10 +114,6 @@ module RecordStore
111
114
  )
112
115
  end
113
116
 
114
- unless record_params.fetch(:fqdn).ends_with?('.')
115
- record_params[:fqdn] += '.'
116
- end
117
-
118
117
  Record.const_get(record.type).new(record_params)
119
118
  end
120
119
  end
@@ -12,7 +12,7 @@ module RecordStore
12
12
  validate :validate_label_length
13
13
 
14
14
  def initialize(record)
15
- @fqdn = Record.ensure_ends_with_dot(record.fetch(:fqdn))
15
+ @fqdn = Record.ensure_ends_with_dot(record.fetch(:fqdn)).downcase
16
16
  @ttl = record.fetch(:ttl)
17
17
  @id = record.fetch(:record_id, nil)
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module RecordStore
2
- VERSION = '5.2.2'.freeze
2
+ VERSION = '5.3.0'.freeze
3
3
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.required_ruby_version = '>= 2.0'
21
21
 
22
- spec.add_runtime_dependency 'thor'
22
+ spec.add_runtime_dependency 'thor', '~> 0.20.3'
23
23
  spec.add_runtime_dependency 'activesupport', '>= 4.2'
24
24
  spec.add_runtime_dependency 'activemodel', '>= 4.2'
25
25
  spec.add_runtime_dependency 'ejson'
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: 5.2.2
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Bergen
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-23 00:00:00.000000000 Z
12
+ date: 2019-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: 0.20.3
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
27
+ version: 0.20.3
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activesupport
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -332,7 +332,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
332
332
  version: '0'
333
333
  requirements: []
334
334
  rubyforge_project:
335
- rubygems_version: 2.6.14
335
+ rubygems_version: 2.7.6
336
336
  signing_key:
337
337
  specification_version: 4
338
338
  summary: Manage DNS using git