loopiator 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5ff599de1f6c262bdebe4a51d85e7707722ce897b5c6f9c716062762db08f23
4
- data.tar.gz: 376eebcb9637f22b5ba8338be5d9d936297eecb1e96ead729698b73f737c3c4a
3
+ metadata.gz: 9a24299e58842ad7880687707f5da0e6441eda72aa9b9cdedbac83170bef5059
4
+ data.tar.gz: 509cdd242830d471eda10438f382e6e36f0828421090f6f1e8a9630bdd1eb8b7
5
5
  SHA512:
6
- metadata.gz: 7dd72a6012c709236e026a89f48b840f274d5a32c9f450d6bdf194be16f5a8672b99a950b9fab30c6ea120a6f8b35fbacb5436845138245fc4eeb8fad3c7fcb4
7
- data.tar.gz: 420aca94a582a1fd8776bba8d83a202423c536d5fbde66471d29abd223ba1525893c35117d19220319f90839672d8c07df7617d17d62f7890e9c2fd53a369e7b
6
+ metadata.gz: c3f7a2a738ece26eb80d77b244f1573b0654805725bcd24ba220e9c82054b41846c9e046553854bc3f6125c273a56397818d28199fcc0306d250421719d9b537
7
+ data.tar.gz: c2907a0db7abb553ffdb5021c0848baf21b1055183dd81ce0a94b08b90988a202ca7b46f1a7609009c7e3c15bb2d65648e755aad1f4a32e932f8963a51d50c95
@@ -12,7 +12,7 @@ require File.join(File.dirname(__FILE__), 'loopiator/credits')
12
12
  require File.join(File.dirname(__FILE__), 'loopiator/client')
13
13
 
14
14
  module Loopiator
15
- VERSION = "0.4.1"
15
+ VERSION = "0.4.2"
16
16
 
17
17
  class << self
18
18
  attr_writer :configuration
@@ -2,23 +2,29 @@ module Loopiator
2
2
  module Dns
3
3
 
4
4
  def get_zone_records(domain, subdomain, customer_number: "")
5
- records = []
6
- response = call("getZoneRecords", customer_number, encode_domain(domain), subdomain)
5
+ records = []
6
+ response = call("getZoneRecords", customer_number, encode_domain(domain), subdomain)
7
7
 
8
- response.each do |item|
9
- records << Loopiator::Models::DnsRecord.new(item)
10
- end if response && response.is_a?(Array)
8
+ if response && response.is_a?(Array) && response.any?
9
+ if response.first.is_a?(String) && response.first.downcase.to_sym.eql?(:rate_limited)
10
+ raise Loopiator::RateLimitError
11
+ else
12
+ response.each do |item|
13
+ records << Loopiator::Models::DnsRecord.new(item)
14
+ end
15
+ end
16
+ end
11
17
 
12
18
  return records
13
19
  end
14
20
 
15
21
  def add_zone_record(domain, subdomain, record_obj, customer_number: "")
16
- response = parse_status_response(call("addZoneRecord", customer_number, encode_domain(domain), subdomain, record_obj))
22
+ response = parse_status_response(call("addZoneRecord", customer_number, encode_domain(domain), subdomain, record_obj))
17
23
  return response.eql?(:ok)
18
24
  end
19
25
 
20
26
  def remove_zone_record(domain, subdomain, record_id, customer_number: "")
21
- response = parse_status_response(call("removeZoneRecord", customer_number, encode_domain(domain), subdomain, record_id))
27
+ response = parse_status_response(call("removeZoneRecord", customer_number, encode_domain(domain), subdomain, record_id))
22
28
  return response.eql?(:ok)
23
29
  end
24
30
 
@@ -57,6 +57,12 @@ module Loopiator
57
57
  return response.eql?(:ok)
58
58
  end
59
59
 
60
+ def remove_subdomain(domain, subdomain, customer_number: "")
61
+ response = parse_status_response(call("removeSubdomain", customer_number, encode_domain(domain), subdomain))
62
+
63
+ return response.eql?(:ok)
64
+ end
65
+
60
66
  def update_nameservers(domain, nameservers = ["ns1.loopia.se", "ns2.loopia.se"], customer_number: "")
61
67
  response = parse_status_response(call("updateDNSServers", customer_number, encode_domain(domain), nameservers))
62
68
 
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'loopiator'
6
- s.version = '0.4.1'
6
+ s.version = '0.4.2'
7
7
 
8
8
  s.homepage = "https://github.com/Agiley/Loopiator"
9
9
  s.email = "sebastian@agiley.se"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loopiator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Johnsson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-10 00:00:00.000000000 Z
11
+ date: 2019-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simpleidn
@@ -101,8 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: 1.3.5
103
103
  requirements: []
104
- rubyforge_project:
105
- rubygems_version: 2.7.4
104
+ rubygems_version: 3.0.3
106
105
  signing_key:
107
106
  specification_version: 2
108
107
  summary: Interface for communicating with Loopia's API