pebblebed 0.4.10 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pebblebed/http.rb +18 -14
- data/lib/pebblebed/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62452f2f7ee12c5a5b1211348af0be3a27845221
|
4
|
+
data.tar.gz: f09064a146d9ff794015a8658d0714e5d8aca70b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82ea3c29fbcfd2a69bcea6054b94c09da7b3e5e86920d70b2b75f80abb4f5789adf63cb55604cbbe0c01d98373d2161f3ee488dd43bd09a42df1b0fd9ccd844b
|
7
|
+
data.tar.gz: 68bc9d9fbd185abb9dc5181efe4a0ccb9d4697256456a62c1206c4993ef0d110279c7aeb35021770c89638b41df659bfa77dc1369a77198342b75e681764b9da
|
data/lib/pebblebed/http.rb
CHANGED
@@ -35,14 +35,18 @@ module Pebblebed
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
class HttpNotFoundError < HttpError; end
|
39
|
+
|
38
40
|
class HttpTransportError < StandardError
|
39
|
-
def initialize(
|
40
|
-
super
|
41
|
-
set_backtrace
|
41
|
+
def initialize(message, exception, url)
|
42
|
+
super(message)
|
43
|
+
set_backtrace(exception.backtrace)
|
44
|
+
@url = url
|
42
45
|
end
|
46
|
+
|
47
|
+
attr_reader :url
|
43
48
|
end
|
44
49
|
|
45
|
-
class HttpNotFoundError < HttpError; end
|
46
50
|
class HttpSocketError < HttpTransportError; end
|
47
51
|
class HttpTimeoutError < HttpTransportError; end
|
48
52
|
|
@@ -250,10 +254,10 @@ module Pebblebed
|
|
250
254
|
request = block.call(connection)
|
251
255
|
response = Response.new(url, request.status, request.body)
|
252
256
|
return handle_http_errors(response)
|
253
|
-
rescue Excon::Errors::Timeout =>
|
254
|
-
raise HttpTimeoutError.new(
|
255
|
-
rescue Excon::Errors::SocketError =>
|
256
|
-
raise HttpSocketError.new(
|
257
|
+
rescue Excon::Errors::Timeout => e
|
258
|
+
raise HttpTimeoutError.new("#{e} [#{url}]", e, url)
|
259
|
+
rescue Excon::Errors::SocketError => e
|
260
|
+
raise HttpSocketError.new("#{e} [#{url}]", e, url)
|
257
261
|
end
|
258
262
|
}
|
259
263
|
}
|
@@ -264,7 +268,7 @@ module Pebblebed
|
|
264
268
|
interval = 0.1
|
265
269
|
begin
|
266
270
|
return yield
|
267
|
-
rescue HttpTimeoutError, HttpSocketError
|
271
|
+
rescue HttpTimeoutError, HttpSocketError
|
268
272
|
raise if Time.now >= deadline
|
269
273
|
sleep(interval)
|
270
274
|
interval = [30, interval * 2].min
|
@@ -314,11 +318,11 @@ module Pebblebed
|
|
314
318
|
|
315
319
|
# Returns new Excon conection from current configuration.
|
316
320
|
def self.new_connection(url)
|
317
|
-
|
318
|
-
:
|
319
|
-
:
|
320
|
-
:
|
321
|
-
:
|
321
|
+
Excon.new(base_url(url), {
|
322
|
+
read_timeout: read_timeout || DEFAULT_READ_TIMEOUT,
|
323
|
+
write_timeout: write_timeout || DEFAULT_WRITE_TIMEOUT,
|
324
|
+
connect_timeout: connect_timeout || DEFAULT_CONNECT_TIMEOUT,
|
325
|
+
thread_safe_sockets: false
|
322
326
|
})
|
323
327
|
end
|
324
328
|
|
data/lib/pebblebed/version.rb
CHANGED
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.
|
4
|
+
version: 0.4.11
|
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:
|
12
|
+
date: 2020-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -332,7 +332,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
332
332
|
version: '0'
|
333
333
|
requirements: []
|
334
334
|
rubyforge_project: pebblebed
|
335
|
-
rubygems_version: 2.5.2
|
335
|
+
rubygems_version: 2.5.2.3
|
336
336
|
signing_key:
|
337
337
|
specification_version: 4
|
338
338
|
summary: Development tools for working with Pebblebed
|