ethon 0.9.1 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ruby.yml +41 -0
  3. data/.gitignore +1 -0
  4. data/CHANGELOG.md +20 -1
  5. data/Gemfile +14 -4
  6. data/Guardfile +1 -0
  7. data/README.md +4 -1
  8. data/Rakefile +1 -0
  9. data/ethon.gemspec +2 -1
  10. data/lib/ethon.rb +2 -0
  11. data/lib/ethon/curl.rb +1 -0
  12. data/lib/ethon/curls/classes.rb +2 -1
  13. data/lib/ethon/curls/codes.rb +1 -1
  14. data/lib/ethon/curls/constants.rb +1 -0
  15. data/lib/ethon/curls/form_options.rb +1 -0
  16. data/lib/ethon/curls/functions.rb +4 -12
  17. data/lib/ethon/curls/infos.rb +4 -3
  18. data/lib/ethon/curls/messages.rb +1 -0
  19. data/lib/ethon/curls/options.rb +35 -23
  20. data/lib/ethon/curls/settings.rb +2 -0
  21. data/lib/ethon/easy.rb +3 -1
  22. data/lib/ethon/easy/callbacks.rb +25 -3
  23. data/lib/ethon/easy/debug_info.rb +1 -0
  24. data/lib/ethon/easy/features.rb +1 -0
  25. data/lib/ethon/easy/form.rb +7 -4
  26. data/lib/ethon/easy/header.rb +1 -0
  27. data/lib/ethon/easy/http.rb +1 -0
  28. data/lib/ethon/easy/http/actionable.rb +2 -1
  29. data/lib/ethon/easy/http/custom.rb +1 -0
  30. data/lib/ethon/easy/http/delete.rb +1 -0
  31. data/lib/ethon/easy/http/get.rb +1 -0
  32. data/lib/ethon/easy/http/head.rb +1 -0
  33. data/lib/ethon/easy/http/options.rb +1 -0
  34. data/lib/ethon/easy/http/patch.rb +1 -0
  35. data/lib/ethon/easy/http/post.rb +1 -0
  36. data/lib/ethon/easy/http/postable.rb +1 -0
  37. data/lib/ethon/easy/http/put.rb +1 -0
  38. data/lib/ethon/easy/http/putable.rb +1 -0
  39. data/lib/ethon/easy/informations.rb +1 -0
  40. data/lib/ethon/easy/mirror.rb +1 -0
  41. data/lib/ethon/easy/operations.rb +16 -1
  42. data/lib/ethon/easy/options.rb +11 -2
  43. data/lib/ethon/easy/params.rb +1 -0
  44. data/lib/ethon/easy/queryable.rb +4 -1
  45. data/lib/ethon/easy/response_callbacks.rb +27 -0
  46. data/lib/ethon/easy/util.rb +1 -0
  47. data/lib/ethon/errors.rb +1 -0
  48. data/lib/ethon/errors/ethon_error.rb +1 -0
  49. data/lib/ethon/errors/global_init.rb +1 -0
  50. data/lib/ethon/errors/invalid_option.rb +1 -0
  51. data/lib/ethon/errors/invalid_value.rb +1 -0
  52. data/lib/ethon/errors/multi_add.rb +1 -0
  53. data/lib/ethon/errors/multi_fdset.rb +1 -0
  54. data/lib/ethon/errors/multi_remove.rb +1 -0
  55. data/lib/ethon/errors/multi_timeout.rb +1 -0
  56. data/lib/ethon/errors/select.rb +1 -0
  57. data/lib/ethon/libc.rb +16 -1
  58. data/lib/ethon/loggable.rb +1 -0
  59. data/lib/ethon/multi.rb +1 -0
  60. data/lib/ethon/multi/operations.rb +1 -0
  61. data/lib/ethon/multi/options.rb +2 -1
  62. data/lib/ethon/multi/stack.rb +1 -0
  63. data/lib/ethon/version.rb +2 -1
  64. data/profile/benchmarks.rb +1 -0
  65. data/profile/memory_leaks.rb +1 -0
  66. data/profile/perf_spec_helper.rb +1 -0
  67. data/profile/support/memory_test_helpers.rb +1 -0
  68. data/profile/support/os_memory_leak_tracker.rb +1 -0
  69. data/profile/support/ruby_object_leak_tracker.rb +1 -0
  70. data/spec/ethon/curl_spec.rb +1 -0
  71. data/spec/ethon/easy/callbacks_spec.rb +8 -1
  72. data/spec/ethon/easy/debug_info_spec.rb +2 -0
  73. data/spec/ethon/easy/features_spec.rb +1 -0
  74. data/spec/ethon/easy/form_spec.rb +28 -0
  75. data/spec/ethon/easy/header_spec.rb +1 -0
  76. data/spec/ethon/easy/http/custom_spec.rb +1 -0
  77. data/spec/ethon/easy/http/delete_spec.rb +1 -0
  78. data/spec/ethon/easy/http/get_spec.rb +1 -0
  79. data/spec/ethon/easy/http/head_spec.rb +1 -0
  80. data/spec/ethon/easy/http/options_spec.rb +1 -0
  81. data/spec/ethon/easy/http/patch_spec.rb +1 -0
  82. data/spec/ethon/easy/http/post_spec.rb +1 -0
  83. data/spec/ethon/easy/http/put_spec.rb +1 -0
  84. data/spec/ethon/easy/http_spec.rb +1 -0
  85. data/spec/ethon/easy/informations_spec.rb +1 -0
  86. data/spec/ethon/easy/mirror_spec.rb +1 -0
  87. data/spec/ethon/easy/operations_spec.rb +1 -0
  88. data/spec/ethon/easy/options_spec.rb +31 -1
  89. data/spec/ethon/easy/queryable_spec.rb +14 -3
  90. data/spec/ethon/easy/response_callbacks_spec.rb +58 -1
  91. data/spec/ethon/easy/util_spec.rb +1 -0
  92. data/spec/ethon/easy_spec.rb +8 -2
  93. data/spec/ethon/libc_spec.rb +4 -3
  94. data/spec/ethon/loggable_spec.rb +1 -0
  95. data/spec/ethon/multi/operations_spec.rb +1 -0
  96. data/spec/ethon/multi/options_spec.rb +1 -0
  97. data/spec/ethon/multi/stack_spec.rb +1 -0
  98. data/spec/ethon/multi_spec.rb +1 -0
  99. data/spec/spec_helper.rb +1 -0
  100. data/spec/support/localhost_server.rb +2 -1
  101. data/spec/support/server.rb +1 -0
  102. metadata +6 -7
  103. data/.travis.yml +0 -27
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Ethon::Easy::Util do
@@ -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.response_body = 'test_body'
109
- easy.response_headers = 'test_headers'
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 }
@@ -1,13 +1,14 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Ethon::Libc do
4
- describe "#getdtablesize", :if => !Ethon::Curl.windows? do
5
+ describe "#sysconf(:open_max)", :if => !Ethon::Curl.windows? do
5
6
  it "returns an integer" do
6
- expect(Ethon::Libc.getdtablesize).to be_a(Integer)
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.getdtablesize).to_not be_zero
11
+ expect(Ethon::Libc.sysconf(:open_max)).to_not be_zero
11
12
  end
12
13
  end
13
14
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require "spec_helper"
2
3
 
3
4
  describe Ethon::Loggable do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Ethon::Multi::Operations do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Ethon::Multi::Options do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Ethon::Multi::Stack do
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Ethon::Multi do
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
3
4
 
@@ -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?
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
  require 'json'
3
4
  require 'zlib'
4
5
  require 'sinatra/base'
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.9.1
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: 2016-09-20 00:00:00.000000000 Z
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.3.0
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.3.0
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
- rubyforge_project:
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