dns_adapter 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dns_adapter/mock_client.rb +13 -9
- data/lib/dns_adapter/resolv_client.rb +1 -0
- data/lib/dns_adapter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb25bfecdff375e7d6abe98038656a500af985a4
|
4
|
+
data.tar.gz: 67e87217294a27c5710313ec79c08ffb4d8914cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92c01fbc730c1239eb1bcf6a64f5c3185d77b15d9311a7d146c808bc59e95eda13cf04be8ae3a4b770f33427a9583cdbbba845a17907877090f5756ff402b9d0
|
7
|
+
data.tar.gz: e80b36bb31ff0e7d7e694baf630938f678e85fc075b2f7f5daa27c97de21b19a7ae6eecde3147755a56d549364700c5726bcd416a4b17be6505264d7f19821ff
|
@@ -97,21 +97,25 @@ module DNSAdapter
|
|
97
97
|
records.map do |r|
|
98
98
|
val = r[type]
|
99
99
|
raise DNSAdapter::TimeoutError if val == TIMEOUT
|
100
|
-
|
101
|
-
{
|
102
|
-
type: type,
|
103
|
-
RECORD_TYPE_TO_ATTR_NAME_MAP[type] => val
|
104
|
-
}
|
100
|
+
value_to_hash(val, type).merge(type: type)
|
105
101
|
end
|
106
102
|
end
|
107
103
|
|
108
|
-
def
|
104
|
+
def value_to_hash(value, type)
|
109
105
|
if type == 'MX' && value.is_a?(Array)
|
110
|
-
value
|
106
|
+
mx_hash(value)
|
111
107
|
elsif (type == 'TXT' || type == 'SPF') && value.is_a?(Array)
|
112
|
-
value.join('')
|
108
|
+
{ text: value.join('') }
|
113
109
|
else
|
114
|
-
value
|
110
|
+
{ RECORD_TYPE_TO_ATTR_NAME_MAP[type] => value }
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
def mx_hash(value)
|
115
|
+
if value.size > 1
|
116
|
+
{ preference: value.first, exchange: value.last }
|
117
|
+
else
|
118
|
+
{ exchange: value.last }
|
115
119
|
end
|
116
120
|
end
|
117
121
|
end
|
data/lib/dns_adapter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dns_adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter M. Goldstein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|