typhoeus 1.4.1 → 1.5.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/CHANGELOG.md +43 -1
- data/lib/typhoeus/expectation.rb +4 -2
- data/lib/typhoeus/request/responseable.rb +1 -1
- data/lib/typhoeus/version.rb +1 -1
- data/typhoeus.gemspec +14 -4
- metadata +18 -97
- data/.github/workflows/ci.yml +0 -30
- data/.github/workflows/experimental.yml +0 -33
- data/.gitignore +0 -8
- data/.rspec +0 -4
- data/Gemfile +0 -36
- data/Guardfile +0 -9
- data/Rakefile +0 -38
- data/perf/profile.rb +0 -14
- data/perf/vs_nethttp.rb +0 -64
- data/spec/rack/typhoeus/middleware/params_decoder/helper_spec.rb +0 -156
- data/spec/rack/typhoeus/middleware/params_decoder_spec.rb +0 -31
- data/spec/spec_helper.rb +0 -29
- data/spec/support/localhost_server.rb +0 -94
- data/spec/support/memory_cache.rb +0 -15
- data/spec/support/server.rb +0 -116
- data/spec/typhoeus/adapters/faraday_spec.rb +0 -339
- data/spec/typhoeus/cache/dalli_spec.rb +0 -41
- data/spec/typhoeus/cache/redis_spec.rb +0 -41
- data/spec/typhoeus/config_spec.rb +0 -15
- data/spec/typhoeus/easy_factory_spec.rb +0 -143
- data/spec/typhoeus/errors/no_stub_spec.rb +0 -13
- data/spec/typhoeus/expectation_spec.rb +0 -280
- data/spec/typhoeus/hydra/addable_spec.rb +0 -22
- data/spec/typhoeus/hydra/before_spec.rb +0 -98
- data/spec/typhoeus/hydra/block_connection_spec.rb +0 -18
- data/spec/typhoeus/hydra/cacheable_spec.rb +0 -88
- data/spec/typhoeus/hydra/memoizable_spec.rb +0 -53
- data/spec/typhoeus/hydra/queueable_spec.rb +0 -98
- data/spec/typhoeus/hydra/runnable_spec.rb +0 -137
- data/spec/typhoeus/hydra/stubbable_spec.rb +0 -48
- data/spec/typhoeus/hydra_spec.rb +0 -22
- data/spec/typhoeus/pool_spec.rb +0 -137
- data/spec/typhoeus/request/actions_spec.rb +0 -19
- data/spec/typhoeus/request/before_spec.rb +0 -93
- data/spec/typhoeus/request/block_connection_spec.rb +0 -75
- data/spec/typhoeus/request/cacheable_spec.rb +0 -94
- data/spec/typhoeus/request/callbacks_spec.rb +0 -91
- data/spec/typhoeus/request/marshal_spec.rb +0 -60
- data/spec/typhoeus/request/memoizable_spec.rb +0 -34
- data/spec/typhoeus/request/operations_spec.rb +0 -101
- data/spec/typhoeus/request/responseable_spec.rb +0 -13
- data/spec/typhoeus/request/stubbable_spec.rb +0 -45
- data/spec/typhoeus/request_spec.rb +0 -256
- data/spec/typhoeus/response/header_spec.rb +0 -147
- data/spec/typhoeus/response/informations_spec.rb +0 -323
- data/spec/typhoeus/response/status_spec.rb +0 -256
- data/spec/typhoeus/response_spec.rb +0 -100
- data/spec/typhoeus_spec.rb +0 -105
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09cda92cc81622180d5611b30234ea35c382779dcac43716ed3acaa041f41c31'
|
4
|
+
data.tar.gz: 739ebbdbffe74d7a72e2ef2c07f85585e62bc38f9e44c3926ed0c6635797e63b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89ec1a6d9c2d8f9a1e74688507961e14d97742049df617baa3141311ef9951cb1ae9bce20d29f41ab371f97ea1022f1062a6ae07b9838fd27551513161faf0c8
|
7
|
+
data.tar.gz: aedfec09b2f08c34c279574ec34637a0f8262b1a00be8a36c18918ebf7d9ea9ed9e962fc0f8851f312f96bf588dc77830ce4636f34b43d92434c825832e1e13b
|
data/CHANGELOG.md
CHANGED
@@ -2,12 +2,54 @@
|
|
2
2
|
|
3
3
|
## Master
|
4
4
|
|
5
|
-
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.
|
5
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.5.0...master)
|
6
|
+
|
7
|
+
## 1.5.0
|
8
|
+
|
9
|
+
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.4.1...v1.5.0)
|
10
|
+
|
11
|
+
* Update gemspec with metadata and remove extra files from the bundled gem.
|
12
|
+
([Felipe Mesquita](https://github.com/felipedmesquita), [#734](https://github.com/typhoeus/typhoeus/pull/734))
|
13
|
+
* Require Ruby 2.6+ and simplify Gemfile.
|
14
|
+
([Felipe Mesquita](https://github.com/felipedmesquita), [#733](https://github.com/typhoeus/typhoeus/pull/733))
|
15
|
+
* Add support for URI objects in `Typhoeus.stub()`.
|
16
|
+
([Katelyn Schiesser](https://github.com/slowbro), [#732](https://github.com/typhoeus/typhoeus/pull/732))
|
17
|
+
* Add explicit require for logger and ostruct gems for Ruby 3.5+ compatibility.
|
18
|
+
([Felipe Mesquita](https://github.com/felipedmesquita), [#729](https://github.com/typhoeus/typhoeus/pull/729))
|
19
|
+
* Add Ruby 3.4 to CI matrix.
|
20
|
+
([y-yagi](https://github.com/y-yagi), [#728](https://github.com/typhoeus/typhoeus/pull/728))
|
21
|
+
* Support curl 8.9 error message changes in tests.
|
22
|
+
([Mamoru TASAKA](https://github.com/mtasaka), [#724](https://github.com/typhoeus/typhoeus/pull/724))
|
23
|
+
* Add Ruby 3.2 and 3.3 to CI, drop Ruby 2.5, lock ethon < 0.16.0.
|
24
|
+
([y-yagi](https://github.com/y-yagi), [#716](https://github.com/typhoeus/typhoeus/pull/716))
|
25
|
+
* Fix typo in comment: "reponse" → "response".
|
26
|
+
([George Brocklehurst](https://github.com/georgebrock), [#700](https://github.com/typhoeus/typhoeus/pull/700))
|
6
27
|
|
7
28
|
## 1.4.1
|
8
29
|
|
9
30
|
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.4.0...v1.4.1)
|
10
31
|
|
32
|
+
* Fix to run CI with Ruby 3.0.
|
33
|
+
([mishina](https://github.com/mishina2228), [#699](https://github.com/typhoeus/typhoeus/pull/699))
|
34
|
+
* Replace CI status badge from Travis to GH Actions.
|
35
|
+
([mishina](https://github.com/mishina2228), [#698](https://github.com/typhoeus/typhoeus/pull/698))
|
36
|
+
* Added getter for `redirect_url` attribute.
|
37
|
+
([Adrien Rey-Jarthon](https://github.com/jarthod), [#697](https://github.com/typhoeus/typhoeus/pull/697))
|
38
|
+
* CI: Adjust ruby versions and MacOS runs.
|
39
|
+
([Holger Arndt](https://github.com/Kjarrigan), [#696](https://github.com/typhoeus/typhoeus/pull/696))
|
40
|
+
* Allow performing `curl --upload-file`.
|
41
|
+
([Arian Faurtosh](https://github.com/arianf), [#695](https://github.com/typhoeus/typhoeus/pull/695))
|
42
|
+
* Add getter for size_upload, size_download, speed_upload, speed_download values.
|
43
|
+
([Ryo Nakano](https://github.com/ryonkn), [#692](https://github.com/typhoeus/typhoeus/pull/692))
|
44
|
+
* Use bundle add instead.
|
45
|
+
([Glauco Custodio](https://github.com/glaucocustodio), [#691](https://github.com/typhoeus/typhoeus/pull/691))
|
46
|
+
* Travis -> Github actions.
|
47
|
+
([John Mortlock](https://github.com/jmortlock), [#689](https://github.com/typhoeus/typhoeus/pull/689))
|
48
|
+
* Add global timeout and connecttimeout to config.
|
49
|
+
([Teck Wan Wong](https://github.com/teckwan), [#685](https://github.com/typhoeus/typhoeus/pull/685))
|
50
|
+
* Update README.md.
|
51
|
+
([Hussain Akram](https://github.com/hussainakram), [#677](https://github.com/typhoeus/typhoeus/pull/677))
|
52
|
+
|
11
53
|
## 1.4.0
|
12
54
|
|
13
55
|
[Full Changelog](http://github.com/typhoeus/typhoeus/compare/v1.1.2...v1.4.0)
|
data/lib/typhoeus/expectation.rb
CHANGED
@@ -204,9 +204,11 @@ module Typhoeus
|
|
204
204
|
def url_match?(request_url)
|
205
205
|
case base_url
|
206
206
|
when String
|
207
|
-
base_url == request_url
|
207
|
+
base_url == request_url.to_s
|
208
208
|
when Regexp
|
209
|
-
base_url === request_url
|
209
|
+
base_url === request_url.to_s
|
210
|
+
when defined?(URI) && URI
|
211
|
+
base_url.to_s == request_url.to_s
|
210
212
|
when nil
|
211
213
|
true
|
212
214
|
else
|
data/lib/typhoeus/version.rb
CHANGED
data/typhoeus.gemspec
CHANGED
@@ -14,12 +14,22 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.summary = "Parallel HTTP library on top of libcurl multi."
|
15
15
|
s.description = %q{Like a modern code version of the mythical beast with 100 serpent heads, Typhoeus runs HTTP requests in parallel while cleanly encapsulating handling logic.}
|
16
16
|
|
17
|
-
s.
|
17
|
+
s.required_ruby_version = ">= 2.6"
|
18
18
|
s.license = 'MIT'
|
19
|
+
s.metadata = {
|
20
|
+
'bug_tracker_uri' => 'https://github.com/typhoeus/typhoeus/issues',
|
21
|
+
'changelog_uri' => "https://github.com/typhoeus/typhoeus/blob/v#{s.version}/CHANGELOG.md",
|
22
|
+
'documentation_uri' => "https://www.rubydoc.info/gems/typhoeus/#{s.version}",
|
23
|
+
'rubygems_mfa_required' => 'true',
|
24
|
+
'source_code_uri' => "https://github.com/typhoeus/typhoeus/tree/v#{s.version}"
|
25
|
+
}
|
19
26
|
|
20
|
-
s.add_dependency('ethon', [">= 0.9.0"])
|
27
|
+
s.add_dependency('ethon', [">= 0.9.0", "< 0.16.0"])
|
21
28
|
|
22
|
-
s.files
|
23
|
-
|
29
|
+
s.files = Dir.chdir(__dir__) do
|
30
|
+
`git ls-files -z`.split("\x0").reject do |file|
|
31
|
+
file.start_with?(*%w[. Gemfile Guardfile Rakefile perf spec])
|
32
|
+
end
|
33
|
+
end
|
24
34
|
s.require_path = 'lib'
|
25
35
|
end
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typhoeus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Balatero
|
8
8
|
- Paul Dix
|
9
9
|
- Hans Hasselberg
|
10
|
-
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: ethon
|
@@ -19,6 +18,9 @@ dependencies:
|
|
19
18
|
- - ">="
|
20
19
|
- !ruby/object:Gem::Version
|
21
20
|
version: 0.9.0
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.16.0
|
22
24
|
type: :runtime
|
23
25
|
prerelease: false
|
24
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,6 +28,9 @@ dependencies:
|
|
26
28
|
- - ">="
|
27
29
|
- !ruby/object:Gem::Version
|
28
30
|
version: 0.9.0
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.16.0
|
29
34
|
description: Like a modern code version of the mythical beast with 100 serpent heads,
|
30
35
|
Typhoeus runs HTTP requests in parallel while cleanly encapsulating handling logic.
|
31
36
|
email:
|
@@ -34,17 +39,10 @@ executables: []
|
|
34
39
|
extensions: []
|
35
40
|
extra_rdoc_files: []
|
36
41
|
files:
|
37
|
-
- ".github/workflows/ci.yml"
|
38
|
-
- ".github/workflows/experimental.yml"
|
39
|
-
- ".gitignore"
|
40
|
-
- ".rspec"
|
41
42
|
- CHANGELOG.md
|
42
43
|
- CONTRIBUTING.md
|
43
|
-
- Gemfile
|
44
|
-
- Guardfile
|
45
44
|
- LICENSE
|
46
45
|
- README.md
|
47
|
-
- Rakefile
|
48
46
|
- UPGRADE.md
|
49
47
|
- lib/rack/typhoeus.rb
|
50
48
|
- lib/rack/typhoeus/middleware/params_decoder.rb
|
@@ -89,53 +87,16 @@ files:
|
|
89
87
|
- lib/typhoeus/response/informations.rb
|
90
88
|
- lib/typhoeus/response/status.rb
|
91
89
|
- lib/typhoeus/version.rb
|
92
|
-
- perf/profile.rb
|
93
|
-
- perf/vs_nethttp.rb
|
94
|
-
- spec/rack/typhoeus/middleware/params_decoder/helper_spec.rb
|
95
|
-
- spec/rack/typhoeus/middleware/params_decoder_spec.rb
|
96
|
-
- spec/spec_helper.rb
|
97
|
-
- spec/support/localhost_server.rb
|
98
|
-
- spec/support/memory_cache.rb
|
99
|
-
- spec/support/server.rb
|
100
|
-
- spec/typhoeus/adapters/faraday_spec.rb
|
101
|
-
- spec/typhoeus/cache/dalli_spec.rb
|
102
|
-
- spec/typhoeus/cache/redis_spec.rb
|
103
|
-
- spec/typhoeus/config_spec.rb
|
104
|
-
- spec/typhoeus/easy_factory_spec.rb
|
105
|
-
- spec/typhoeus/errors/no_stub_spec.rb
|
106
|
-
- spec/typhoeus/expectation_spec.rb
|
107
|
-
- spec/typhoeus/hydra/addable_spec.rb
|
108
|
-
- spec/typhoeus/hydra/before_spec.rb
|
109
|
-
- spec/typhoeus/hydra/block_connection_spec.rb
|
110
|
-
- spec/typhoeus/hydra/cacheable_spec.rb
|
111
|
-
- spec/typhoeus/hydra/memoizable_spec.rb
|
112
|
-
- spec/typhoeus/hydra/queueable_spec.rb
|
113
|
-
- spec/typhoeus/hydra/runnable_spec.rb
|
114
|
-
- spec/typhoeus/hydra/stubbable_spec.rb
|
115
|
-
- spec/typhoeus/hydra_spec.rb
|
116
|
-
- spec/typhoeus/pool_spec.rb
|
117
|
-
- spec/typhoeus/request/actions_spec.rb
|
118
|
-
- spec/typhoeus/request/before_spec.rb
|
119
|
-
- spec/typhoeus/request/block_connection_spec.rb
|
120
|
-
- spec/typhoeus/request/cacheable_spec.rb
|
121
|
-
- spec/typhoeus/request/callbacks_spec.rb
|
122
|
-
- spec/typhoeus/request/marshal_spec.rb
|
123
|
-
- spec/typhoeus/request/memoizable_spec.rb
|
124
|
-
- spec/typhoeus/request/operations_spec.rb
|
125
|
-
- spec/typhoeus/request/responseable_spec.rb
|
126
|
-
- spec/typhoeus/request/stubbable_spec.rb
|
127
|
-
- spec/typhoeus/request_spec.rb
|
128
|
-
- spec/typhoeus/response/header_spec.rb
|
129
|
-
- spec/typhoeus/response/informations_spec.rb
|
130
|
-
- spec/typhoeus/response/status_spec.rb
|
131
|
-
- spec/typhoeus/response_spec.rb
|
132
|
-
- spec/typhoeus_spec.rb
|
133
90
|
- typhoeus.gemspec
|
134
91
|
homepage: https://github.com/typhoeus/typhoeus
|
135
92
|
licenses:
|
136
93
|
- MIT
|
137
|
-
metadata:
|
138
|
-
|
94
|
+
metadata:
|
95
|
+
bug_tracker_uri: https://github.com/typhoeus/typhoeus/issues
|
96
|
+
changelog_uri: https://github.com/typhoeus/typhoeus/blob/v1.5.0/CHANGELOG.md
|
97
|
+
documentation_uri: https://www.rubydoc.info/gems/typhoeus/1.5.0
|
98
|
+
rubygems_mfa_required: 'true'
|
99
|
+
source_code_uri: https://github.com/typhoeus/typhoeus/tree/v1.5.0
|
139
100
|
rdoc_options: []
|
140
101
|
require_paths:
|
141
102
|
- lib
|
@@ -143,54 +104,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
104
|
requirements:
|
144
105
|
- - ">="
|
145
106
|
- !ruby/object:Gem::Version
|
146
|
-
version: '
|
107
|
+
version: '2.6'
|
147
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
109
|
requirements:
|
149
110
|
- - ">="
|
150
111
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
112
|
+
version: '0'
|
152
113
|
requirements: []
|
153
|
-
rubygems_version: 3.
|
154
|
-
signing_key:
|
114
|
+
rubygems_version: 3.7.1
|
155
115
|
specification_version: 4
|
156
116
|
summary: Parallel HTTP library on top of libcurl multi.
|
157
|
-
test_files:
|
158
|
-
- spec/rack/typhoeus/middleware/params_decoder/helper_spec.rb
|
159
|
-
- spec/rack/typhoeus/middleware/params_decoder_spec.rb
|
160
|
-
- spec/spec_helper.rb
|
161
|
-
- spec/support/localhost_server.rb
|
162
|
-
- spec/support/memory_cache.rb
|
163
|
-
- spec/support/server.rb
|
164
|
-
- spec/typhoeus/adapters/faraday_spec.rb
|
165
|
-
- spec/typhoeus/cache/dalli_spec.rb
|
166
|
-
- spec/typhoeus/cache/redis_spec.rb
|
167
|
-
- spec/typhoeus/config_spec.rb
|
168
|
-
- spec/typhoeus/easy_factory_spec.rb
|
169
|
-
- spec/typhoeus/errors/no_stub_spec.rb
|
170
|
-
- spec/typhoeus/expectation_spec.rb
|
171
|
-
- spec/typhoeus/hydra/addable_spec.rb
|
172
|
-
- spec/typhoeus/hydra/before_spec.rb
|
173
|
-
- spec/typhoeus/hydra/block_connection_spec.rb
|
174
|
-
- spec/typhoeus/hydra/cacheable_spec.rb
|
175
|
-
- spec/typhoeus/hydra/memoizable_spec.rb
|
176
|
-
- spec/typhoeus/hydra/queueable_spec.rb
|
177
|
-
- spec/typhoeus/hydra/runnable_spec.rb
|
178
|
-
- spec/typhoeus/hydra/stubbable_spec.rb
|
179
|
-
- spec/typhoeus/hydra_spec.rb
|
180
|
-
- spec/typhoeus/pool_spec.rb
|
181
|
-
- spec/typhoeus/request/actions_spec.rb
|
182
|
-
- spec/typhoeus/request/before_spec.rb
|
183
|
-
- spec/typhoeus/request/block_connection_spec.rb
|
184
|
-
- spec/typhoeus/request/cacheable_spec.rb
|
185
|
-
- spec/typhoeus/request/callbacks_spec.rb
|
186
|
-
- spec/typhoeus/request/marshal_spec.rb
|
187
|
-
- spec/typhoeus/request/memoizable_spec.rb
|
188
|
-
- spec/typhoeus/request/operations_spec.rb
|
189
|
-
- spec/typhoeus/request/responseable_spec.rb
|
190
|
-
- spec/typhoeus/request/stubbable_spec.rb
|
191
|
-
- spec/typhoeus/request_spec.rb
|
192
|
-
- spec/typhoeus/response/header_spec.rb
|
193
|
-
- spec/typhoeus/response/informations_spec.rb
|
194
|
-
- spec/typhoeus/response/status_spec.rb
|
195
|
-
- spec/typhoeus/response_spec.rb
|
196
|
-
- spec/typhoeus_spec.rb
|
117
|
+
test_files: []
|
data/.github/workflows/ci.yml
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
name: CI
|
2
|
-
on: [push, pull_request]
|
3
|
-
jobs:
|
4
|
-
build:
|
5
|
-
env:
|
6
|
-
BUNDLE_GEMFILE: Gemfile
|
7
|
-
runs-on: ${{ matrix.os }}-latest
|
8
|
-
strategy:
|
9
|
-
fail-fast: false
|
10
|
-
matrix:
|
11
|
-
os: [ubuntu, macos]
|
12
|
-
ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1', truffleruby]
|
13
|
-
steps:
|
14
|
-
- uses: actions/checkout@v3
|
15
|
-
- name: Install libcurl header
|
16
|
-
run: |
|
17
|
-
if ${{ matrix.os == 'macos' }}
|
18
|
-
then
|
19
|
-
brew install curl
|
20
|
-
else
|
21
|
-
sudo apt update && sudo apt install -y --no-install-recommends libcurl4-openssl-dev
|
22
|
-
fi
|
23
|
-
- name: Set up Ruby ${{ matrix.ruby-version }}
|
24
|
-
uses: ruby/setup-ruby@v1
|
25
|
-
with:
|
26
|
-
ruby-version: ${{ matrix.ruby-version }}
|
27
|
-
bundler-cache: true
|
28
|
-
- name: Run tests
|
29
|
-
run: |
|
30
|
-
bundle exec rake
|
@@ -1,33 +0,0 @@
|
|
1
|
-
name: Experimental
|
2
|
-
on: [push, pull_request]
|
3
|
-
jobs:
|
4
|
-
build:
|
5
|
-
env:
|
6
|
-
BUNDLE_GEMFILE: Gemfile
|
7
|
-
runs-on: ${{ matrix.os }}-latest
|
8
|
-
strategy:
|
9
|
-
fail-fast: false
|
10
|
-
matrix:
|
11
|
-
os: [ubuntu, macos]
|
12
|
-
ruby-version:
|
13
|
-
- ruby-head
|
14
|
-
- jruby-head
|
15
|
-
- truffleruby-head
|
16
|
-
steps:
|
17
|
-
- uses: actions/checkout@v3
|
18
|
-
- name: Install libcurl header
|
19
|
-
run: |
|
20
|
-
if ${{ matrix.os == 'macos' }}
|
21
|
-
then
|
22
|
-
brew install curl
|
23
|
-
else
|
24
|
-
sudo apt update && sudo apt install -y --no-install-recommends libcurl4-openssl-dev
|
25
|
-
fi
|
26
|
-
- name: Set up Ruby ${{ matrix.ruby-version }}
|
27
|
-
uses: ruby/setup-ruby@v1
|
28
|
-
with:
|
29
|
-
ruby-version: ${{ matrix.ruby-version }}
|
30
|
-
bundler-cache: true
|
31
|
-
- name: Run tests
|
32
|
-
run: |
|
33
|
-
bundle exec rake
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/Gemfile
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
source "https://rubygems.org"
|
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", "< 2.0"
|
19
|
-
gem "dalli", "~> 2.0"
|
20
|
-
end
|
21
|
-
|
22
|
-
if Gem.ruby_version >= Gem::Version.new("3.0.0")
|
23
|
-
gem 'webrick'
|
24
|
-
end
|
25
|
-
|
26
|
-
gem "redis", "~> 3.0"
|
27
|
-
|
28
|
-
if RUBY_PLATFORM == "java"
|
29
|
-
gem "spoon"
|
30
|
-
end
|
31
|
-
|
32
|
-
unless ENV["CI"]
|
33
|
-
gem "guard-rspec", "~> 0.7"
|
34
|
-
gem 'rb-fsevent', '~> 0.9.1'
|
35
|
-
end
|
36
|
-
end
|
data/Guardfile
DELETED
data/Rakefile
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require "bundler"
|
2
|
-
Bundler.setup
|
3
|
-
|
4
|
-
require "rake"
|
5
|
-
require "rspec/core/rake_task"
|
6
|
-
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
7
|
-
require "typhoeus/version"
|
8
|
-
|
9
|
-
task :gem => :build
|
10
|
-
task :build do
|
11
|
-
system "gem build typhoeus.gemspec"
|
12
|
-
end
|
13
|
-
|
14
|
-
task :install => :build do
|
15
|
-
system "gem install typhoeus-#{Typhoeus::VERSION}.gem"
|
16
|
-
end
|
17
|
-
|
18
|
-
task :release => :build do
|
19
|
-
system "git tag -a v#{Typhoeus::VERSION} -m 'Tagging #{Typhoeus::VERSION}'"
|
20
|
-
system "git push --tags"
|
21
|
-
system "gem push typhoeus-#{Typhoeus::VERSION}.gem"
|
22
|
-
end
|
23
|
-
|
24
|
-
RSpec::Core::RakeTask.new(:spec) do |t|
|
25
|
-
t.verbose = false
|
26
|
-
t.ruby_opts = "-W -I./spec -rspec_helper"
|
27
|
-
end
|
28
|
-
|
29
|
-
desc "Start up the test servers"
|
30
|
-
task :start do
|
31
|
-
require_relative 'spec/support/boot'
|
32
|
-
begin
|
33
|
-
Boot.start_servers(:rake)
|
34
|
-
rescue Exception
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
task :default => :spec
|
data/perf/profile.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'typhoeus'
|
2
|
-
require 'ruby-prof'
|
3
|
-
|
4
|
-
calls = 50
|
5
|
-
base_url = "http://127.0.0.1:3000/"
|
6
|
-
|
7
|
-
RubyProf.start
|
8
|
-
calls.times do |i|
|
9
|
-
Typhoeus::Request.get(base_url+i.to_s)
|
10
|
-
end
|
11
|
-
result = RubyProf.stop
|
12
|
-
|
13
|
-
printer = RubyProf::FlatPrinter.new(result)
|
14
|
-
printer.print(STDOUT)
|
data/perf/vs_nethttp.rb
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
require 'typhoeus'
|
2
|
-
require 'net/http'
|
3
|
-
require 'open-uri'
|
4
|
-
require 'benchmark'
|
5
|
-
|
6
|
-
URL = "http://localhost:300"
|
7
|
-
hydra = Typhoeus::Hydra.new(max_concurrency: 3)
|
8
|
-
|
9
|
-
if defined? require_relative
|
10
|
-
require_relative '../spec/support/localhost_server.rb'
|
11
|
-
require_relative '../spec/support/server.rb'
|
12
|
-
else
|
13
|
-
require '../spec/support/localhost_server.rb'
|
14
|
-
require '../spec/support/server.rb'
|
15
|
-
end
|
16
|
-
LocalhostServer.new(TESTSERVER.new, 3000)
|
17
|
-
LocalhostServer.new(TESTSERVER.new, 3001)
|
18
|
-
LocalhostServer.new(TESTSERVER.new, 3002)
|
19
|
-
|
20
|
-
def url_for(i)
|
21
|
-
"#{URL}#{i%3}/"
|
22
|
-
end
|
23
|
-
|
24
|
-
Benchmark.bm do |bm|
|
25
|
-
|
26
|
-
[1000].each do |calls|
|
27
|
-
puts "[ #{calls} requests ]"
|
28
|
-
|
29
|
-
bm.report("net/http ") do
|
30
|
-
calls.times do |i|
|
31
|
-
uri = URI.parse(url_for(i))
|
32
|
-
Net::HTTP.get_response(uri)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
bm.report("open ") do
|
37
|
-
calls.times do |i|
|
38
|
-
open(url_for(i))
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
bm.report("request ") do
|
43
|
-
calls.times do |i|
|
44
|
-
Typhoeus::Request.get(url_for(i))
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
bm.report("hydra ") do
|
49
|
-
calls.times do |i|
|
50
|
-
hydra.queue(Typhoeus::Request.new(url_for(i)))
|
51
|
-
end
|
52
|
-
hydra.run
|
53
|
-
end
|
54
|
-
|
55
|
-
bm.report("hydra memoize ") do
|
56
|
-
Typhoeus::Config.memoize = true
|
57
|
-
calls.times do |i|
|
58
|
-
hydra.queue(Typhoeus::Request.new(url_for(i)))
|
59
|
-
end
|
60
|
-
hydra.run
|
61
|
-
Typhoeus::Config.memoize = false
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|