globodns_client 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/globodns_client/connection.rb +4 -4
- 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: 361174bf425595b2737464a496fb0c3b3627e3f8
|
4
|
+
data.tar.gz: 9cd5b9d19b9ee244885e9d845f1e1fbee843d5d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50ce9412b8be6b5ecb1d2e08c6d16f3f6160b5623b250de32b6cc00334be63389ad291cdf99b24ab1ed439801228cfa7e28c90d0a4725fddd0055339c50e994d
|
7
|
+
data.tar.gz: 307eda87d7557f4066af811c5860e2ddb95032f0f8e5dbdf24b9d63753faf19bfac7403d144641dc8d62cb05e4e9cd203bc7544b9c600c85e69568b3d0837a8d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.2.3](https://github.com/globocom/globodns-client-ruby/releases/tag/v0.2.3) (04/09/17)
|
4
|
+
##### - Enhancements
|
5
|
+
* Added TXT records operations (get and create)
|
6
|
+
|
3
7
|
## [0.2.1](https://github.com/globocom/globodns-client-ruby/releases/tag/v0.2.1) (21/08/17)
|
4
8
|
##### - Enhancements
|
5
9
|
* Added CNAME records operations (get and create)
|
@@ -39,7 +39,7 @@ module GlobodnsClient
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def get_zone_recursive(key, kind = 'A')
|
42
|
-
if kind.eql?('A') or kind.eql?('CNAME')
|
42
|
+
if kind.eql?('A') or kind.eql?('CNAME') or kind.eql?('TXT')
|
43
43
|
domain = key.split('.', 2).last
|
44
44
|
elsif kind.eql?('PTR')
|
45
45
|
if key.include?('in-addr.arpa')
|
@@ -53,7 +53,7 @@ module GlobodnsClient
|
|
53
53
|
end
|
54
54
|
res = request('get','domain', domain, nil, kind)
|
55
55
|
if res.empty?
|
56
|
-
if domain.count('.') > 1 && (kind == 'A' or kind == 'CNAME') || domain.count('.') > 2 && kind == 'PTR'
|
56
|
+
if domain.count('.') > 1 && (kind == 'A' or kind == 'CNAME') or kind.eql?('TXT') || domain.count('.') > 2 && kind == 'PTR'
|
57
57
|
res = get_zone_recursive(domain, kind)
|
58
58
|
else
|
59
59
|
raise GlobodnsClient::NotFound, "Couldn't find a proper zone for '#{key}'"
|
@@ -116,7 +116,7 @@ module GlobodnsClient
|
|
116
116
|
private
|
117
117
|
|
118
118
|
def get_host(key, zone, kind)
|
119
|
-
if kind.eql?('A') or kind.eql?('CNAME')
|
119
|
+
if kind.eql?('A') or kind.eql?('CNAME') or kind.eql?('TXT')
|
120
120
|
host = key.split('.'+zone[0][:domain][:name])[0]
|
121
121
|
elsif kind.eql?('PTR')
|
122
122
|
case zone[0][:domain][:name].count('.')
|
@@ -150,7 +150,7 @@ module GlobodnsClient
|
|
150
150
|
|
151
151
|
case method
|
152
152
|
when 'get'
|
153
|
-
if type.eql?('A') or type.eql?('CNAME')
|
153
|
+
if type.eql?('A') or type.eql?('CNAME') or type.eql?('TXT')
|
154
154
|
headers[:params] = {query: value}
|
155
155
|
elsif type.eql?('PTR')
|
156
156
|
headers[:params] = {query: value, reverse: true}
|
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.2.
|
4
|
+
version: 0.2.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: 2017-
|
11
|
+
date: 2017-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|