gibbon 1.1.3 → 1.1.4

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: a36d1e7fe83d03c1a4e903c27626dac393eed101
4
- data.tar.gz: 9fe82b43fbc7c0e7d92f7f6035dedae101190969
3
+ metadata.gz: cd47e4cef1d60d2b4ed83bd963f175cdf27097e6
4
+ data.tar.gz: 09bfb5887509fc5238b345450f8c2d5379d5a374
5
5
  SHA512:
6
- metadata.gz: a910079fd12ae97ee81ad1d33a9df21c1a1bd318910d1dbf14ed4632d0b59ee415b56abb3ed5da140a8bbd019b95f96f09fb29e26a3bde31c92d39b75af96e2a
7
- data.tar.gz: 6701a0dbeefc07793463b0bd9956674f0ad6044f818dfb9674b1d2cb7d5e25ce304cedd8ee0388984637859c51255ab0a342126e877237534c94b746da29a129
6
+ metadata.gz: 0a29a979096ab6cffcd3759442e28f6524ab39b4bfa97b2c34af3dd05abc0b05a8cc9b97905b68e87188ace505016beda9d8bb35028455f2e6c0fd9b32ed42ee
7
+ data.tar.gz: 9e8da3ca0addf9c322f80e477c124484c88d1d937938ed33e2cceea583165ecfc81ff2e2d268895b339475ff43b30486e40cfdba4568e7000b9c31cb4f50a70a
data/gibbon.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "gibbon"
6
- s.version = "1.1.3"
6
+ s.version = "1.1.4"
7
7
  s.authors = ["Amro Mousa"]
8
8
  s.email = ["amromousa@gmail.com"]
9
9
  s.homepage = "http://github.com/amro/gibbon"
@@ -26,6 +26,6 @@ Gem::Specification.new do |s|
26
26
  s.add_dependency('multi_json', '>= 1.3.4')
27
27
 
28
28
  s.add_development_dependency 'rake'
29
- s.add_development_dependency "rspec", ">= 2.14.1"
29
+ s.add_development_dependency "rspec", "2.14.1"
30
30
 
31
31
  end
data/lib/gibbon/export.rb CHANGED
@@ -23,6 +23,9 @@ module Gibbon
23
23
 
24
24
  lines = response.body.lines
25
25
  if @throws_exceptions
26
+ # ignore blank responses
27
+ return [] if lines.first.strip.empty?
28
+
26
29
  first_line = MultiJson.load(lines.first) if lines.first
27
30
 
28
31
  if should_raise_for_response?(first_line)
@@ -158,19 +158,19 @@ describe Gibbon do
158
158
  expect_post(@url, @body.merge("fee" => 99))
159
159
  @gibbon.say.hello(:fee => 99)
160
160
  end
161
-
161
+
162
162
  it "pass through http header settings" do
163
163
  @gibbon.timeout=30
164
164
  expect_post(@url, @body.merge("messages" => 'Simon says'), @gibbon.timeout, {'Accept-Language' => 'en'})
165
165
  @gibbon.say.hello(:messages => 'Simon says', :headers => {'Accept-Language' => 'en'} )
166
166
  end
167
-
167
+
168
168
  it "with http headers not set" do
169
169
  @gibbon.timeout=30
170
170
  expect_post(@url, @body.merge("messages" => 'Simon says'), @gibbon.timeout, {})
171
171
  @gibbon.say.hello(:messages => 'Simon says' )
172
172
  end
173
-
173
+
174
174
  end
175
175
 
176
176
  describe "Gibbon instances" do
@@ -209,7 +209,7 @@ describe Gibbon do
209
209
  allow(Gibbon::APICategory).to receive(:post).and_return(Struct.new(:body).new(MultiJson.dump({"cid" => "1234567"})))
210
210
  expect(@gibbon.campaigns.send({"cid" => "1234567"})).to eq({"cid" => "1234567"})
211
211
  end
212
-
212
+
213
213
  it "not throw exception if configured to and the API returns an unparsable response" do
214
214
  @gibbon.throws_exceptions = false
215
215
  allow(Gibbon::APICategory).to receive(:post).and_return(Struct.new(:body).new("<HTML>Invalid response</HTML>"))
@@ -260,6 +260,13 @@ describe Gibbon do
260
260
  expect {@gibbon.say_hello(@body)}.to raise_error(Gibbon::MailChimpError)
261
261
  end
262
262
 
263
+ it "should handle a blank response without throwing an exception" do
264
+ @gibbon.throws_exceptions = true
265
+ allow(Gibbon::Export).to receive(:post).and_return(Struct.new(:body).new(Struct.new(:lines).new([" "])))
266
+
267
+ expect(@gibbon.say_hello(@body)).to eq([])
268
+ end
269
+
263
270
  end
264
271
 
265
272
  private
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: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amro Mousa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-20 00:00:00.000000000 Z
11
+ date: 2014-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -56,14 +56,14 @@ dependencies:
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.14.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.14.1
69
69
  description: A wrapper for MailChimp API 2.0 and Export API 1.0
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project: gibbon
115
- rubygems_version: 2.2.1
115
+ rubygems_version: 2.3.0
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: A wrapper for MailChimp API 2.0 and Export API 1.0