globodns_client 0.1.3 → 0.1.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/globodns_client/connection.rb +10 -1
- data/lib/globodns_client/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6938e5d42e2ffa2e0eb7ac0646776194fb31ae3
|
4
|
+
data.tar.gz: ba16c9d3834b12f8765c0612608a9f5d21f37a2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 222255e573e49e9240b6321eea32571534852644645b55f5985f79304319595043e0ef82fdf59661475b9dccdc4668bb51faccb905f1930ae0495e6b622a6ff9
|
7
|
+
data.tar.gz: bbcd1b3ed9d9aa672428006bd699a67644ab0ea2d687b3c28fa29ee52edf5a1200bdeb1444aab7054a21f23fe16f10818d558105ba12a314f7e0ca05d82c2e7c
|
@@ -11,6 +11,15 @@ module GlobodnsClient
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def get_zone(key, kind = 'A')
|
14
|
+
res = request('get','domain', key, nil, kind)
|
15
|
+
if kind.eql?('A') && !res.empty?
|
16
|
+
res
|
17
|
+
else
|
18
|
+
get_zone_recursive(key, kind)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_zone_recursive(key, kind = 'A')
|
14
23
|
if kind.eql?('A')
|
15
24
|
domain = key.split('.', 2).last
|
16
25
|
elsif kind.eql?('PTR')
|
@@ -26,7 +35,7 @@ module GlobodnsClient
|
|
26
35
|
res = request('get','domain', domain, nil, kind)
|
27
36
|
if res.empty?
|
28
37
|
if domain.count('.') > 1 && kind == 'A' || domain.count('.') > 2 && kind == 'PTR'
|
29
|
-
res =
|
38
|
+
res = get_zone_recursive(domain, kind)
|
30
39
|
else
|
31
40
|
raise GlobodnsClient::NotFound, "Couldn't find a proper zone for '#{key}'"
|
32
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: globodns_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernesto Thorp
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.4.
|
125
|
+
rubygems_version: 2.4.8
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Simple client for GloboDNS API.
|