pebblebed 0.4.3 → 0.4.4

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: 3ae0370be16e7d70a6e8e6341ae2ad76130fb83a
4
- data.tar.gz: 2ee730298b1333ea56f88441800b9334ae144fe9
3
+ metadata.gz: d39040379314a240c9514dffa13b4d3088aec34d
4
+ data.tar.gz: 1b84342fa8004cdfdcbacafe4412deb60cd127ea
5
5
  SHA512:
6
- metadata.gz: a8aebb96161c91ee3c75b7352d3278f9f3a3b318d2ea432d3e82b99bea4d605d4d164db559ca99dcd82df7cc5315dbc2d10c3ec883a849e9d87d13e7514540f7
7
- data.tar.gz: d5fdf2b38b837f04d9c3fd74079f1daa5a6b52f0299913cff38eb0414d366085c10903f20687e45c16cc44e6d8bbc39f29063e8e8814737d028c3b134fa2f7f7
6
+ metadata.gz: 26e70eea47bff69cb1903a03dc964cd23d5ea04e1bb2e72a2d48b16a1e922fef939c17ab8f0f49eac0d8a12b30ad53c689e2e14464d5b24da291cb0d445e5978
7
+ data.tar.gz: 534d4a10daaa68f4120db373032f269fb33602baae5d3aa0b1caea6fddb64d60dc437f3f95d8a9131a80bfb9ca1ee07593feaf109d9cbf7bd21d0898b0fdde26
@@ -240,7 +240,7 @@ module Pebblebed
240
240
  end
241
241
 
242
242
  def self.do_request(url, idempotent: true, &block)
243
- with_connection(url) { |connection|
243
+ with_connection(url, idempotent) { |connection|
244
244
  begin
245
245
  request = block.call(connection)
246
246
  response = Response.new(url, request.status, request.body)
@@ -262,8 +262,13 @@ module Pebblebed
262
262
  }
263
263
  end
264
264
 
265
- def self.with_connection(url, &block)
266
- connection = self.current_connection(url) || new_connection(url)
265
+ def self.with_connection(url, idempotent, &block)
266
+ connection = self.current_connection(url)
267
+ if connection
268
+ connection.reset unless idempotent
269
+ else
270
+ connection = new_connection(url)
271
+ end
267
272
  self.current_connection={:url => url, :connection => connection}
268
273
  yield connection
269
274
  end
@@ -1,3 +1,3 @@
1
1
  module Pebblebed
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  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.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-23 00:00:00.000000000 Z
12
+ date: 2018-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec