globodns_client 0.2.1 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7300f512dc21e6fe0fbffe785909a011052f5f5b
4
- data.tar.gz: 93251bb520a97c317a7094bcc8ca8f8f7ae0e6dd
3
+ metadata.gz: 361174bf425595b2737464a496fb0c3b3627e3f8
4
+ data.tar.gz: 9cd5b9d19b9ee244885e9d845f1e1fbee843d5d3
5
5
  SHA512:
6
- metadata.gz: 017d974ca203a02c4156c1b14c94309f54c482db8fa503084dbf917de7b6a961c1b13e64fa2153d288c47cda017e6babe481ffe3a43a48733e000c4ab06d6e6a
7
- data.tar.gz: 20e968a171d48e194bcc9e9fb77ffc5be5b1269da3311b1382f9e9c2e55d93e11de141c94b4e97682962c8fb4c4c2333dba85a3d99745841b96d382cedd337b6
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}
@@ -1,3 +1,3 @@
1
1
  module GlobodnsClient
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.3"
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.2.1
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-08-22 00:00:00.000000000 Z
11
+ date: 2017-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client