pebblebed 0.3.21 → 0.3.22

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: 65f960100fa8f06519e6d5322a3e94a3387beb27
4
- data.tar.gz: c6135f4cf37b105aa16ef063f707ce8661b7c439
3
+ metadata.gz: 0d6cc9e91f2cc09da6e335cceeb464b2587e13f6
4
+ data.tar.gz: 6bdf45e966352b2b75fb9f86c665a578e439e209
5
5
  SHA512:
6
- metadata.gz: a5a203b1048b041abb697811f1084a7384ea30ed101f601d17fddaa3978f871b65afa53309de299e94eb7dfccceb818a43dd28cb27e158b6374acc4fb32fae60
7
- data.tar.gz: e15a17c6a78643194245573635a0155adffd8af97677483f7cb71b642066afacd837fcc9e5ec423ae3c0aa3952c356a596dcaf308fe22f32a2123a8a3c4a783e
6
+ metadata.gz: 9b96f0a8865ddde136b66bc93be02e27cbaaf60b88ddfe9548dfbaf35a19c056387e84b53106897139e0f6d343905b981d0ac4ff47fd41d4783178bbc3f6caaa
7
+ data.tar.gz: 0d1d0a8376de9876073f8fab97deac8b9ce82959f7a5aae1a42f2d02d924cfddd45ff242cbb6995207387ff82f97e0785818003272fa8cc6a282c96b9ba79156
@@ -174,7 +174,14 @@ module Pebblebed
174
174
 
175
175
  def self.with_easy(&block)
176
176
  easy = Thread.current[:pebblebed_curb_easy] ||= Curl::Easy.new
177
- easy.reset
177
+ begin
178
+ easy.reset
179
+ rescue RuntimeError => e
180
+ # This can happen if previous streaming isn't finished
181
+ raise unless e.to_s =~ /^Cannot close an active curl handle within a callback/
182
+ easy.close rescue nil
183
+ easy = Thread.current[:pebblebed_curb_easy] = Curl::Easy.new
184
+ end
178
185
  yield easy
179
186
  end
180
187
 
@@ -1,3 +1,3 @@
1
1
  module Pebblebed
2
- VERSION = "0.3.21"
2
+ VERSION = "0.3.22"
3
3
  end
@@ -150,7 +150,7 @@ describe Pebblebed::GenericClient do
150
150
  URI.parse("http://example.org/"),
151
151
  {"session" => "session_key"},
152
152
  anything) { |_, _, options|
153
- options[:on_data].call(%{"a"\n\n})
153
+ options[:on_data].call(%{{"a":42}\n\n})
154
154
  }.and_return(curl_result)
155
155
 
156
156
  payloads = []
@@ -160,7 +160,7 @@ describe Pebblebed::GenericClient do
160
160
  on_data: ->(payload) {
161
161
  payloads << payload
162
162
  })
163
- expect(payloads).to eq ['a']
163
+ expect(payloads).to eq [{'a' => 42}]
164
164
  expect(response.status).to eq 201
165
165
  expect(response.body).to eq "halp"
166
166
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pebblebed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.21
4
+ version: 0.3.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen