httpi-adapter-typhoeus 0.1.0 → 0.2.0
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/README.md +17 -5
- data/httpi-adapter-typhoeus.gemspec +1 -1
- data/lib/httpi/adapter/typhoeus.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52d4f3db6aff7605079f714b836dbc438bbf5feb421c78557be8977ef357aae4
|
|
4
|
+
data.tar.gz: 8f68774593c5276a52948eda7bcb5f4424b64adccf7c8e908b4665a3c76eebf5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6184c59c4297d67fdc07260a59ff5a8f62d92ec08ae05e17f3206d2b65ccf50dd8855ca84651e778910f4c7c3c7491a6069c17e3283735efa16bf359ccc3f7ff
|
|
7
|
+
data.tar.gz: 0dbba08d80fbffc8a4b1321ec3b8b9601c1ad37fbac0af9aed5cfe932de26d54e2c7703b4993edf9734adf394c70206f44f2e79714e663bd16a34b6cfe589f04
|
data/README.md
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# httpi-adapter-typhoeus
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/rb/httpi-adapter-typhoeus)
|
|
4
|
+
[](https://travis-ci.org/apoex/httpi-adapter-typhoeus)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
httpi-adapter-typhoeus lets you use [Typhoeus](https://github.com/typhoeus/typhoeus) with [HTTPI](https://github.com/savonrb/httpi)
|
|
6
7
|
|
|
7
8
|
## Installation
|
|
8
9
|
|
|
9
10
|
Add this line to your application's Gemfile:
|
|
10
11
|
|
|
11
12
|
```ruby
|
|
12
|
-
gem
|
|
13
|
+
gem "httpi-adapter-typhoeus"
|
|
13
14
|
```
|
|
14
15
|
|
|
15
16
|
And then execute:
|
|
@@ -22,7 +23,18 @@ Or install it yourself as:
|
|
|
22
23
|
|
|
23
24
|
## Usage
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
Configure `HTTPI` to use the `Typhoeus` adapter globally:
|
|
27
|
+
|
|
28
|
+
```ruby
|
|
29
|
+
HTTPI.adapter = :curb
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
If you're using [Savon](https://github.com/savonrb/savon) and want to configure one specific
|
|
33
|
+
client to use the adapter, you can initialize Savon with:
|
|
34
|
+
|
|
35
|
+
```ruby
|
|
36
|
+
Savon.client(adapter: :typhoeus)
|
|
37
|
+
```
|
|
26
38
|
|
|
27
39
|
## Development
|
|
28
40
|
|
|
@@ -28,12 +28,12 @@ module HTTPI
|
|
|
28
28
|
|
|
29
29
|
response = @client.run
|
|
30
30
|
|
|
31
|
-
if response.
|
|
32
|
-
Response.new(response.code, response.headers, response.body)
|
|
33
|
-
elsif response.timed_out?
|
|
31
|
+
if response.timed_out?
|
|
34
32
|
raise TimeoutError
|
|
35
33
|
elsif response.response_code == 0
|
|
36
34
|
raise TyphoesConnectionError, response.return_message
|
|
35
|
+
else
|
|
36
|
+
Response.new(response.code, response.headers, response.body)
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: httpi-adapter-typhoeus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Micke Lisinge
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-03-
|
|
11
|
+
date: 2020-03-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|