httpi 3.0.2 → 4.0.4

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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -1
  3. data/README.md +13 -2
  4. data/UPDATING.md +4 -0
  5. data/lib/httpi/request.rb +2 -2
  6. data/lib/httpi/response.rb +1 -1
  7. data/lib/httpi/utils.rb +95 -0
  8. data/lib/httpi/version.rb +1 -1
  9. data/lib/httpi.rb +1 -0
  10. metadata +16 -57
  11. data/.devcontainer/devcontainer.json +0 -22
  12. data/.github/workflows/development.yml +0 -49
  13. data/.gitignore +0 -11
  14. data/.rspec +0 -1
  15. data/Gemfile +0 -22
  16. data/Rakefile +0 -18
  17. data/httpi.gemspec +0 -40
  18. data/spec/fixtures/attachment.gif +0 -0
  19. data/spec/fixtures/client_cert.pem +0 -20
  20. data/spec/fixtures/client_key.pem +0 -27
  21. data/spec/fixtures/xml.gz +0 -0
  22. data/spec/fixtures/xml.xml +0 -10
  23. data/spec/fixtures/xml_dime.dime +0 -0
  24. data/spec/fixtures/xml_dime.xml +0 -1
  25. data/spec/httpi/adapter/base_spec.rb +0 -23
  26. data/spec/httpi/adapter/curb_spec.rb +0 -351
  27. data/spec/httpi/adapter/em_http_spec.rb +0 -180
  28. data/spec/httpi/adapter/excon_spec.rb +0 -34
  29. data/spec/httpi/adapter/http_spec.rb +0 -28
  30. data/spec/httpi/adapter/httpclient_spec.rb +0 -239
  31. data/spec/httpi/adapter/net_http_persistent_spec.rb +0 -46
  32. data/spec/httpi/adapter/net_http_spec.rb +0 -54
  33. data/spec/httpi/adapter/rack_spec.rb +0 -109
  34. data/spec/httpi/adapter_spec.rb +0 -68
  35. data/spec/httpi/auth/config_spec.rb +0 -163
  36. data/spec/httpi/auth/ssl_spec.rb +0 -216
  37. data/spec/httpi/cookie_spec.rb +0 -36
  38. data/spec/httpi/cookie_store_spec.rb +0 -26
  39. data/spec/httpi/error_spec.rb +0 -43
  40. data/spec/httpi/httpi_spec.rb +0 -382
  41. data/spec/httpi/request_spec.rb +0 -290
  42. data/spec/httpi/response_spec.rb +0 -142
  43. data/spec/integration/curb_spec.rb +0 -139
  44. data/spec/integration/em_http_spec.rb +0 -108
  45. data/spec/integration/excon_spec.rb +0 -174
  46. data/spec/integration/fixtures/ca_all.pem +0 -19
  47. data/spec/integration/fixtures/server.cert +0 -19
  48. data/spec/integration/fixtures/server.key +0 -27
  49. data/spec/integration/http_spec.rb +0 -156
  50. data/spec/integration/httpclient_spec.rb +0 -136
  51. data/spec/integration/net_http_persistent_spec.rb +0 -171
  52. data/spec/integration/net_http_spec.rb +0 -285
  53. data/spec/integration/support/application.rb +0 -97
  54. data/spec/integration/support/server.rb +0 -83
  55. data/spec/spec_helper.rb +0 -23
  56. data/spec/support/error_helper.rb +0 -26
  57. data/spec/support/fixture.rb +0 -27
  58. data/spec/support/matchers.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd06f829b3d33418dfe3ef465949f504f6acde0e9f5988edea9615e700bb8f23
4
- data.tar.gz: '00197cf31c50d34768c76325d42cc8dc325774ffe5a2ecaf6feb33f7d22c382c'
3
+ metadata.gz: fe1562efbf5ab9aceadc7635826a4cf7317b83d5847c413bdce3462e23728f50
4
+ data.tar.gz: 2149ada8b2ec173323c1dd248a57d7666bdb9b6a1e0ae83c25e7f96f4c91539b
5
5
  SHA512:
