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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11a5ff9677d73d70dffce3aff18988adcaa6403967004dd015e1ecdf108a9a84
4
- data.tar.gz: 0c9e88ede7d2c7905a75b9b0864666cba0df4d918ceeab257165840d6862779c
3
+ metadata.gz: 69fcf7b6d7eec854eac68b312da8ad5a9c68195a7c7c8f2267d9168adc5953a8
4
+ data.tar.gz: 2c63462d54a5235eb1364a82557a8e71f13223bba023f0178b583ffcaf3b1f36
5
5
  SHA512:
6
- metadata.gz: 535583caf77a69bd9b68c3f8ed8e9ca10504df1e3591dc182e08c697847ecc9b81f8bd8c60388e0d51ceaedcf49dbface833007d8438ee0d90a36e4b94466792
7
- data.tar.gz: 1c679150ab83e112b7de30850f7bebddab664a9b7b4b6ac0944cf63220bb16e265abc233ad22efde78fbe2ebfb004a80c22d03443c7b0d904c69d29ddef64223
6
+ metadata.gz: be018663fb70e96023796b79d895128cc8e8f6d04eeed115f06e20d7e98dc27b49c337efd32614a2fa0e5a9b94362d5e3a9318f673f9e6a1f5813f218d7503f6
7
+ data.tar.gz: 7f647ff6fb6b255f0fda08f9ab0676a5ba696a857e6fb74bd64c068a15c00a6d7f4f8d965d708dfba9665b28c7eb5ecabe5c6599ddc973fcfda8ec84627f35cd
data/README.md CHANGED
@@ -1,15 +1,16 @@
1
- # HTTPI::Adapter::Typhoeus
1
+ # httpi-adapter-typhoeus
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/httpi/adapter/typhoeus`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
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 'httpi-adapter-typhoeus'
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
- TODO: Write usage instructions here
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
 
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "httpi-adapter-typhoeus"
6
- spec.version = "0.1.0"
6
+ spec.version = "1.0.1"
7
7
  spec.authors = ["Micke Lisinge"]
8
8
  spec.email = ["micke@apoex.se"]
9
9
 
@@ -28,12 +28,17 @@ module HTTPI
28
28
 
29
29
  response = @client.run
30
30
 
31
- if response.success?
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
- raise TyphoesConnectionError, response.return_message
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.0
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: 2020-03-20 00:00:00.000000000 Z
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.0.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: []