splicer-dns_made_easy 2.2.7 → 2.2.8

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
  SHA1:
3
- metadata.gz: bf6f322a7d147d93167887385e53f1dc3b56d9b9
4
- data.tar.gz: 47c9dcd718199ef4dd9048a582dfcc0550b84ddc
3
+ metadata.gz: 56bf8afdce6164b612bc0df414bc476b78f055af
4
+ data.tar.gz: 17eac9d8d8d2442b7a2d942bb90576c1c916f617
5
5
  SHA512:
6
- metadata.gz: 30e0ff9d7123cc9cb579330ef6706b4efb253d436dfdd560294b128606a0939c6ca3481c64c08c687de1b98a58c1d0dcbf4c6208c663940fd7e35a016d50c086
7
- data.tar.gz: 87fc82d2ee280b183ef4d87d66890a33f5b1a136c7dc7b0c20ef187faf3646256ee7bc91d1268576eaf69e4c46997b68ba0306724e97e8a992d57b05a3269baa
6
+ metadata.gz: 6ac08e2d5a935707378cd0aec0f21954c1199d1c9acd5bc985be67835c1309f6f31895407ec03014b1072a8350617f7931dffd19931edf68ae91d6fc66933d5c
7
+ data.tar.gz: 13c7a7e93fd4f2202283894e6b229d6d46ef642ceecb86cc9e2350167d5d8fc7518bc12fa23eb52adc40510a0de79791f886cedf00f246addf7f9212a78a9783
@@ -93,15 +93,11 @@ module Splicer
93
93
  Splicer.logger.debug "[SPLICER][DNSMADEEASY] method=#{args[:method]} url=#{args[:url]} headers=#{args[:headers]} payload=#{args[:payload]} response=#{response}"
94
94
  response
95
95
  rescue RestClient::Exception => error
96
+ request_params = { method: args[:method], url: args[:url], headers: args[:headers], payload: args[:payload] }
96
97
  if error.response
97
98
  Splicer.logger.debug "[SPLICER][DNSMADEEASY] method=#{args[:method]} url=#{args[:url]} request_headers=#{args[:headers]} payload=#{args[:payload]} response_headers=#{error.response.raw_headers}"