6
- metadata.gz: 81a2a86d8a7784711c0a72995a21262c7bcdfb17d9127a06a9573c50f7eaffde7e544c07b332e905da3fb1b177d867d34c2b59a75f0605182a6d278db9eda4a6
7
- data.tar.gz: e59a0468efe743db6a4b4d7eff007714cb739e928396b7ff8797896a346e7808a2635185ccf1a9eb53db64d149626782a4f3dc530f3e9644c21923ce6a4a0f3d
6
+ metadata.gz: '0964bc62dd38fcd02d9c2c5ae9b07031b7719ccdb3ff831dc6d9f563a1fd0bd085d55e741cd30e063d64b6e3c548d347f8ec9ede647790ed54c4c68d8d50d222'
7
+ data.tar.gz: 61d4a274d5a330c886ccce1f773ee41567f9d09b216f1eca513ab7646f484e708295548732670a0025726713294c09aa704630c840971a57f79d34db653b97c5
data/CHANGELOG.md CHANGED
@@ -1,10 +1,35 @@
1
1
  ### Unreleased
2
2
 
3
- * Improvement: [#237](https://github.com/savonrb/httpi/pull/237) Implemented `adapter_client_setup`.
3
+ * Add your changelog entry here
4
+
5
+ ### 4.0.4 (2024-07-14)
6
+
7
+ * gemspec: Exclude spec files from published gem by @ChristopherBert in https://github.com/savonrb/httpi/pull/252
8
+
9
+ ### 4.0.3 (2024-07-06)
10
+
11
+ * Allow use with rack 3.1
12
+
13
+ ### 4.0.2 (2024-06-13)
14
+
15
+ * Don't change http header casing by @pcai in https://github.com/savonrb/httpi/pull/249
16
+
17
+ ### 4.0.1 (2024-02-16)
18
+
19
+ HTTPI is officially in maintenance mode. Our emphasis will now be on bugs, security fixes, and compatibility with the wider ecosystem. See [this issue](https://github.com/savonrb/httpi/issues/238) for details.
20
+
21
+ * Adds support for rack 3.0.
22
+ * POTENTIAL BREAKING CHANGE: `HTTPI::Request#headers` and `HTTPI::Response#headers` now return `HTTPI::Utils::Headers` instead of `Rack::Utils::HeaderHash`. This change will prevent HTTPI from breaking or changing its public API whenever rack rearranges its classes. If you were relying on the `Rack::Utils::HeaderHash` implementation, you will need to update your code to use `HTTPI::Utils::Headers` instead.
23
+
24
+ ### 4.0.0 (yanked)
25
+
26
+ Yanked due to a bug when used with rack 2.
4
27
 
5
28
  ### 3.0.2 (2024-02-10)
6
29
 
30
+ * Improvement: [#237](https://github.com/savonrb/httpi/pull/237) Implemented `adapter_client_setup`.
7
31
  * Add support for ruby 3.1, 3.2, 3.3. Drop support for ruby 2.7 and below.
32
+ * Pin to rack version < 3, HTTPI is not tested with rack 3 yet.
8
33
 
9
34
  ### 3.0.1 (2021-12-17)
10
35
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # HTTPI
2
2
 
3
- A common interface for Ruby's HTTP libraries.
3
+ A common interface for Ruby's HTTP libraries. This project is now in maintenance mode. For new projects, we recommend [faraday](https://github.com/lostisland/faraday).
4
4
 
5
5
  [Documentation](https://www.rubydoc.info/gems/httpi)
6
6
 
@@ -14,7 +14,7 @@ HTTPI is available through [Rubygems](https://rubygems.org/gems/httpi) and can b
14
14
 
15
15
  or add it to your Gemfile like this:
16
16
 
17
- gem 'httpi', '~> 3.0.0'
17
+ gem 'httpi', '~> 4.0.0'
18
18
 
19
19
  ## Usage example
20
20
 
@@ -36,6 +36,17 @@ HTTPI.adapter = :httpclient
36
36
 
37
37
  # and execute arbitary requests
38
38
  HTTPI.request(:custom, request)
39
+
40
+ # add a client setup block that will be called before each request
41
+ HTTPI.adapter = :httpclient
42
+ HTTPI.adapter_client_setup = proc do |x|
43
+ x.ssl_config.set_default_paths
44
+ x.force_basic_auth = true
45
+ end
46
+ # ...
47
+ HTTPI.get(request) do |x|
48
+ x.force_basic_auth = false
49
+ end
39
50
  ```
40
51
 
41
52
  ### SOCKS Proxy Support
data/UPDATING.md CHANGED
@@ -5,3 +5,7 @@
5
5
  BREAKING CHANGE: the [#255](https://github.com/savonrb/httpi/pull/225) made the gem socksify and rack gems optional dependencies.
6
6
 
7
7
  In order to restore the old behavior, see the README section "SOCKS Proxy Support" and "Rack Mock Adapter".
8
+
9
+ ## From 3.x to 4.x
10
+
11
+ POTENTIAL BREAKING CHANGE: `HTTPI::Request#headers` and `HTTPI::Response#headers` now return `HTTPI::Utils::Headers` instead of `Rack::Utils::HeaderHash`. This change will prevent HTTPI from breaking or changing its public API whenever rack rearranges its classes. If you were relying on the `Rack::Utils::HeaderHash` implementation, you will need to update your code to use `HTTPI::Utils::Headers` instead.
data/lib/httpi/request.rb CHANGED
@@ -64,12 +64,12 @@ module HTTPI
64
64
 
65
65
  # Returns a Hash of HTTP headers. Defaults to return an empty Hash.
66
66
  def headers
67
- @headers ||= Rack::Utils::HeaderHash.new
67
+ @headers ||= HTTPI::Utils::Headers.new
68
68
  end
69
69
 
70
70
  # Sets the Hash of HTTP headers.
71
71
  def headers=(headers)
72
- @headers = Rack::Utils::HeaderHash.new(headers)
72
+ @headers = HTTPI::Utils::Headers.new.merge(headers)
73
73
  end
74
74
 
75
75
  # Adds a header information to accept gzipped content.
@@ -20,7 +20,7 @@ module HTTPI
20
20
  # Initializer expects an HTTP response +code+, +headers+ and +body+.
21
21
  def initialize(code, headers, body)
22
22
  self.code = code.to_i
23
- self.headers = Rack::Utils::HeaderHash.new(headers)
23
+ self.headers = HTTPI::Utils::Headers.new.merge(headers)
24
24
  self.raw_body = body
25
25
  end
26
26
 
@@ -0,0 +1,95 @@
1
+ # mostly verbatim from: https://github.com/rack/rack/blob/main/lib/rack/headers.rb
2
+ # Because this is part of httpi's public API, its better not to load an external
3
+ # library for it.
4
+ module HTTPI
5
+ module Utils
6
+ # A case-insensitive Hash that preserves the original case of a
7
+ # header when set.
8
+ #
9
+ class Headers < Hash
10
+ def self.[](headers)
11
+ if headers.is_a?(Headers) && !headers.frozen?
12
+ return headers
13
+ else
14
+ return self.new(headers)
15
+ end
16
+ end
17
+
18
+ def initialize(hash = {})
19
+ super()
20
+ @names = {}
21
+ hash.each { |k, v| self[k] = v }
22
+ end
23
+
24
+ # on dup/clone, we need to duplicate @names hash
25
+ def initialize_copy(other)
26
+ super
27
+ @names = other.names.dup
28
+ end
29
+
30
+ # on clear, we need to clear @names hash
31
+ def clear
32
+ super
33
+ @names.clear
34
+ end
35
+
36
+ def each
37
+ super do |k, v|
38
+ yield(k, v.respond_to?(:to_ary) ? v.to_ary.join("\n") : v)
39
+ end
40
+ end
41
+
42
+ def to_hash
43
+ hash = {}
44
+ each { |k, v| hash[k] = v }
45
+ hash
46
+ end
47
+
48
+ def [](k)
49
+ super(k) || super(@names[k.downcase])
50
+ end
51
+
52
+ def []=(k, v)
53
+ canonical = k.downcase.freeze
54
+ delete k if @names[canonical] && @names[canonical] != k # .delete is expensive, don't invoke it unless necessary
55
+ @names[canonical] = k
56
+ super k, v
57
+ end
58
+
59
+ def delete(k)
60
+ canonical = k.downcase
61
+ result = super @names.delete(canonical)
62
+ result
63
+ end
64
+
65
+ def include?(k)
66
+ super || @names.include?(k.downcase)
67
+ end
68
+
69
+ alias_method :has_key?, :include?
70
+ alias_method :member?, :include?
71
+ alias_method :key?, :include?
72
+
73
+ def merge!(other)
74
+ other.each { |k, v| self[k] = v }
75
+ self
76
+ end
77
+
78
+ def merge(other)
79
+ hash = dup
80
+ hash.merge! other
81
+ end
82
+
83
+ def replace(other)
84
+ clear
85
+ other.each { |k, v| self[k] = v }
86
+ self
87
+ end
88
+
89
+ protected
90
+ def names
91
+ @names
92
+ end
93
+ end
94
+ end
95
+ end
data/lib/httpi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module HTTPI
2
- VERSION = '3.0.2'
2
+ VERSION = '4.0.4'
3
3
  end
data/lib/httpi.rb CHANGED
@@ -3,6 +3,7 @@ require "httpi/version"
3
3
  require "httpi/logger"
4
4
  require "httpi/request"
5
5
  require "httpi/query_builder"
6
+ require "httpi/utils"
6
7
 
7
8
  require "httpi/adapter/httpclient"
8
9
  require "httpi/adapter/curb"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpi
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Harrington
@@ -9,22 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-02-11 00:00:00.000000000 Z
12
+ date: 2024-07-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '2.0'
18
21
  - - "<"
19
22
  - !ruby/object:Gem::Version
20
- version: '3'
23
+ version: '4'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ version: '2.0'
25
31
  - - "<"
26
32
  - !ruby/object:Gem::Version
27
- version: '3'
33
+ version: '4'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: nkf
30
36
  requirement: !ruby/object:Gem::Requirement
@@ -73,14 +79,14 @@ dependencies:
73
79
  requirements:
74
80
  - - "~>"
75
81
  - !ruby/object:Gem::Version
76
- version: 0.3.2
82
+ version: 0.6.4
77
83
  type: :development
78
84
  prerelease: false
79
85
  version_requirements: !ruby/object:Gem::Requirement
80
86
  requirements:
81
87
  - - "~>"
82
88
  - !ruby/object:Gem::Version
83
- version: 0.3.2
89
+ version: 0.6.4
84
90
  - !ruby/object:Gem::Dependency
85
91
  name: rake
86
92
  requirement: !ruby/object:Gem::Requirement
@@ -129,14 +135,14 @@ dependencies:
129
135
  requirements:
130
136
  - - "~>"
131
137
  - !ruby/object:Gem::Version
132
- version: '5.0'
138
+ version: '6.0'
133
139
  type: :development
134
140
  prerelease: false
135
141
  version_requirements: !ruby/object:Gem::Requirement
136
142
  requirements:
137
143
  - - "~>"
138
144
  - !ruby/object:Gem::Version
139
- version: '5.0'
145
+ version: '6.0'
140
146
  - !ruby/object:Gem::Dependency
141
147
  name: webmock
142
148
  requirement: !ruby/object:Gem::Requirement
@@ -157,17 +163,10 @@ executables: []
157
163
  extensions: []
158
164
  extra_rdoc_files: []
159
165
  files:
160
- - ".devcontainer/devcontainer.json"
161
- - ".github/workflows/development.yml"
162
- - ".gitignore"
163
- - ".rspec"
164
166
  - CHANGELOG.md
165
- - Gemfile
166
167
  - LICENSE
167
168
  - README.md
168
- - Rakefile
169
169
  - UPDATING.md
170
- - httpi.gemspec
171
170
  - lib/httpi.rb
172
171
  - lib/httpi/adapter.rb
173
172
  - lib/httpi/adapter/base.rb
@@ -188,48 +187,8 @@ files:
188
187
  - lib/httpi/query_builder.rb
189
188
  - lib/httpi/request.rb
190
189
  - lib/httpi/response.rb
190
+ - lib/httpi/utils.rb
191
191
  - lib/httpi/version.rb
192
- - spec/fixtures/attachment.gif
193
- - spec/fixtures/client_cert.pem
194
- - spec/fixtures/client_key.pem
195
- - spec/fixtures/xml.gz
196
- - spec/fixtures/xml.xml
197
- - spec/fixtures/xml_dime.dime
198
- - spec/fixtures/xml_dime.xml
199
- - spec/httpi/adapter/base_spec.rb
200
- - spec/httpi/adapter/curb_spec.rb
201
- - spec/httpi/adapter/em_http_spec.rb
202
- - spec/httpi/adapter/excon_spec.rb
203
- - spec/httpi/adapter/http_spec.rb
204
- - spec/httpi/adapter/httpclient_spec.rb
205
- - spec/httpi/adapter/net_http_persistent_spec.rb
206
- - spec/httpi/adapter/net_http_spec.rb
207
- - spec/httpi/adapter/rack_spec.rb
208
- - spec/httpi/adapter_spec.rb
209
- - spec/httpi/auth/config_spec.rb
210
- - spec/httpi/auth/ssl_spec.rb
211
- - spec/httpi/cookie_spec.rb
212
- - spec/httpi/cookie_store_spec.rb
213
- - spec/httpi/error_spec.rb
214
- - spec/httpi/httpi_spec.rb
215
- - spec/httpi/request_spec.rb
216
- - spec/httpi/response_spec.rb
217
- - spec/integration/curb_spec.rb
218
- - spec/integration/em_http_spec.rb
219
- - spec/integration/excon_spec.rb
220
- - spec/integration/fixtures/ca_all.pem
221
- - spec/integration/fixtures/server.cert
222
- - spec/integration/fixtures/server.key
223
- - spec/integration/http_spec.rb
224
- - spec/integration/httpclient_spec.rb
225
- - spec/integration/net_http_persistent_spec.rb
226
- - spec/integration/net_http_spec.rb
227
- - spec/integration/support/application.rb
228
- - spec/integration/support/server.rb
229
- - spec/spec_helper.rb
230
- - spec/support/error_helper.rb
231
- - spec/support/fixture.rb
232
- - spec/support/matchers.rb
233
192
  homepage: https://github.com/savonrb/httpi
234
193
  licenses:
235
194
  - MIT
@@ -255,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
214
  - !ruby/object:Gem::Version
256
215
  version: '0'
257
216
  requirements: []
258
- rubygems_version: 3.4.10
217
+ rubygems_version: 3.5.3
259
218
  signing_key:
260
219
  specification_version: 4
261
220
  summary: Common interface for Ruby's HTTP libraries
@@ -1,22 +0,0 @@
1
- // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
- // README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3
- {
4
- "name": "Ruby",
5
- // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
- "image": "mcr.microsoft.com/devcontainers/ruby:1-3.2-bullseye"
7
-
8
- // Features to add to the dev container. More info: https://containers.dev/features.
9
- // "features": {},
10
-
11
- // Use 'forwardPorts' to make a list of ports inside the container available locally.
12
- // "forwardPorts": [],
13
-
14
- // Use 'postCreateCommand' to run commands after the container is created.
15
- // "postCreateCommand": "ruby --version",
16
-
17
- // Configure tool-specific properties.
18
- // "customizations": {},
19
-
20
- // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21
- // "remoteUser": "root"
22
- }
@@ -1,49 +0,0 @@
1
- name: Development
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- test:
7
- name: ${{matrix.ruby}} on ${{matrix.os}}
8
- runs-on: ${{matrix.os}}-latest
9
- continue-on-error: ${{matrix.experimental}}
10
-
11
- strategy:
12
- matrix:
13
- os:
14
- - ubuntu
15
-
16
- ruby:
17
- - "3.0"
18
- - "3.1"
19
- - "3.2"
20
- - "3.3"
21
-
22
- experimental: [false]
23
- env: [""]
24
-
25
- include:
26
- - os: ubuntu
27
- ruby: truffleruby
28
- experimental: true
29
- - os: ubuntu
30
- ruby: jruby
31
- experimental: true
32
- - os: ubuntu
33
- ruby: head
34
- experimental: true
35
-
36
- steps:
37
- - uses: actions/checkout@v3
38
-
39
- - name: Install dependencies
40
- run: sudo apt-get install libcurl4-openssl-dev
41
-
42
- - uses: ruby/setup-ruby@v1
43
- with:
44
- ruby-version: ${{matrix.ruby}}
45
- bundler-cache: true
46
-
47
- - name: Run tests
48
- timeout-minutes: 5
49
- run: ${{matrix.env}} bundle exec rspec
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- .DS_Store
2
- .yardoc
3
- doc
4
- coverage
5
- tmp
6
- *~
7
- *.gem
8
- .bundle
9
- Gemfile.lock
10
- .idea/*
11
- .rbx/
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
data/Gemfile DELETED
@@ -1,22 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
3
-
4
- gem 'jruby-openssl', :platforms => :jruby
5
-
6
- gem 'public_suffix', '~> 4.0'
7
-
8
- # http clients
9
- gem 'httpclient', '~> 2.3', :require => false
10
- gem 'curb', '~> 0.8', :require => false, :platforms => [:ruby]
11
- gem 'em-http-request', :require => false, :platforms => [:ruby]
12
- gem 'em-synchrony', :require => false, :platforms => [:ruby, :jruby]
13
- gem 'excon', '~> 0.71', :require => false, :platforms => [:ruby, :jruby]
14
- gem 'net-http-persistent', '~> 4.0', :require => false
15
- gem 'http', :require => false
16
-
17
- # adapter extensions
18
- gem 'rack', '< 3'
19
- gem 'socksify'
20
-
21
- # coverage
22
- gem 'simplecov', :require => false
data/Rakefile DELETED
@@ -1,18 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new do |t|
5
- t.pattern = "spec/httpi/**/*_spec.rb"
6
- end
7
-
8
- desc "Run RSpec integration examples"
9
- RSpec::Core::RakeTask.new "spec_integration" do |t|
10
- t.pattern = "spec/integration/*_spec.rb"
11
- end
12
-
13
- desc "Run RSpec code and integration examples"
14
- RSpec::Core::RakeTask.new "ci" do |t|
15
- t.pattern = "spec/{httpi,integration}/**/*_spec.rb"
16
- end
17
-
18
- task :default => :spec
data/httpi.gemspec DELETED
@@ -1,40 +0,0 @@
1
- lib = File.expand_path('../lib/', __FILE__)
2
- $:.unshift lib unless $:.include?(lib)
3
-
4
- require 'httpi/version'
5
-
6
- Gem::Specification.new do |s|
7
- s.name = 'httpi'
8
- s.version = HTTPI::VERSION
9
- s.authors = ['Daniel Harrington', 'Martin Tepper']
10
- s.email = 'me@rubiii.com'
11
- s.homepage = "https://github.com/savonrb/httpi"
12
- s.summary = "Common interface for Ruby's HTTP libraries"
13
- s.description = s.summary
14
- s.metadata = { 'bug_tracker_uri' => 'https://github.com/savonrb/httpi/issues',
15
- 'changelog_uri' => 'https://github.com/savonrb/httpi/blob/master/CHANGELOG.md',
16
- 'source_code_uri' => s.homepage,
17
- 'wiki_uri' => 'https://github.com/savonrb/httpi/wiki',
18
- 'documentation_uri' => 'https://www.rubydoc.info/gems/httpi' }
19
-
20
- s.required_ruby_version = '>= 3.0'
21
-
22
- s.license = 'MIT'
23
-
24
- s.add_dependency 'rack', '< 3'
25
- s.add_dependency 'nkf'
26
- s.add_dependency 'base64'
27
- s.add_dependency 'mutex_m'
28
-
29
- s.add_development_dependency 'rubyntlm', '~> 0.3.2'
30
- s.add_development_dependency 'rake', '~> 13.0'
31
- s.add_development_dependency 'rspec', '~> 3.5'
32
- s.add_development_dependency 'mocha', '~> 0.13'
33
- s.add_development_dependency 'puma', '~> 5.0'
34
- s.add_development_dependency 'webmock'
35
-
36
- s.metadata["rubygems_mfa_required"] = "true"
37
-
38
- s.files = `git ls-files`.split("\n")
39
- s.require_path = 'lib'
40
- end
Binary file
@@ -1,20 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIDVTCCAj2gAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQKDBhEZXZl
3
- bG9wbWVudC9DTj1sb2NhbGhvc3QwHhcNMTgwODEwMDAzMTQzWhcNMjgwODA3MDAz
4
- MTQzWjAjMSEwHwYDVQQKDBhEZXZlbG9wbWVudC9DTj1sb2NhbGhvc3QwggEiMA0G
5
- CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDbU3vifU9omTx5T6ECuYnvryr4iWPP
6
- A4sX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OjUHJuxjvqpceR4NVL
19
- vwfqXhRecWMlXJZiaqhzFrfkB4m9D98+/3I/bdesRXrWaNAbgv+GfpmB8X65SHzT
20
- zht9hEvn6A1LdX0KfIDKzeMCc49qY49N6ZgQNVnsW7DiZLAyMVbz5Hc1oNhHnWXg
21
- lHQfbUsbfeQjh2Q6YVMpZxkCgYAmC2pGJciup46CjIrraAsKqJJsbbC8XETsvXNf
22
- RTisYaQWC4DH1lDxQ7LpNhOjWL46Oqh+KlK+HJ956PJlltI0s7UDdOQkWrj4YpC7
23
- xAT/DuY0T9YPuc7gPr+O1qIlj3ZH1smMxh6SChzfYJZ3BcsZ7CWCPWvZbQOmjHg2
24
- cagKDQKBgQCjuICU3aElEXyGwPCEazVakgcuAuiAAjECQrHrbSVPaTDu6Cumupkw
25
- 50ypk/qJ3DegEumpufwLg37A9yFogkkHBI9Sw0PVjzXM0iWJsHceLTHWUgJBWcl3
26
- 5Sl/AacXbUHz4NMqARNVrfR3DP33Z/YXJ4bpsVswEjD51jPwwluwyA==
27
- -----END RSA PRIVATE KEY-----
data/spec/fixtures/xml.gz DELETED
Binary file
@@ -1,10 +0,0 @@
1
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ex="http://service.example.com/">
2
- <soapenv:Header/>
3
- <soapenv:Body>
4
- <ex:findUser>
5
- <request>
6
- <id>1</id>
7
- </request>
8
- </ex:findUser>
9
- </soapenv:Body>
10
- </soapenv:Envelope>
Binary file
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><getFileResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><getFileReturn href="#id0"/></getFileResponse><multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns1:FileVW" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://ws"><created xsi:type="xsd:dateTime">2010-10-27T22:00:00.000Z</created><id xsi:type="xsd:int">2181136</id><lastUpdated xsi:type="xsd:dateTime">2010-10-27T22:00:00.000Z</lastUpdated><metadata href="#id1"/><name xsi:type="xsd:string">attachment.gif</name><size xsi:type="xsd:long">80</size><type xsi:type="xsd:string">gif</type><version xsi:type="xsd:long">1</version></multiRef><multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:MetadataVW" xmlns:ns2="http://ws" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><CR_Latest xsi:type="xsd:boolean">true</CR_Latest><MD5 xsi:type="xsd:string">0xC11FE5DB260A89160FFF4EC26630EEB8</MD5><PSize xsi:type="xsd:string" xsi:nil="true"/><category xsi:type="xsd:string">1</category><completionRate xsi:type="xsd:int">1</completionRate><date xsi:type="xsd:string" xsi:nil="true"/><docNo xsi:type="xsd:string"></docNo><filesId xsi:type="xsd:int">2181136</filesId><init xsi:type="xsd:string"></init><locked xsi:type="xsd:boolean">false</locked><mdate xsi:type="xsd:dateTime">2010-10-28T20:27:00.000Z</mdate><meta1 xsi:type="xsd:string" xsi:nil="true"/><meta10 xsi:type="xsd:string" xsi:nil="true"/><meta11 xsi:type="xsd:string" xsi:nil="true"/><meta12 xsi:type="xsd:string" xsi:nil="true"/><meta13 xsi:type="xsd:string" xsi:nil="true"/><meta14 xsi:type="xsd:string" xsi:nil="true"/><meta15 xsi:type="xsd:string" xsi:nil="true"/><meta16 xsi:type="xsd:string" xsi:nil="true"/><meta17 xsi:type="xsd:string" xsi:nil="true"/><meta18 xsi:type="xsd:string" xsi:nil="true"/><meta19 xsi:type="xsd:string" xsi:nil="true"/><meta2 xsi:type="xsd:string" xsi:nil="true"/><meta20 xsi:type="xsd:string" xsi:nil="true"/><meta3 xsi:type="xsd:string" xsi:nil="true"/><meta4 xsi:type="xsd:string" xsi:nil="true"/><meta5 xsi:type="xsd:string" xsi:nil="true"/><meta6 xsi:type="xsd:string" xsi:nil="true"/><meta7 xsi:type="xsd:string" xsi:nil="true"/><meta8 xsi:type="xsd:string" xsi:nil="true"/><meta9 xsi:type="xsd:string" xsi:nil="true"/><note xsi:type="xsd:string" xsi:nil="true"/><ref xsi:type="xsd:string"></ref><ref2 xsi:type="xsd:string" xsi:nil="true"/><ref3 xsi:type="xsd:string" xsi:nil="true"/><ref4 xsi:type="xsd:string" xsi:nil="true"/><revDate xsi:type="xsd:string"></revDate><revName xsi:type="xsd:string"></revName><scale xsi:type="xsd:string" xsi:nil="true"/><scaleUnit xsi:type="xsd:string" xsi:nil="true"/><size xsi:type="xsd:int">80</size><type xsi:type="xsd:string">Document</type><version xsi:type="xsd:int">1</version></multiRef></soapenv:Body></soapenv:Envelope>
@@ -1,23 +0,0 @@
1
- require "spec_helper"
2
- require "httpi/adapter/base"
3
-
4
- describe HTTPI::Adapter::Base do
5
-
6
- subject(:base) { HTTPI::Adapter::Base.new(request) }
7
- let(:request) { HTTPI::Request.new }
8
-
9
- describe "#client" do
10
- it "returns the adapter's client instance" do
11
- expect { base.client }.
12
- to raise_error(HTTPI::NotImplementedError, "Adapters need to implement a #client method")
13
- end
14
- end
15
-
16
- describe "#request" do
17
- it "executes arbitrary HTTP requests" do
18
- expect { base.request(:get) }.
19
- to raise_error(HTTPI::NotImplementedError, "Adapters need to implement a #request method")
20
- end
21
- end
22
-
23
- end