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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11a5ff9677d73d70dffce3aff18988adcaa6403967004dd015e1ecdf108a9a84
4
- data.tar.gz: 0c9e88ede7d2c7905a75b9b0864666cba0df4d918ceeab257165840d6862779c
3
+ metadata.gz: 52d4f3db6aff7605079f714b836dbc438bbf5feb421c78557be8977ef357aae4
4
+ data.tar.gz: 8f68774593c5276a52948eda7bcb5f4424b64adccf7c8e908b4665a3c76eebf5
5
5
  SHA512:
6
- metadata.gz: 535583caf77a69bd9b68c3f8ed8e9ca10504df1e3591dc182e08c697847ecc9b81f8bd8c60388e0d51ceaedcf49dbface833007d8438ee0d90a36e4b94466792
7
- data.tar.gz: 1c679150ab83e112b7de30850f7bebddab664a9b7b4b6ac0944cf63220bb16e265abc233ad22efde78fbe2ebfb004a80c22d03443c7b0d904c69d29ddef64223
6
+ metadata.gz: 6184c59c4297d67fdc07260a59ff5a8f62d92ec08ae05e17f3206d2b65ccf50dd8855ca84651e778910f4c7c3c7491a6069c17e3283735efa16bf359ccc3f7ff
7
+ data.tar.gz: 0dbba08d80fbffc8a4b1321ec3b8b9601c1ad37fbac0af9aed5cfe932de26d54e2c7703b4993edf9734adf394c70206f44f2e79714e663bd16a34b6cfe589f04
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 = :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
 
@@ -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 = "0.2.0"
7
7
  spec.authors = ["Micke Lisinge"]
8
8
  spec.email = ["micke@apoex.se"]
9
9
 
@@ -28,12 +28,12 @@ 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
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.1.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-20 00:00:00.000000000 Z
11
+ date: 2020-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler