dennis-client 1.2.1 → 1.2.4
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 +4 -4
- data/lib/dennis/record.rb +14 -2
- data/lib/dennis/version.rb +1 -6
- data/lib/dennis/zone.rb +4 -0
- metadata +5 -6
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b068a02b952fcdbd327f349443ec21db650f80c37617c1f85ac991f2c3aab7cd
|
4
|
+
data.tar.gz: d978e83483f6167f3d8180d099e718201f6ba4253a69e9d5f498c163c4c6f3b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a59a56217e48d0bc0294ce612ab151ab236f63d410c8f0406dcd7a6b89ef9eb1c2a5aebd787a012a1117f040102518d3d6d7ff19692f67156874ae0d7e9aef0
|
7
|
+
data.tar.gz: '0674862da3f92ad3aee62554c3117ef0bd223060411fbb30cfb0d634fc57c783d16553ae81874563b1b9b2fff4e7446dcae2162d03ee177afef9c2bf4a149483'
|
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)
|
data/lib/dennis/version.rb
CHANGED
data/lib/dennis/zone.rb
CHANGED
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apia-client
|
@@ -31,7 +31,6 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
-
- VERSION
|
35
34
|
- lib/dennis-client.rb
|
36
35
|
- lib/dennis.rb
|
37
36
|
- lib/dennis/client.rb
|
@@ -52,7 +51,7 @@ homepage: https://github.com/krystal/dennis-client
|
|
52
51
|
licenses:
|
53
52
|
- MIT
|
54
53
|
metadata: {}
|
55
|
-
post_install_message:
|
54
|
+
post_install_message:
|
56
55
|
rdoc_options: []
|
57
56
|
require_paths:
|
58
57
|
- lib
|
@@ -68,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
67
|
version: '0'
|
69
68
|
requirements: []
|
70
69
|
rubygems_version: 3.5.22
|
71
|
-
signing_key:
|
70
|
+
signing_key:
|
72
71
|
specification_version: 4
|
73
72
|
summary: A client library for talking to the Dennis DNS API.
|
74
73
|
test_files: []
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.2.1
|