typhoeus 0.4.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.rspec +4 -0
- data/.travis.yml +26 -0
- data/CHANGELOG.md +341 -28
- data/CONTRIBUTING.md +20 -0
- data/Gemfile +31 -2
- data/Guardfile +9 -0
- data/LICENSE +1 -1
- data/README.md +486 -357
- data/Rakefile +21 -12
- data/UPGRADE.md +55 -0
- data/lib/rack/typhoeus/middleware/params_decoder/helper.rb +76 -0
- data/lib/rack/typhoeus/middleware/params_decoder.rb +57 -0
- data/lib/rack/typhoeus.rb +1 -0
- data/lib/typhoeus/adapters/faraday.rb +180 -0
- data/lib/typhoeus/cache/dalli.rb +28 -0
- data/lib/typhoeus/cache/rails.rb +28 -0
- data/lib/typhoeus/cache/redis.rb +35 -0
- data/lib/typhoeus/config.rb +69 -0
- data/lib/typhoeus/easy_factory.rb +180 -0
- data/lib/typhoeus/errors/no_stub.rb +12 -0
- data/lib/typhoeus/errors/typhoeus_error.rb +8 -0
- data/lib/typhoeus/errors.rb +9 -0
- data/lib/typhoeus/expectation.rb +217 -0
- data/lib/typhoeus/hydra/addable.rb +23 -0
- data/lib/typhoeus/hydra/before.rb +31 -0
- data/lib/typhoeus/hydra/block_connection.rb +35 -0
- data/lib/typhoeus/hydra/cacheable.rb +15 -0
- data/lib/typhoeus/hydra/memoizable.rb +56 -0
- data/lib/typhoeus/hydra/queueable.rb +83 -0
- data/lib/typhoeus/hydra/runnable.rb +19 -0
- data/lib/typhoeus/hydra/stubbable.rb +28 -0
- data/lib/typhoeus/hydra.rb +84 -236
- data/lib/typhoeus/pool.rb +70 -0
- data/lib/typhoeus/railtie.rb +12 -0
- data/lib/typhoeus/request/actions.rb +125 -0
- data/lib/typhoeus/request/before.rb +30 -0
- data/lib/typhoeus/request/block_connection.rb +52 -0
- data/lib/typhoeus/request/cacheable.rb +38 -0
- data/lib/typhoeus/request/callbacks.rb +151 -0
- data/lib/typhoeus/request/marshal.rb +22 -0
- data/lib/typhoeus/request/memoizable.rb +38 -0
- data/lib/typhoeus/request/operations.rb +40 -0
- data/lib/typhoeus/request/responseable.rb +29 -0
- data/lib/typhoeus/request/streamable.rb +34 -0
- data/lib/typhoeus/request/stubbable.rb +30 -0
- data/lib/typhoeus/request.rb +186 -231
- data/lib/typhoeus/response/cacheable.rb +14 -0
- data/lib/typhoeus/response/header.rb +105 -0
- data/lib/typhoeus/response/informations.rb +248 -0
- data/lib/typhoeus/response/status.rb +106 -0
- data/lib/typhoeus/response.rb +60 -115
- data/lib/typhoeus/version.rb +3 -1
- data/lib/typhoeus.rb +126 -39
- data/perf/profile.rb +14 -0
- data/perf/vs_nethttp.rb +64 -0
- data/spec/rack/typhoeus/middleware/params_decoder/helper_spec.rb +156 -0
- data/spec/rack/typhoeus/middleware/params_decoder_spec.rb +31 -0
- data/spec/spec_helper.rb +29 -0
- data/spec/support/localhost_server.rb +94 -0
- data/spec/support/memory_cache.rb +15 -0
- data/spec/support/server.rb +116 -0
- data/spec/typhoeus/adapters/faraday_spec.rb +339 -0
- data/spec/typhoeus/cache/dalli_spec.rb +41 -0
- data/spec/typhoeus/cache/redis_spec.rb +41 -0
- data/spec/typhoeus/config_spec.rb +15 -0
- data/spec/typhoeus/easy_factory_spec.rb +143 -0
- data/spec/typhoeus/errors/no_stub_spec.rb +13 -0
- data/spec/typhoeus/expectation_spec.rb +280 -0
- data/spec/typhoeus/hydra/addable_spec.rb +22 -0
- data/spec/typhoeus/hydra/before_spec.rb +98 -0
- data/spec/typhoeus/hydra/block_connection_spec.rb +18 -0
- data/spec/typhoeus/hydra/cacheable_spec.rb +88 -0
- data/spec/typhoeus/hydra/memoizable_spec.rb +53 -0
- data/spec/typhoeus/hydra/queueable_spec.rb +98 -0
- data/spec/typhoeus/hydra/runnable_spec.rb +137 -0
- data/spec/typhoeus/hydra/stubbable_spec.rb +48 -0
- data/spec/typhoeus/hydra_spec.rb +22 -0
- data/spec/typhoeus/pool_spec.rb +137 -0
- data/spec/typhoeus/request/actions_spec.rb +19 -0
- data/spec/typhoeus/request/before_spec.rb +93 -0
- data/spec/typhoeus/request/block_connection_spec.rb +75 -0
- data/spec/typhoeus/request/cacheable_spec.rb +94 -0
- data/spec/typhoeus/request/callbacks_spec.rb +91 -0
- data/spec/typhoeus/request/marshal_spec.rb +60 -0
- data/spec/typhoeus/request/memoizable_spec.rb +34 -0
- data/spec/typhoeus/request/operations_spec.rb +101 -0
- data/spec/typhoeus/request/responseable_spec.rb +13 -0
- data/spec/typhoeus/request/stubbable_spec.rb +45 -0
- data/spec/typhoeus/request_spec.rb +232 -0
- data/spec/typhoeus/response/header_spec.rb +147 -0
- data/spec/typhoeus/response/informations_spec.rb +283 -0
- data/spec/typhoeus/response/status_spec.rb +256 -0
- data/spec/typhoeus/response_spec.rb +100 -0
- data/spec/typhoeus_spec.rb +105 -0
- data/typhoeus.gemspec +25 -0
- metadata +146 -158
- data/lib/typhoeus/curl.rb +0 -453
- data/lib/typhoeus/easy/auth.rb +0 -14
- data/lib/typhoeus/easy/callbacks.rb +0 -33
- data/lib/typhoeus/easy/ffi_helper.rb +0 -61
- data/lib/typhoeus/easy/infos.rb +0 -90
- data/lib/typhoeus/easy/options.rb +0 -115
- data/lib/typhoeus/easy/proxy.rb +0 -20
- data/lib/typhoeus/easy/ssl.rb +0 -82
- data/lib/typhoeus/easy.rb +0 -115
- data/lib/typhoeus/filter.rb +0 -28
- data/lib/typhoeus/form.rb +0 -61
- data/lib/typhoeus/header.rb +0 -54
- data/lib/typhoeus/hydra/callbacks.rb +0 -24
- data/lib/typhoeus/hydra/connect_options.rb +0 -61
- data/lib/typhoeus/hydra/stubbing.rb +0 -68
- data/lib/typhoeus/hydra_mock.rb +0 -131
- data/lib/typhoeus/multi.rb +0 -146
- data/lib/typhoeus/param_processor.rb +0 -43
- data/lib/typhoeus/remote.rb +0 -306
- data/lib/typhoeus/remote_method.rb +0 -108
- data/lib/typhoeus/remote_proxy_object.rb +0 -50
- data/lib/typhoeus/utils.rb +0 -50
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 79bd3451f6ec67ea973d9dc62dc4645c21e2eba1
|
4
|
+
data.tar.gz: 762e3c44e97fc0f2241d5cbf9d2a9ff2caa8a53a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e0a7c0b640b05b4527a4a9a7b3ee7db526fc25e31e001b7287f2423fecebbf6d673adb5c17b7cda32c1206872a3a27d82825b9ee74974607f691e9ee573fb39a
|
7
|
+
data.tar.gz: 444398bc7499402359de7a5534c265bf91c39346903c1b82c4767b1b7f9eb9c72741a979986b905e388301055e6816baa6ef999f9f35bed06a07a4bec37d7b99
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
language: ruby
|
2
|
+
script: "bundle exec rake"
|
3
|
+
rvm:
|
4
|
+
- 1.9.3
|
5
|
+
- 2.0.0
|
6
|
+
- 2.1.10
|
7
|
+
- 2.2.10
|
8
|
+
- 2.3.8
|
9
|
+
- 2.4.7
|
10
|
+
- 2.5.6
|
11
|
+
- 2.6.4
|
12
|
+
- ruby-head
|
13
|
+
- jruby-head
|
14
|
+
- jruby-18mode
|
15
|
+
- jruby-19mode
|
16
|
+
matrix:
|
17
|
+
fast_finish: true
|
18
|
+
allow_failures:
|
19
|
+
- rvm: ruby-head
|
20
|
+
- rvm: jruby-head
|
21
|
+
- rvm: ree
|
22
|
+
include:
|
23
|
+
- rvm: 1.8.7
|
24
|
+
dist: precise
|
25
|
+
- rvm: 1.9.2
|
26
|
+
dist: trusty
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,331 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## Master
|
4
|
+
|
5
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.4.0...master)
|
6
|
+
|
7
|
+
## 1.4.0
|
8
|
+
|
9
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.1.2...v1.4.0)
|
10
|
+
|
11
|
+
#### 1 feature
|
12
|
+
- Faraday adapter exceptions namespace compatibility with Faraday v1 ([@iMacTia](https://github.com/iMacTia) in [#616](https://github.com/typhoeus/typhoeus/pull/616))
|
13
|
+
|
14
|
+
#### 3 Others
|
15
|
+
- Yard warning fixes ([@olleolleolle](https://github.com/olleolleolle) in [#622](https://github.com/typhoeus/typhoeus/pull/622))
|
16
|
+
- Add more Ruby versions in CI matrix ([@olleolleolle](https://github.com/olleolleolle) in [#623](https://github.com/typhoeus/typhoeus/pull/623))
|
17
|
+
- Use of argument passed in function instead of `attr_reader` ([@v-kolesnikov](https://github.com/v-kolesnikov) in [#625](https://github.com/typhoeus/typhoeus/pull/625))
|
18
|
+
|
19
|
+
## 1.1.2
|
20
|
+
|
21
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.1.1...v1.1.2)
|
22
|
+
|
23
|
+
## 1.1.1
|
24
|
+
|
25
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.1.0...v1.1.1)
|
26
|
+
|
27
|
+
## 1.1.0
|
28
|
+
|
29
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.0.2...v1.1.0)
|
30
|
+
|
31
|
+
* Unless specified `Expect` header is set to be empty to avoid `100 continue`
|
32
|
+
to be set when using `PUT`
|
33
|
+
* Add global config option `Typhoeus::Config.proxy`
|
34
|
+
|
35
|
+
## 1.0.2
|
36
|
+
|
37
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.0.1...v1.0.2)
|
38
|
+
|
39
|
+
## 1.0.1
|
40
|
+
|
41
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.0.0...v1.0.1)
|
42
|
+
|
43
|
+
## 1.0.0
|
44
|
+
|
45
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.8.0...v1.0.0)
|
46
|
+
|
47
|
+
## 0.8.0
|
48
|
+
|
49
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.7.3...v0.8.0)
|
50
|
+
|
51
|
+
* `EasyFactory`: Reduced object allocations and method calls during deprecated
|
52
|
+
option handling and option sanitization.
|
53
|
+
([Tasos Laskos](https://github.com/zapotek))
|
54
|
+
* `Response` ([Tasos Laskos](https://github.com/zapotek))
|
55
|
+
* `Header`
|
56
|
+
* `#process_pair`: Halved `#set_value` calls.
|
57
|
+
* `#set_value`: Minimized `Hash` accesses.
|
58
|
+
* `#parse`: Use `String#start_with?` instead of `Regexp` match.
|
59
|
+
* `#process_line`: Optimized key/value sanitization.
|
60
|
+
* `Status`
|
61
|
+
* `#timed_out?`: Only return `true` when `#return_code` is `operation_timedout`.
|
62
|
+
|
63
|
+
## 0.7.3
|
64
|
+
|
65
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.7.2...v0.7.3)
|
66
|
+
|
67
|
+
* Add on_body callbacks individually to allow Ethon to recognize the return code
|
68
|
+
|
69
|
+
## 0.7.2
|
70
|
+
|
71
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.7.1...v0.7.2)
|
72
|
+
|
73
|
+
* Allow arrays to be passed to Expectation#and_return
|
74
|
+
([JP Moral](https://github.com/jpmoral))
|
75
|
+
|
76
|
+
* Added getter for `redirect_time` value.
|
77
|
+
([Adrien Jarthon](https://github.com/jarthod))
|
78
|
+
|
79
|
+
## 0.7.1
|
80
|
+
|
81
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.7.0...v0.7.1)
|
82
|
+
|
83
|
+
Bugfixes:
|
84
|
+
|
85
|
+
* Forking may cause libcurl sockets to be shared with child processes, causing HTTP requests to be interleaved
|
86
|
+
([Rolf Timmermans](https://github.com/rolftimmermans), [\#436](https://github.com/typhoeus/typhoeus/pull/426))
|
87
|
+
|
88
|
+
## 0.7.0
|
89
|
+
|
90
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.7.0.pre1...v0.7.0)
|
91
|
+
|
92
|
+
Bugfixes:
|
93
|
+
|
94
|
+
* Call on_headers and on_body when using stubbed responses.
|
95
|
+
|
96
|
+
## 0.7.0.pre1
|
97
|
+
|
98
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.6.9...v0.7.0.pre1)
|
99
|
+
|
100
|
+
Enhancements:
|
101
|
+
|
102
|
+
* Improving timeout behavior and documentation. `no_signal` is now set per default!
|
103
|
+
([Jonas Wagner](https://github.com/jwagner), [\#398](https://github.com/typhoeus/typhoeus/pull/398))
|
104
|
+
|
105
|
+
## 0.6.8
|
106
|
+
|
107
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.6.7...v0.6.8)
|
108
|
+
|
109
|
+
Bugfixes:
|
110
|
+
|
111
|
+
* Fix Faraday 0.9 compatibility.
|
112
|
+
([Gleb Mazovetskiy](https://github.com/glebm), [\#357](https://github.com/typhoeus/typhoeus/pull/357))
|
113
|
+
* Fix Request#hash for different key orders.
|
114
|
+
([Matthew Schulkind](https://github.com/mschulkind), [\#344](https://github.com/typhoeus/typhoeus/pull/344))
|
115
|
+
|
116
|
+
Enhancements:
|
117
|
+
|
118
|
+
* Use an updated Ethon version. Note that from now on the `mime-types` is no longer a Ethon dependency. The gem will be still used if available to determine the mime type of a file which is uploaded. That means you have to have take care of the gem installation yourself.
|
119
|
+
* Use SVG for status badges in README.
|
120
|
+
([Sean Linsley](https://github.com/seanlinsley), [\#353](https://github.com/typhoeus/typhoeus/pull/353))
|
121
|
+
* Missing quotes in README example code.
|
122
|
+
([Jason R. Clark](https://github.com/jasonrclark), [\#351](https://github.com/typhoeus/typhoeus/pull/351))
|
123
|
+
* Specs for Faraday adapter.
|
124
|
+
([michaelavila](https://github.com/michaelavila), [\#348](https://github.com/typhoeus/typhoeus/pull/348))
|
125
|
+
* Clarify wording in README.
|
126
|
+
([Sean Linsley](https://github.com/seanlinsley), [\#347](https://github.com/typhoeus/typhoeus/pull/347))
|
127
|
+
* Make caching easier for non-memory caches.
|
128
|
+
([Matthew Schulkind](https://github.com/mschulkind), [\#345](https://github.com/typhoeus/typhoeus/pull/345))
|
129
|
+
* Spec refactoring.
|
130
|
+
([Matthew Schulkind](https://github.com/mschulkind), [\#343](https://github.com/typhoeus/typhoeus/pull/343))
|
131
|
+
|
132
|
+
## 0.6.7
|
133
|
+
|
134
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.6.6...v0.6.7)
|
135
|
+
|
136
|
+
Enhancements:
|
137
|
+
|
138
|
+
* Add response streaming.
|
139
|
+
([\#339](https://github.com/typhoeus/typhoeus/pull/339))
|
140
|
+
|
141
|
+
## 0.6.6
|
142
|
+
|
143
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.6.5...v0.6.6)
|
144
|
+
|
145
|
+
## 0.6.5
|
146
|
+
|
147
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.6.4...v0.6.5)
|
148
|
+
|
149
|
+
## 0.6.4
|
150
|
+
|
151
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.6.3...v0.6.4)
|
152
|
+
|
153
|
+
The changelog entries are coming soon!
|
154
|
+
|
155
|
+
## 0.6.3
|
156
|
+
|
157
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.6.2...v0.6.3)
|
158
|
+
|
159
|
+
Enhancements:
|
160
|
+
|
161
|
+
* Cache hydra per thread.
|
162
|
+
* Various documentation improvements.
|
163
|
+
([craiglittle](https://github.com/craiglittle))
|
164
|
+
* Add support for lazy construction of responses from stubbed requests.
|
165
|
+
([ryankindermann](https://github.com/ryankinderman), [\#275](https://github.com/typhoeus/typhoeus/pull/275))
|
166
|
+
|
167
|
+
## 0.6.2
|
168
|
+
|
169
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.6.1...v0.6.2)
|
170
|
+
|
171
|
+
Enhancements:
|
172
|
+
|
173
|
+
* Reintroduce a global cache.
|
174
|
+
* `Request#handled_response` falls back to the original response.
|
175
|
+
([turnerking](https://github.com/turnerking), [\#272](https://github.com/typhoeus/typhoeus/pull/272))
|
176
|
+
* When `Errors::NoStub` is raised the `url` is displayed.
|
177
|
+
([dschneider](https://github.com/dschneider), [\#276](https://github.com/typhoeus/typhoeus/pull/276))
|
178
|
+
* Make `Request#hash` consistent.
|
179
|
+
* Add `.rvmrc` and `ctags` to `.gitignore`.
|
180
|
+
([ryankindermann](https://github.com/ryankinderman), [\#274](https://github.com/typhoeus/typhoeus/pull/274))
|
181
|
+
|
182
|
+
## 0.6.1
|
183
|
+
|
184
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.6.0...v0.6.1)
|
185
|
+
|
186
|
+
Enhancements:
|
187
|
+
|
188
|
+
* Updated ethon version which allows to set multiple protocols.
|
189
|
+
|
190
|
+
## 0.6.0
|
191
|
+
|
192
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.5.4...v0.6.0)
|
193
|
+
|
194
|
+
Enhancements:
|
195
|
+
|
196
|
+
* `Request#url` now also contains the url parameters.
|
197
|
+
* Use updated ethon version which provides access to protocols and redir_protocols in response to [libcurl SASL buffer overflow vulnerability](http://curl.haxx.se/docs/adv_20130206.html)
|
198
|
+
|
199
|
+
Bugfixes:
|
200
|
+
|
201
|
+
* Corrected ssl options for the faraday adapter.
|
202
|
+
* The before hook now correctly returns the response.
|
203
|
+
([Mattias Putman](https://github.com/challengee), [\#268](https://github.com/typhoeus/typhoeus/pull/268))
|
204
|
+
* Benchmark is working again.
|
205
|
+
|
206
|
+
## 0.5.4
|
207
|
+
|
208
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.5.3...v0.5.4)
|
209
|
+
|
210
|
+
Enhancements:
|
211
|
+
|
212
|
+
* Make sure response_code is an integer.
|
213
|
+
* When setting an header through vcr or webmock it becomes a `Typhoeus::Response::Header`.
|
214
|
+
* Provide a Rack middleware to decode nested Typhoeus arrays properly.
|
215
|
+
([Dwayne Macgowan](https://github.com/dwaynemac), [\#224](https://github.com/typhoeus/typhoeus/issues/224))
|
216
|
+
* Handled response is available again.
|
217
|
+
* Rename parameter `url` to `base_url`. See discussion here: [\#250](https://github.com/typhoeus/typhoeus/issues/250).
|
218
|
+
([bkimble](https://github.com/bkimble), [\#256](https://github.com/typhoeus/typhoeus/pull/256))
|
219
|
+
* Provide O(1) header access.
|
220
|
+
* Work around ruby 1.8.7 limitations.
|
221
|
+
([Chris Johnson](https://github.com/findchris), [\#227](https://github.com/typhoeus/typhoeus/pull/227) )
|
222
|
+
* Provide symbol access.
|
223
|
+
|
224
|
+
## 0.5.3
|
225
|
+
|
226
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.5.2...v0.5.3)
|
227
|
+
|
228
|
+
Enhancements:
|
229
|
+
|
230
|
+
* When checking options in Expecation#matches? also consider Request#options.
|
231
|
+
|
232
|
+
Bugfixes:
|
233
|
+
|
234
|
+
* Do not break backwards compatibility with case insensitive headers access.
|
235
|
+
* Make sure hydra behaves correct in case of before hooks.
|
236
|
+
|
237
|
+
## 0.5.2
|
238
|
+
|
239
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.5.1...v0.5.2)
|
240
|
+
|
241
|
+
Enhancements:
|
242
|
+
|
243
|
+
* Do not check the return_code in Response#success? when response is mocked.
|
244
|
+
* Check for memoization, stubbing, before hooks are delayed to Hydra#run. It
|
245
|
+
was on Hydra#queue before and led to strange behavior because if the request
|
246
|
+
was stubbed, it was wrapped up in queue already. There was no way to add
|
247
|
+
callbacks after queue thatswhy. This is now different, since everything happens
|
248
|
+
in run, just as you expect.
|
249
|
+
|
250
|
+
## 0.5.1
|
251
|
+
|
252
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.5.0...v0.5.1)
|
253
|
+
|
254
|
+
Enhancements:
|
255
|
+
|
256
|
+
* Downcase header keys for easier access
|
257
|
+
( [\#227](https://github.com/typhoeus/typhoeus/issues/227) )
|
258
|
+
* Using an updated Ethon version.
|
259
|
+
|
260
|
+
## 0.5.0
|
261
|
+
|
262
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v0.4.2...v0.5.0)
|
263
|
+
|
264
|
+
Major Changes:
|
265
|
+
|
266
|
+
* Ethon integration
|
267
|
+
* Params are url params and a body is always a body for every request type
|
268
|
+
* The options you can set might have a slightly other names, as Ethon sticks to
|
269
|
+
libcurl names. See
|
270
|
+
[Easy.new](http://rubydoc.info/github/typhoeus/ethon/Ethon/Easy#initialize-instance_method)
|
271
|
+
for a description.
|
272
|
+
* Request parameter and body are properly encoded (only POST multiform body is not)
|
273
|
+
* No more header sanitizing. Before: `:headers => { 'user_agent' => 'Custom' }` was modified to
|
274
|
+
`:headers => { 'User-Agent' => 'Custom' }`
|
275
|
+
* `Typhoeus::Easy` and `Typhoeus::Multi` are now `Ethon::Easy` and `Ethon::Multi`
|
276
|
+
|
277
|
+
* Request shortcuts: `Typhoeus.get("www.google.de")`
|
278
|
+
* Global configuration:
|
279
|
+
```ruby
|
280
|
+
Typhoeus.configure do |config|
|
281
|
+
config.verbose = true
|
282
|
+
config.memoize = true
|
283
|
+
end
|
284
|
+
```
|
285
|
+
* No more `Response#headers_hash`, instead `Response#headers` returning the last
|
286
|
+
header and response#redirections returning the responses with headers
|
287
|
+
generated through redirections
|
288
|
+
* Instead of defining the same callbacks on every request, you can define global callbacks:
|
289
|
+
```ruby
|
290
|
+
Typhoeus.on_complete { p "yay" }
|
291
|
+
```
|
292
|
+
* The stubbing interface changed slightly. You now have the same syntax as for requests:
|
293
|
+
```ruby
|
294
|
+
Typhoeus.stub(url, options).and_return(response)
|
295
|
+
```
|
296
|
+
* The following things were removed because they do not seemed to be used at all. Ping me if you disagree!
|
297
|
+
* `Typhoeus::Filter`
|
298
|
+
* `Typhoeus::Remote`
|
299
|
+
* `Typhoeus::RemoteMethod`
|
300
|
+
* `Typhoeus::RemoteProxyObject`
|
301
|
+
* build in cache interface
|
302
|
+
|
303
|
+
Enhancements:
|
304
|
+
|
305
|
+
* Documentation
|
306
|
+
( [Alex P](https://github.com/ifesdjeen), [\#188](https://github.com/typhoeus/typhoeus/issues/188) )
|
307
|
+
* Request#on\_complete can hold multiple blocks.
|
308
|
+
* Request#eql? recognizes when header/params/body has a different order, but still same keys and values
|
309
|
+
( [Alex P](https://github.com/ifesdjeen), [\#194](https://github.com/typhoeus/typhoeus/issues/194) )
|
310
|
+
|
311
|
+
Bug Fixes:
|
312
|
+
|
313
|
+
* Zero bytes in strings are escaped for libcurl
|
314
|
+
* Add support for socks5 hostname proxy type
|
315
|
+
( [eweathers](https://github.com/eweathers), [\#183](https://github.com/typhoeus/typhoeus/issues/183) )
|
316
|
+
* Post body is encoded
|
317
|
+
( [Rohan Deshpande](https://github.com/rdeshpande), [\#143](https://github.com/typhoeus/typhoeus/issues/143) )
|
318
|
+
* Set default user agent
|
319
|
+
( [Steven Shingler](https://github.com/sshingler), [\#176](https://github.com/typhoeus/typhoeus/issues/176) )
|
320
|
+
|
321
|
+
## 0.4.2
|
322
|
+
* A header hotfix
|
323
|
+
|
324
|
+
## 0.4.1
|
325
|
+
* Fix verifypeer and verifyhost options
|
326
|
+
* Fix header sending
|
327
|
+
|
328
|
+
## 0.4.0
|
3
329
|
* Make a GET even when a body is given
|
4
330
|
* Deprecated User Agent setter removed
|
5
331
|
* Allow cache key basis overwrite (John Crepezzi, #147)
|
@@ -7,14 +333,12 @@
|
|
7
333
|
* Refactor upload code (Marnen Laibow-Koser, #152)
|
8
334
|
* Fix travis-ci build (Ezekiel Templin, #160)
|
9
335
|
|
10
|
-
0.3.3
|
11
|
-
-----
|
336
|
+
## 0.3.3
|
12
337
|
* Make sure to call the Easy::failure callback on all non-success http response codes, even invalid ones. [balexis]
|
13
338
|
* Use bytesize instead of length to determine Content-Length [dlamacchia]
|
14
339
|
* Added SSL version option to Easy/Request [michelbarbosa/dbalatero]
|
15
340
|
|
16
|
-
0.3.2
|
17
|
-
-----
|
341
|
+
## 0.3.2
|
18
342
|
* Fix array params to be consistent with HTTP spec [gridaphobe]
|
19
343
|
* traversal\_to\_params\_hash should use the escape option [itsmeduncan]
|
20
344
|
* Fix > 1024 open file descriptors [mschulkind]
|
@@ -35,20 +359,16 @@
|
|
35
359
|
* Fix HTTP status edge-case [balexis]
|
36
360
|
* Expose primary\_ip to easy object [balexis]
|
37
361
|
|
38
|
-
0.2.4
|
39
|
-
-----
|
362
|
+
## 0.2.4
|
40
363
|
* Fix form POSTs to only use multipart for file uploads, otherwise use application/x-www-form-urlencoded [dbalatero]
|
41
364
|
|
42
|
-
0.2.3
|
43
|
-
-----
|
365
|
+
## 0.2.3
|
44
366
|
* Code duplication in Typhoeus::Form led to nested URL param errors on POST only. Fixed [dbalatero]
|
45
367
|
|
46
|
-
0.2.2
|
47
|
-
-----
|
368
|
+
## 0.2.2
|
48
369
|
* Fixed a problem with nested URL params encoding incorrectly [dbalatero]
|
49
370
|
|
50
|
-
0.2.1
|
51
|
-
-----
|
371
|
+
## 0.2.1
|
52
372
|
* Added extended proxy support [Zapotek, GH-46]
|
53
373
|
* eliminated compile time warnings by using proper type declarations [skaes, GH-54]
|
54
374
|
* fixed broken calls to rb\_raise [skaes, GH-54]
|
@@ -60,34 +380,27 @@
|
|
60
380
|
* added abort to Hydra to prematurely stop a hydra.run [Zapotek]
|
61
381
|
* added file upload support for POST requests [jtarchie, GH-59]
|
62
382
|
|
63
|
-
0.2.0
|
64
|
-
------
|
383
|
+
## 0.2.0
|
65
384
|
* Fix warning in Request#headers from attr\_accessor
|
66
|
-
* Params with array values were not parsing into the format that rack expects
|
67
|
-
[GH-39, smartocci]
|
385
|
+
* Params with array values were not parsing into the format that rack expects [GH-39, smartocci]
|
68
386
|
* Removed Rack as a dependency [GH-45]
|
69
387
|
* Added integration hooks for VCR!
|
70
388
|
|
71
|
-
0.1.31
|
72
|
-
------
|
389
|
+
## 0.1.31
|
73
390
|
* Fixed bug in setting compression encoding [morhekil]
|
74
391
|
* Exposed authentication control methods through Request interface [morhekil]
|
75
392
|
|
76
|
-
0.1.30
|
77
|
-
-----------
|
393
|
+
## 0.1.30
|
78
394
|
* Exposed CURLOPT\_CONNECTTIMEOUT\_MS to Requests [balexis]
|
79
395
|
|
80
|
-
0.1.29
|
81
|
-
------
|
396
|
+
## 0.1.29
|
82
397
|
* Fixed a memory corruption with using CURLOPT\_POSTFIELDS [gravis,
|
83
398
|
32531d0821aecc4]
|
84
399
|
|
85
|
-
0.1.28
|
86
|
-
----------------
|
400
|
+
## 0.1.28
|
87
401
|
* Added SSL cert options for Typhoeus::Easy [GH-25, gravis]
|
88
402
|
* Ported SSL cert options to Typhoeus::Request interface [gravis]
|
89
403
|
* Added support for any HTTP method (purge for Varnish) [ryana]
|
90
404
|
|
91
|
-
0.1.27
|
92
|
-
------
|
405
|
+
## 0.1.27
|
93
406
|
* Added rack as dependency, added dev dependencies to Rakefile [GH-21]
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
We love pull requests. Here's a quick guide:
|
2
|
+
|
3
|
+
1. Fork the repo.
|
4
|
+
|
5
|
+
2. Run the tests. We only take pull requests with passing tests, and it's great
|
6
|
+
to know that you have a clean slate: `bundle && bundle exec rake`
|
7
|
+
|
8
|
+
3. Add a test for your change. Only refactoring and documentation changes
|
9
|
+
require no new tests. If you are adding functionality or fixing a bug, we need
|
10
|
+
a test!
|
11
|
+
|
12
|
+
4. Make the test pass.
|
13
|
+
|
14
|
+
5. Push to your fork and submit a pull request.
|
15
|
+
|
16
|
+
And in case we didn't emphasize it enough: we love tests!
|
17
|
+
|
18
|
+
## Issue triage [![Open Source Helpers](https://www.codetriage.com/typhoeus/typhoeus/badges/users.svg)](https://www.codetriage.com/typhoeus/typhoeus)
|
19
|
+
|
20
|
+
You can contribute by triaging issues which may include reproducing bug reports or asking for vital information, such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to typhoeus on CodeTriage](https://www.codetriage.com/typhoeus/typhoeus).
|
data/Gemfile
CHANGED
@@ -1,3 +1,32 @@
|
|
1
|
-
source
|
2
|
-
|
1
|
+
source "https://rubygems.org"
|
3
2
|
gemspec
|
3
|
+
|
4
|
+
if Gem.ruby_version < Gem::Version.new("2.0.0")
|
5
|
+
gem "rake", "< 11"
|
6
|
+
gem "json", "< 2"
|
7
|
+
else
|
8
|
+
gem "json"
|
9
|
+
gem "rake"
|
10
|
+
end
|
11
|
+
|
12
|
+
group :development, :test do
|
13
|
+
gem "rspec", "~> 3.0"
|
14
|
+
|
15
|
+
gem "sinatra", "~> 1.3"
|
16
|
+
|
17
|
+
if Gem.ruby_version >= Gem::Version.new("1.9.0")
|
18
|
+
gem "faraday", ">= 0.9"
|
19
|
+
gem "dalli", "~> 2.0"
|
20
|
+
end
|
21
|
+
|
22
|
+
gem "redis", "~> 3.0"
|
23
|
+
|
24
|
+
if RUBY_PLATFORM == "java"
|
25
|
+
gem "spoon"
|
26
|
+
end
|
27
|
+
|
28
|
+
unless ENV["CI"]
|
29
|
+
gem "guard-rspec", "~> 0.7"
|
30
|
+
gem 'rb-fsevent', '~> 0.9.1'
|
31
|
+
end
|
32
|
+
end
|
data/Guardfile
ADDED
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Copyright (c) 2009-2010 Paul Dix
|
2
2
|
Copyright (c) 2011 David Balatero
|
3
|
-
Copyright (c) 2012 Hans Hasselberg
|
3
|
+
Copyright (c) 2012-2016 Hans Hasselberg
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
6
6
|
a copy of this software and associated documentation files (the
|