gibbon 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gibbon might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cadad0262542fdc59cf9296a13273855c6060de0
4
- data.tar.gz: 58cd1444c3e4cf456fa06386adbc3a4135ce9b46
3
+ metadata.gz: 6ee0feabc44b4f9a9f8ba62fbb303baf69412ce0
4
+ data.tar.gz: 94ccc2373e6991acba4a32418bbe2a63ae852763
5
5
  SHA512:
6
- metadata.gz: f147ecf3ab960b613cd4f8623cc1ae06d40d1835f7d72af08bf6624dc1417a178671d69010eb3c5ed9fb8697e3d6b0426ba531ae31cdf4a812d527909cbb3678
7
- data.tar.gz: 057fae67da3e668dcee8f38d3b2a2aa099523458dab1a04725e57a730674633603a596857776026201c929ba956f55939bef40b61f7ad4597c87e5aba24e255c
6
+ metadata.gz: 59cbe8d55f63cfd982cf1c5f59d770946177c2b567f123ce32f3527f88d05c4c0d1c1b55167f0cb48ebc9510293b0a4fa2a9100a62cdac26e00d61a66469d4b6
7
+ data.tar.gz: 64c09481ecde6b9fc53bc91f666f681af60d316591dee398f8c60785d4f117bbf8edd210231cfc1f662f02377af83ee879883bbdf50ec7a28cf31e0ad11e4c82
@@ -1,6 +1,8 @@
1
1
  language: ruby
2
2
  sudo: false
3
3
  cache: bundler
4
+ before_install:
5
+ - gem install bundler # -v 1.7.14 if a specific version is needed
4
6
  rvm:
5
7
  - 2.0.0
6
8
  - 2.1.5
@@ -1,5 +1,8 @@
1
1
  ## [Unreleased][unreleased]
2
2
 
3
+ ## [3.1.1] - 2017-09-25
4
+ - Fix MailChimpError initialization
5
+
3
6
  ## [3.1.0] - 2017-07-27
4
7
  - Add back support for Export API until MailChimp stops supporting it
5
8
  - Implement `responds_to_missing`
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2015 Amro Mousa
1
+ Copyright (c) 2010-2017 Amro Mousa
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -102,7 +102,7 @@ module Gibbon
102
102
  def symbolize_keys
103
103
  @request_builder.symbolize_keys
104
104
  end
105
-
105
+
106
106
  # Helpers
107
107
 
108
108
  def handle_error(error)
@@ -157,7 +157,7 @@ module Gibbon
157
157
  client
158
158
  end
159
159
 
160
- def parse_response(response)
160
+ def parse_response(response)
161
161
  parsed_response = nil
162
162
 
163
163
  if response.body && !response.body.empty?
@@ -166,9 +166,8 @@ module Gibbon
166
166
  body = MultiJson.load(response.body, symbolize_keys: symbolize_keys)
167
167
  parsed_response = Response.new(headers: headers, body: body)
168
168
  rescue MultiJson::ParseError
169
- error = MailChimpError.new("Unparseable response: #{response.body}")
170
- error.title = "UNPARSEABLE_RESPONSE"
171
- error.status_code = 500
169
+ error_params = { title: "UNPARSEABLE_RESPONSE", status_code: 500 }
170
+ error = MailChimpError.new("Unparseable response: #{response.body}", error_params)
172
171
  raise error
173
172
  end
174
173
  end
@@ -1,3 +1,3 @@
1
1
  module Gibbon
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1"
3
3
  end
@@ -0,0 +1,49 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gibbon::MailChimpError do
4
+ let(:message) { 'Foo' }
5
+ let(:params) do
6
+ {
7
+ title: 'error_title',
8
+ detail: 'error_detail',
9
+ body: 'error_body',
10
+ raw_body: 'error_raw_body',
11
+ status_code: 'error_status_code'
12
+ }
13
+ end
14
+
15
+ before do
16
+ @gibbon = Gibbon::MailChimpError.new(message, params)
17
+ end
18
+
19
+ it "adds the error params to the error message" do
20
+ expected_message = "Foo " \
21
+ "@title=\"error_title\", " \
22
+ "@detail=\"error_detail\", " \
23
+ "@body=\"error_body\", " \
24
+ "@raw_body=\"error_raw_body\", " \
25
+ "@status_code=\"error_status_code\""
26
+
27
+ expect(@gibbon.message).to eq(expected_message)
28
+ end
29
+
30
+ it 'sets the title attribute' do
31
+ expect(@gibbon.title).to eq(params[:title])
32
+ end
33
+
34
+ it 'sets the detail attribute' do
35
+ expect(@gibbon.detail).to eq(params[:detail])
36
+ end
37
+
38
+ it 'sets the body attribute' do
39
+ expect(@gibbon.body).to eq(params[:body])
40
+ end
41
+
42
+ it 'sets the raw_body attribute' do
43
+ expect(@gibbon.raw_body).to eq(params[:raw_body])
44
+ end
45
+
46
+ it 'sets the status_code attribute' do
47
+ expect(@gibbon.status_code).to eq(params[:status_code])
48
+ end
49
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gibbon
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amro Mousa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-27 00:00:00.000000000 Z
11
+ date: 2017-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -108,6 +108,7 @@ files:
108
108
  - spec/gibbon/api_request_spec.rb
109
109
  - spec/gibbon/export_spec.rb
110
110
  - spec/gibbon/gibbon_spec.rb
111
+ - spec/gibbon/mailchimp_error_spec.rb
111
112
  - spec/gibbon/upsert_spec.rb
112
113
  - spec/spec_helper.rb
113
114
  homepage: http://github.com/amro/gibbon
@@ -138,5 +139,6 @@ test_files:
138
139
  - spec/gibbon/api_request_spec.rb
139
140
  - spec/gibbon/export_spec.rb
140
141
  - spec/gibbon/gibbon_spec.rb
142
+ - spec/gibbon/mailchimp_error_spec.rb
141
143
  - spec/gibbon/upsert_spec.rb
142
144
  - spec/spec_helper.rb