dennis-client 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/dennis/record.rb +14 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61c18ed5fd0d210dced5c34b572748dca05080ab8877c8fdbc24f6e512506e7d
|
4
|
+
data.tar.gz: 90c52ebb6894248295fa8bf4ddb18895332187df0a323fcc9ecdabfbe6a5a229
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 558621b5a497fafebde40ee5814970a5d509aab03bc814564ea57f91fd04e077af2307c26e90980ac6abe4f4228f18b08d356dd81770a72e3f33770ae2fbd93e
|
7
|
+
data.tar.gz: 73c1921e023f97853113f049e164b0a980efc4c9747079cdb2aed5fd1e8925ad66347e1d6f977f7af492365b26cf1adc398bd7303522ad4011025066f5d4102c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.2
|
data/lib/dennis/record.rb
CHANGED
@@ -7,6 +7,10 @@ require 'dennis/zone_not_found_error'
|
|
7
7
|
module Dennis
|
8
8
|
class Record
|
9
9
|
|
10
|
+
IRREGULAR_RECORD_TYPE_NAMES = {
|
11
|
+
'HTTPREDIRECT' => 'HTTPRedirect'
|
12
|
+
}.freeze
|
13
|
+
|
10
14
|
class << self
|
11
15
|
|
12
16
|
def all(client, zone, **options)
|
@@ -67,16 +71,24 @@ module Dennis
|
|
67
71
|
type = hash[field_name] if field_name == :type && hash.key?(field_name)
|
68
72
|
end
|
69
73
|
|
74
|
+
type = normalize_type(type)
|
75
|
+
|
70
76
|
if hash.key?(:content)
|
71
77
|
if type.nil?
|
72
78
|
raise Error, 'Cannot generate record properties without a type'
|
73
79
|
end
|
74
80
|
|
75
|
-
arguments[:content] = { type
|
81
|
+
arguments[:content] = { type => hash[:content] }
|
76
82
|
end
|
77
83
|
arguments
|
78
84
|
end
|
79
85
|
|
86
|
+
def normalize_type(type)
|
87
|
+
type = type.to_s.upcase
|
88
|
+
type = IRREGULAR_RECORD_TYPE_NAMES[type] if IRREGULAR_RECORD_TYPE_NAMES.key?(type)
|
89
|
+
type
|
90
|
+
end
|
91
|
+
|
80
92
|
end
|
81
93
|
|
82
94
|
def initialize(client, hash)
|
@@ -152,7 +164,7 @@ module Dennis
|
|
152
164
|
def content
|
153
165
|
return nil if type.nil?
|
154
166
|
|
155
|
-
@hash.dig('content',
|
167
|
+
@hash.dig('content', self.class.normalize_type(type))&.transform_keys(&:to_sym)
|
156
168
|
end
|
157
169
|
|
158
170
|
def update(properties)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dennis-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apia-client
|