ethon 0.9.1 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ruby.yml +41 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +20 -1
- data/Gemfile +14 -4
- data/Guardfile +1 -0
- data/README.md +4 -1
- data/Rakefile +1 -0
- data/ethon.gemspec +2 -1
- data/lib/ethon.rb +2 -0
- data/lib/ethon/curl.rb +1 -0
- data/lib/ethon/curls/classes.rb +2 -1
- data/lib/ethon/curls/codes.rb +1 -1
- data/lib/ethon/curls/constants.rb +1 -0
- data/lib/ethon/curls/form_options.rb +1 -0
- data/lib/ethon/curls/functions.rb +4 -12
- data/lib/ethon/curls/infos.rb +4 -3
- data/lib/ethon/curls/messages.rb +1 -0
- data/lib/ethon/curls/options.rb +35 -23
- data/lib/ethon/curls/settings.rb +2 -0
- data/lib/ethon/easy.rb +3 -1
- data/lib/ethon/easy/callbacks.rb +25 -3
- data/lib/ethon/easy/debug_info.rb +1 -0
- data/lib/ethon/easy/features.rb +1 -0
- data/lib/ethon/easy/form.rb +7 -4
- data/lib/ethon/easy/header.rb +1 -0
- data/lib/ethon/easy/http.rb +1 -0
- data/lib/ethon/easy/http/actionable.rb +2 -1
- data/lib/ethon/easy/http/custom.rb +1 -0
- data/lib/ethon/easy/http/delete.rb +1 -0
- data/lib/ethon/easy/http/get.rb +1 -0
- data/lib/ethon/easy/http/head.rb +1 -0
- data/lib/ethon/easy/http/options.rb +1 -0
- data/lib/ethon/easy/http/patch.rb +1 -0
- data/lib/ethon/easy/http/post.rb +1 -0
- data/lib/ethon/easy/http/postable.rb +1 -0
- data/lib/ethon/easy/http/put.rb +1 -0
- data/lib/ethon/easy/http/putable.rb +1 -0
- data/lib/ethon/easy/informations.rb +1 -0
- data/lib/ethon/easy/mirror.rb +1 -0
- data/lib/ethon/easy/operations.rb +16 -1
- data/lib/ethon/easy/options.rb +11 -2
- data/lib/ethon/easy/params.rb +1 -0
- data/lib/ethon/easy/queryable.rb +4 -1
- data/lib/ethon/easy/response_callbacks.rb +27 -0
- data/lib/ethon/easy/util.rb +1 -0
- data/lib/ethon/errors.rb +1 -0
- data/lib/ethon/errors/ethon_error.rb +1 -0
- data/lib/ethon/errors/global_init.rb +1 -0
- data/lib/ethon/errors/invalid_option.rb +1 -0
- data/lib/ethon/errors/invalid_value.rb +1 -0
- data/lib/ethon/errors/multi_add.rb +1 -0
- data/lib/ethon/errors/multi_fdset.rb +1 -0
- data/lib/ethon/errors/multi_remove.rb +1 -0
- data/lib/ethon/errors/multi_timeout.rb +1 -0
- data/lib/ethon/errors/select.rb +1 -0
- data/lib/ethon/libc.rb +16 -1
- data/lib/ethon/loggable.rb +1 -0
- data/lib/ethon/multi.rb +1 -0
- data/lib/ethon/multi/operations.rb +1 -0
- data/lib/ethon/multi/options.rb +2 -1
- data/lib/ethon/multi/stack.rb +1 -0
- data/lib/ethon/version.rb +2 -1
- data/profile/benchmarks.rb +1 -0
- data/profile/memory_leaks.rb +1 -0
- data/profile/perf_spec_helper.rb +1 -0
- data/profile/support/memory_test_helpers.rb +1 -0
- data/profile/support/os_memory_leak_tracker.rb +1 -0
- data/profile/support/ruby_object_leak_tracker.rb +1 -0
- data/spec/ethon/curl_spec.rb +1 -0
- data/spec/ethon/easy/callbacks_spec.rb +8 -1
- data/spec/ethon/easy/debug_info_spec.rb +2 -0
- data/spec/ethon/easy/features_spec.rb +1 -0
- data/spec/ethon/easy/form_spec.rb +28 -0
- data/spec/ethon/easy/header_spec.rb +1 -0
- data/spec/ethon/easy/http/custom_spec.rb +1 -0
- data/spec/ethon/easy/http/delete_spec.rb +1 -0
- data/spec/ethon/easy/http/get_spec.rb +1 -0
- data/spec/ethon/easy/http/head_spec.rb +1 -0
- data/spec/ethon/easy/http/options_spec.rb +1 -0
- data/spec/ethon/easy/http/patch_spec.rb +1 -0
- data/spec/ethon/easy/http/post_spec.rb +1 -0
- data/spec/ethon/easy/http/put_spec.rb +1 -0
- data/spec/ethon/easy/http_spec.rb +1 -0
- data/spec/ethon/easy/informations_spec.rb +1 -0
- data/spec/ethon/easy/mirror_spec.rb +1 -0
- data/spec/ethon/easy/operations_spec.rb +1 -0
- data/spec/ethon/easy/options_spec.rb +31 -1
- data/spec/ethon/easy/queryable_spec.rb +14 -3
- data/spec/ethon/easy/response_callbacks_spec.rb +58 -1
- data/spec/ethon/easy/util_spec.rb +1 -0
- data/spec/ethon/easy_spec.rb +8 -2
- data/spec/ethon/libc_spec.rb +4 -3
- data/spec/ethon/loggable_spec.rb +1 -0
- data/spec/ethon/multi/operations_spec.rb +1 -0
- data/spec/ethon/multi/options_spec.rb +1 -0
- data/spec/ethon/multi/stack_spec.rb +1 -0
- data/spec/ethon/multi_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/localhost_server.rb +2 -1
- data/spec/support/server.rb +1 -0
- metadata +6 -7
- data/.travis.yml +0 -27
data/spec/ethon/easy_spec.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'spec_helper'
|
2
3
|
|
3
4
|
describe Ethon::Easy do
|
@@ -105,8 +106,9 @@ describe Ethon::Easy do
|
|
105
106
|
easy.url = "http://localhost:3001/"
|
106
107
|
easy.on_complete { 'on_complete' }
|
107
108
|
easy.on_headers { 'on_headers' }
|
108
|
-
easy.
|
109
|
-
easy.
|
109
|
+
easy.on_progress { 'on_progress' }
|
110
|
+
easy.response_body = String.new('test_body')
|
111
|
+
easy.response_headers = String.new('test_headers')
|
110
112
|
easy
|
111
113
|
end
|
112
114
|
let!(:e) { easy.dup }
|
@@ -132,6 +134,10 @@ describe Ethon::Easy do
|
|
132
134
|
expect { easy.perform }.not_to change { e.response_body }
|
133
135
|
end
|
134
136
|
|
137
|
+
it "preserves on_progress callback" do
|
138
|
+
expect(e.on_progress).to be(easy.on_progress)
|
139
|
+
end
|
140
|
+
|
135
141
|
it 'sets new body_write_callback of duplicated handle' do
|
136
142
|
expect { e.perform }.to change { e.response_body }
|
137
143
|
expect { e.perform }.not_to change { easy.response_body }
|
data/spec/ethon/libc_spec.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'spec_helper'
|
2
3
|
|
3
4
|
describe Ethon::Libc do
|
4
|
-
describe "#
|
5
|
+
describe "#sysconf(:open_max)", :if => !Ethon::Curl.windows? do
|
5
6
|
it "returns an integer" do
|
6
|
-
expect(Ethon::Libc.
|
7
|
+
expect(Ethon::Libc.sysconf(:open_max)).to be_a(Integer)
|
7
8
|
end
|
8
9
|
|
9
10
|
it "returns bigger zero", :if => !Ethon::Curl.windows? do
|
10
|
-
expect(Ethon::Libc.
|
11
|
+
expect(Ethon::Libc.sysconf(:open_max)).to_not be_zero
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|
data/spec/ethon/loggable_spec.rb
CHANGED
data/spec/ethon/multi_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'rack'
|
2
3
|
require 'rack/handler/webrick'
|
3
4
|
require 'net/http'
|
@@ -43,7 +44,7 @@ class LocalhostServer
|
|
43
44
|
# Use WEBrick since it's part of the ruby standard library and is available on all ruby interpreters.
|
44
45
|
options = { :Port => port }
|
45
46
|
options.merge!(:AccessLog => [], :Logger => WEBrick::BasicLog.new(StringIO.new)) unless ENV['VERBOSE_SERVER']
|
46
|
-
Rack::Handler::WEBrick.run(Identify.new(@rack_app), options)
|
47
|
+
Rack::Handler::WEBrick.run(Identify.new(@rack_app), **options)
|
47
48
|
end
|
48
49
|
|
49
50
|
def booted?
|
data/spec/support/server.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ethon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hans Hasselberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.15.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.15.0
|
27
27
|
description: Very lightweight libcurl wrapper.
|
28
28
|
email:
|
29
29
|
- me@hans.io
|
@@ -31,9 +31,9 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
+
- ".github/workflows/ruby.yml"
|
34
35
|
- ".gitignore"
|
35
36
|
- ".rspec"
|
36
|
-
- ".travis.yml"
|
37
37
|
- CHANGELOG.md
|
38
38
|
- Gemfile
|
39
39
|
- Guardfile
|
@@ -152,8 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: 1.3.6
|
154
154
|
requirements: []
|
155
|
-
|
156
|
-
rubygems_version: 2.2.2
|
155
|
+
rubygems_version: 3.0.3
|
157
156
|
signing_key:
|
158
157
|
specification_version: 4
|
159
158
|
summary: Libcurl wrapper.
|
data/.travis.yml
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
sudo: false
|
4
|
-
|
5
|
-
bundler_args: --without perf
|
6
|
-
script: bundle exec rake
|
7
|
-
|
8
|
-
rvm:
|
9
|
-
- 1.8.7
|
10
|
-
- 1.9.2
|
11
|
-
- 1.9.3
|
12
|
-
- 2.0.0-p648
|
13
|
-
- 2.1.8
|
14
|
-
- 2.2.4
|
15
|
-
- 2.3.0
|
16
|
-
- ruby-head
|
17
|
-
- ree
|
18
|
-
- jruby-18mode
|
19
|
-
- jruby-19mode
|
20
|
-
- jruby-head
|
21
|
-
- rbx-2
|
22
|
-
|
23
|
-
matrix:
|
24
|
-
allow_failures:
|
25
|
-
- rvm: ree
|
26
|
-
- rvm: ruby-head
|
27
|
-
- rvm: jruby-head
|