globodns_client 0.1.2 → 0.1.3
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 +14 -10
- data/lib/globodns_client/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: e35e941e02ee142eda1040a567eac897b800b0eb
|
4
|
+
data.tar.gz: 4f702623973663c2324ae50259d134238a357c61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9505892c9313960d16a64b84801dc291d3e04a999a88fbbca57475aa847079c0e5771c195abc871c8df500cdc6a8acb601a58e4e2ac14cb697ea4881f3abd65f
|
7
|
+
data.tar.gz: 257a5a7ccbd8f5c62e1b0d1a71aa7bd87296c7f87b4ecde31156d131291ed659e6294e9f2de79e5c282606c713fcd7c29da581c9754ad5058de079fe7f3784d3
|
@@ -31,17 +31,21 @@ module GlobodnsClient
|
|
31
31
|
raise GlobodnsClient::NotFound, "Couldn't find a proper zone for '#{key}'"
|
32
32
|
end
|
33
33
|
end
|
34
|
-
res
|
34
|
+
res
|
35
35
|
end
|
36
36
|
|
37
|
-
def get_record(key, kind,
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
def get_record(key, kind, zones=[] )
|
38
|
+
zones.flatten!
|
39
|
+
res = []
|
40
|
+
zones = get_zone(key, kind) if zones.nil?
|
41
|
+
zones.each do |zone|
|
42
|
+
host = get_host(key, zone, kind)
|
43
|
+
response = request('get', 'record', host, zone['domain']['id'], kind)
|
44
|
+
response.each do |r|
|
45
|
+
res << r[kind.downcase] unless r[kind.downcase].nil?
|
46
|
+
end
|
43
47
|
end
|
44
|
-
false
|
48
|
+
res.empty? ? false : res
|
45
49
|
end
|
46
50
|
|
47
51
|
def new_record(key, kind, value)
|
@@ -76,9 +80,9 @@ module GlobodnsClient
|
|
76
80
|
|
77
81
|
def get_host(key, zone, kind)
|
78
82
|
if kind.eql?('A')
|
79
|
-
host = key.split('.'+zone['name'])[0]
|
83
|
+
host = key.split('.'+zone['domain']['name'])[0]
|
80
84
|
elsif kind.eql?('PTR')
|
81
|
-
case zone['name'].count('.')
|
85
|
+
case zone['domain']['name'].count('.')
|
82
86
|
when 4, 5
|
83
87
|
host = key.split('.').last
|
84
88
|
when 3
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernesto Thorp
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|