http_utilities 1.2.5 → 1.2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/http_utilities.gemspec +1 -1
- data/lib/http_utilities.rb +1 -1
- data/lib/http_utilities/http/client.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9122d232c81512e4702fcb8aa12a2ec01d263bca
|
4
|
+
data.tar.gz: 075bb8df192f856aa39066a2c0af7bb357e78de2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6640e9d8bfd12f61b4b17f17f0b593e5da727f57cbcb94b9126db763846b341169f982cf7f36f6e19f66b67dfb2fc1ec26b00864d9c81d20fa20f9b802283af
|
7
|
+
data.tar.gz: 43298e43230ad50198c3a911be62dac68ab6af0fd445d126b14663b3aa1100eaaf2d9efafe3c5d519840813e3da0cc540c98b59aceed185948666a7466eab9ba
|
data/http_utilities.gemspec
CHANGED
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
|
|
3
3
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version=
|
4
4
|
|
5
5
|
s.name = "http_utilities"
|
6
|
-
s.version = "1.2.5"
|
6
|
+
s.version = "1.2.5.1"
|
7
7
|
|
8
8
|
s.authors = ["Sebastian Johnsson"]
|
9
9
|
s.description = "Wrapper for Faraday with additional functionality"
|
data/lib/http_utilities.rb
CHANGED
@@ -5,7 +5,7 @@ module HttpUtilities
|
|
5
5
|
class Client
|
6
6
|
include HttpUtilities::Http::Logger
|
7
7
|
|
8
|
-
def get(url, arguments: {}, options: {}, retries: 3)
|
8
|
+
def get(url, arguments: {}, options: {}, raise_exceptions: false, retries: 3)
|
9
9
|
response = nil
|
10
10
|
request = build_request(options: options)
|
11
11
|
|
@@ -17,12 +17,13 @@ module HttpUtilities
|
|
17
17
|
log(:error, "[HttpUtilities::Http::Client] - An error occurred while trying to fetch the response. Error Class: #{e.class.name}. Error Message: #{e.message}.")
|
18
18
|
retries -= 1
|
19
19
|
retry if retries > 0
|
20
|
+
raise e if raise_exceptions && retries == 0
|
20
21
|
end
|
21
22
|
|
22
23
|
return response
|
23
24
|
end
|
24
25
|
|
25
|
-
def post(url, data: nil, options: {}, retries: 3)
|
26
|
+
def post(url, data: nil, options: {}, raise_exceptions: false, retries: 3)
|
26
27
|
response = nil
|
27
28
|
request = build_request(options: options)
|
28
29
|
|
@@ -34,6 +35,7 @@ module HttpUtilities
|
|
34
35
|
log(:error, "[HttpUtilities::Http::Client] - An error occurred while trying to fetch the response. Error Class: #{e.class.name}. Error Message: #{e.message}.")
|
35
36
|
retries -= 1
|
36
37
|
retry if retries > 0
|
38
|
+
raise e if raise_exceptions && retries == 0
|
37
39
|
end
|
38
40
|
|
39
41
|
return response
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_utilities
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.5
|
4
|
+
version: 1.2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Johnsson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|