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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e35e941e02ee142eda1040a567eac897b800b0eb
4
- data.tar.gz: 4f702623973663c2324ae50259d134238a357c61
3
+ metadata.gz: a6938e5d42e2ffa2e0eb7ac0646776194fb31ae3
4
+ data.tar.gz: ba16c9d3834b12f8765c0612608a9f5d21f37a2f
5
5
  SHA512:
6
- metadata.gz: 9505892c9313960d16a64b84801dc291d3e04a999a88fbbca57475aa847079c0e5771c195abc871c8df500cdc6a8acb601a58e4e2ac14cb697ea4881f3abd65f
7
- data.tar.gz: 257a5a7ccbd8f5c62e1b0d1a71aa7bd87296c7f87b4ecde31156d131291ed659e6294e9f2de79e5c282606c713fcd7c29da581c9754ad5058de079fe7f3784d3
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 = get_zone(domain, kind)
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
@@ -1,3 +1,3 @@
1
1
  module GlobodnsClient
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  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.3
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: 2015-11-11 00:00:00.000000000 Z
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.6
125
+ rubygems_version: 2.4.8
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Simple client for GloboDNS API.