98
99
  raise Splicer::Errors::RequestError.new(error, {
99
- request: {
100
- method: args[:method],
101
- url: args[:url],
102
- headers: args[:headers],
103
- payload: args[:payload]
104
- },
100
+ request: request_params,
105
101
  response: {
106
102
  message: error.response,
107
103
  headers: error.response.raw_headers
@@ -109,14 +105,7 @@ module Splicer
109
105
  })
110
106
  else
111
107
  Splicer.logger.debug "[SPLICER][DNSMADEEASY] method=#{args[:method]} url=#{args[:url]} request_headers=#{args[:headers]} payload=#{args[:payload]}"
112
- raise Splicer::Errors::RequestError.new(error, {
113
- request: {
114
- method: args[:method],
115
- url: args[:url],
116
- headers: args[:headers],
117
- payload: args[:payload]
118
- }
119
- })
108
+ raise Splicer::Errors::RequestError.new(error, { request: request_params })
120
109
  end
121
110
  end
122
111
 
@@ -93,9 +93,6 @@ module Splicer
93
93
  @records << new_record
94
94
  end
95
95
  @records
96
- rescue => error
97
- Splicer.logger.error "[SPLICER][DNSMADEEASY] #fetch_records domain_id=#{domain_id} #{error.message}"
98
- []
99
96
  end
100
97
 
101
98
  # @param [Integer] domain_id
@@ -116,9 +113,6 @@ module Splicer
116
113
  else
117
114
  [Record.new(response['data'])]
118
115
  end
119
- rescue Splicer::Errors::Error => error
120
- Splicer.logger.error "[SPLICER][DNSMADEEASY] #find_records name=#{name} type=#{type} domain_id=#{domain_id} #{error.message}"
121
- []
122
116
  end
123
117
 
124
118
  def create_domain(zone)
@@ -173,7 +167,7 @@ module Splicer
173
167
  response = JSON.parse(client.get("dns/managed/id/#{name}"))
174
168
  Domain.new(response)
175
169
  rescue Splicer::Errors::RequestError => error
176
- Domain.new
170
+ Domain.new({error: error.data})
177
171
  end
178
172
 
179
173
  # Returns a hash for the record data
@@ -183,7 +177,7 @@ module Splicer
183
177
  payload = {
184
178
  type: record.type,
185
179
  gtdLocation: 'DEFAULT',
186
- name: record.name ? record.name : '',
180
+ name: record.name || '',
187
181
  ttl: record.ttl
188
182
  }
189
183
  case record
@@ -1,5 +1,5 @@
1
1
  module Splicer
2
2
  module DnsMadeEasy
3
- VERSION = '2.2.7'
3
+ VERSION = '2.2.8'
4
4
  end
5
5
  end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Splicer::DnsMadeEasy::Client do
4
4
  let(:client) { Splicer::DnsMadeEasy::Client.new('key','secret') }
5
5
  describe '#initialize' do
6
- it "should initialize" do
6
+ it 'should initialize' do
7
7
  expect(client).to be_a(Splicer::DnsMadeEasy::Client)
8
8
  end
9
9
  end
@@ -11,13 +11,13 @@ describe Splicer::DnsMadeEasy::Client do
11
11
  describe '#post' do
12
12
  subject { client.post('resource', { data: 'something' }) }
13
13
 
14
- context 'when Dynect returns with success' do
14
+ context 'when DNS Made Easy returns with success' do
15
15
  before { client.stub(:execute).and_return({}) }
16
16
  it { should eq({})}
17
17
  end
18
18
 
19
- context 'when Dynect returns with an error' do
20
- before { client.stub(:execute).and_raise(Splicer::Errors::RequestError) }
19
+ context 'when DNS Made Easy returns with an error' do
20
+ before { client.stub(:execute).and_raise(Splicer::Errors::RequestError.new('error')) }
21
21
  it 'should raise a Splicer::Errors::RequestError' do
22
22
  expect { subject }.to raise_error(Splicer::Errors::RequestError)
23
23
  end
@@ -27,13 +27,13 @@ describe Splicer::DnsMadeEasy::Client do
27
27
  describe '#get' do
28
28
  subject { client.get('resource') }
29
29
 
30
- context 'when Dynect returns with success' do
30
+ context 'when DNS Made Easy returns with success' do
31
31
  before { client.stub(:execute).and_return({}) }
32
32
  it { should eq({})}
33
33
  end
34
34
 
35
- context 'when Dynect returns with an error' do
36
- before { client.stub(:execute).and_raise(Splicer::Errors::RequestError) }
35
+ context 'when DNS Made Easy returns with an error' do
36
+ before { client.stub(:execute).and_raise(Splicer::Errors::RequestError.new('error')) }
37
37
  it 'should raise a Splicer::Errors::RequestError' do
38
38
  expect { subject }.to raise_error(Splicer::Errors::RequestError)
39
39
  end
@@ -43,13 +43,13 @@ describe Splicer::DnsMadeEasy::Client do
43
43
  describe '#put' do
44
44
  subject { client.put('resource', { data: 'something' }) }
45
45
 
46
- context 'when Dynect returns with success' do
46
+ context 'when DNS Made Easy returns with success' do
47
47
  before { client.stub(:execute).and_return({}) }
48
48
  it { should eq({})}
49
49
  end
50
50
 
51
- context 'when Dynect returns with an error' do
52
- before { client.stub(:execute).and_raise(Splicer::Errors::RequestError) }
51
+ context 'when DNS Made Easy returns with an error' do
52
+ before { client.stub(:execute).and_raise(Splicer::Errors::RequestError.new('error')) }
53
53
  it 'should raise a Splicer::Errors::RequestError' do
54
54
  expect { subject }.to raise_error(Splicer::Errors::RequestError)
55
55
  end
@@ -59,13 +59,13 @@ describe Splicer::DnsMadeEasy::Client do
59
59
  describe '#delete' do
60
60
  subject { client.delete('resource') }
61
61
 
62
- context 'when Dynect returns with success' do
62
+ context 'when DNS Made Easy returns with success' do
63
63
  before { client.stub(:execute).and_return({}) }
64
64
  it { should eq({})}
65
65
  end
66
66
 
67
- context 'when Dynect returns with an error' do
68
- before { client.stub(:execute).and_raise(Splicer::Errors::RequestError) }
67
+ context 'when DNS Made Easy returns with an error' do
68
+ before { client.stub(:execute).and_raise(Splicer::Errors::RequestError.new('error')) }
69
69
  it 'should raise a Splicer::Errors::RequestError' do
70
70
  expect { subject }.to raise_error(Splicer::Errors::RequestError)
71
71
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splicer-dns_made_easy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.7
4
+ version: 2.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Johnston
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-04-19 00:00:00.000000000 Z
13
+ date: 2016-09-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: splicer