httpi-adapter-typhoeus 0.1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -5
- data/httpi-adapter-typhoeus.gemspec +1 -1
- data/lib/httpi/adapter/typhoeus.rb +10 -4
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69fcf7b6d7eec854eac68b312da8ad5a9c68195a7c7c8f2267d9168adc5953a8
|
4
|
+
data.tar.gz: 2c63462d54a5235eb1364a82557a8e71f13223bba023f0178b583ffcaf3b1f36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be018663fb70e96023796b79d895128cc8e8f6d04eeed115f06e20d7e98dc27b49c337efd32614a2fa0e5a9b94362d5e3a9318f673f9e6a1f5813f218d7503f6
|
7
|
+
data.tar.gz: 7f647ff6fb6b255f0fda08f9ab0676a5ba696a857e6fb74bd64c068a15c00a6d7f4f8d965d708dfba9665b28c7eb5ecabe5c6599ddc973fcfda8ec84627f35cd
|
data/README.md
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
#
|
1
|
+
# httpi-adapter-typhoeus
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/httpi-adapter-typhoeus.svg)](https://badge.fury.io/rb/httpi-adapter-typhoeus)
|
4
|
+
[![Build Status](https://travis-ci.org/apoex/httpi-adapter-typhoeus.svg?branch=master)](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 = :typhoeus
|
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,17 @@ 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
|
+
case response.return_message
|
35
|
+
when /ssl/i
|
36
|
+
raise SSLError, response.return_message
|
37
|
+
else
|
38
|
+
raise TyphoesConnectionError, response.return_message
|
39
|
+
end
|
40
|
+
else
|
41
|
+
Response.new(response.code, response.headers, response.body)
|
37
42
|
end
|
38
43
|
end
|
39
44
|
|
@@ -66,6 +71,7 @@ module HTTPI
|
|
66
71
|
|
67
72
|
if ssl.verify_mode == :none
|
68
73
|
@client.options[:ssl_verifyhost] = 0
|
74
|
+
@client.options[:ssl_verifypeer] = false
|
69
75
|
else
|
70
76
|
@client.options[:ssl_verifyhost] = 2
|
71
77
|
@client.options[:ssl_verifypeer] = ssl.verify_mode == :peer
|
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.1
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micke Lisinge
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,7 +120,7 @@ metadata:
|
|
120
120
|
homepage_uri: https://github.com/apoex/httpi-adapter-typhoeus
|
121
121
|
source_code_uri: https://github.com/apoex/httpi-adapter-typhoeus
|
122
122
|
changelog_uri: https://github.com/apoex/httpi-adapter-typhoeus
|
123
|
-
post_install_message:
|
123
|
+
post_install_message:
|
124
124
|
rdoc_options: []
|
125
125
|
require_paths:
|
126
126
|
- lib
|
@@ -135,8 +135,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
|
-
rubygems_version: 3.
|
139
|
-
signing_key:
|
138
|
+
rubygems_version: 3.3.3
|
139
|
+
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: An adapter for HTTPI that uses Typhoeus
|
142
142
|
test_files: []
|