httpi 2.5.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c921690b77440f26fa4da9bac58ed74d16440e9df7d180be606e1c21460dfbb
4
- data.tar.gz: d95e355e1925d7cb78622fc6188cc761eedec15e30ad9bd93b565937873d86c6
3
+ metadata.gz: b488ad4ac7b6d32a313798d387be88d00976ffe2533a1413836bd7e102cfda83
4
+ data.tar.gz: f555c552fbdfa36b727c75e5bf2b3a9a19559098145ce3f969c94f250380b185
5
5
  SHA512:
6
- metadata.gz: '09c5e6e4bf5242de2f9472123c94ca3f17a3fd60e816886cf7402d4d977d45e2cc8be98e3d6a4ac2c7d16b68af8cef58a016d4b1b4aa443bfca92bde6f7232ce'
7
- data.tar.gz: ba7d999bc0d771365a4c647df38419f7ba2ee22f3d06c33dd660645aad999d7529d1ce8036b9d2d24994098fcdf2f415df2b533b4c68c5c1a483b0e25862629a
6
+ metadata.gz: fccd5e6e95668a6b49e440eee050a2e8f7e456434e6a973bd2cc8d54c97854c1961fc5e941456ff6e3a4356a03bb6b8a7aad023fd7b8d74f0d73a2e1a18fd682
7
+ data.tar.gz: 825d197e0ccb00ba983aba28a40cb6c0f1789bc6ae9cb3ba82363548330fd66609c5c4e904285038d67de6c95850f1ccaca3901f7698b7317657e754f1035f7d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 3.0.0 (2021-10-19)
2
+
3
+ * Improvement: [#225](https://github.com/savonrb/httpi/pull/225) Make rack and socksify dependencies optional.
4
+
1
5
  ### 2.5.0 (2021-10-05)
2
6
 
3
7
  * Feature: [#214](https://github.com/savonrb/httpi/pull/214) Add SSL ciphers configuration
data/README.md CHANGED
@@ -11,16 +11,11 @@ A common interface for Ruby's HTTP libraries.
11
11
 
12
12
  HTTPI is available through [Rubygems](https://rubygems.org/gems/httpi) and can be installed via:
13
13
 
14
- ```
15
- $ gem install httpi
16
- ```
14
+ $ gem install httpi
17
15
 
18
16
  or add it to your Gemfile like this:
19
17
 
20
- ```
21
- gem 'httpi', '~> 2.1.0'
22
- ```
23
-
18
+ gem 'httpi', '~> 3.0.0'
24
19
 
25
20
  ## Usage example
26
21
 
@@ -44,6 +39,20 @@ HTTPI.adapter = :httpclient
44
39
  HTTPI.request(:custom, request)
45
40
  ```
46
41
 
42
+ ### Rack Mock Adapter
43
+
44
+ To use the Rack mock adapter, please add the `rack` gem to your gemfile.
45
+
46
+ ### SOCKS Proxy Support
47
+
48
+ To use the the SOCKS proxy support, please add the `socksify` gem to your gemfile, and add the following code:
49
+
50
+ ``` ruby
51
+ require 'socksify'
52
+ require 'socksify/http'
53
+ ```
54
+
55
+ to your project.
47
56
 
48
57
  ## Documentation
49
58
 
data/UPDATING.md ADDED
@@ -0,0 +1,7 @@
1
+ # Update guide
2
+
3
+ ## From 2.x to 3.x
4
+
5
+ BREAKING CHANGE: the [#255](https://github.com/savonrb/httpi/pull/225) made the gem socksify and rack gems optional dependencies.
6
+
7
+ In order to restore the old behavior, see the README section "SOCKS Proxy Support" and "Rack Mock Adapter".
data/httpi.gemspec CHANGED
@@ -16,9 +16,6 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.license = 'MIT'
18
18
 
19
- s.add_dependency 'rack'
20
- s.add_dependency 'socksify'
21
-
22
19
  s.add_development_dependency 'rubyntlm', '~> 0.3.2'
23
20
  s.add_development_dependency 'rake', '~> 13.0'
24
21
  s.add_development_dependency 'rspec', '~> 3.5'
@@ -4,8 +4,6 @@ require "httpi/adapter/base"
4
4
  require "httpi/response"
5
5
  require 'kconv'
6
6
  require 'socket'
7
- require "socksify"
8
- require 'socksify/http'
9
7
 
10
8
  module HTTPI
11
9
  module Adapter
data/lib/httpi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module HTTPI
2
- VERSION = '2.5.0'
2
+ VERSION = '3.0.0'
3
3
  end
@@ -93,11 +93,19 @@ describe HTTPI::Adapter::NetHTTP do
93
93
  end
94
94
  }
95
95
  let(:request_body) { nil }
96
- let(:response) { HTTPI.request(http_method, request, adapter) }
96
+
97
+ subject(:response) { HTTPI.request(http_method, request, adapter) }
97
98
 
98
99
  shared_examples_for "any supported custom method" do
99
- specify { response.body.should eq http_method.to_s }
100
- specify { response.headers["Content-Type"].should eq("text/plain") }
100
+ describe '#body' do
101
+ subject(:body) {response.body}
102
+ it { is_expected.to be == http_method.to_s }
103
+ end
104
+
105
+ describe '#headers' do
106
+ subject(:headers) {response.headers}
107
+ it { is_expected.to include('content-type' => "text/plain")}
108
+ end
101
109
  end
102
110
 
103
111
  context "PATCH method" do
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: 2.5.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Harrington
@@ -9,36 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-05 00:00:00.000000000 Z
12
+ date: 2021-10-18 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rack
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: '0'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- version: '0'
28
- - !ruby/object:Gem::Dependency
29
- name: socksify
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: '0'
42
14
  - !ruby/object:Gem::Dependency
43
15
  name: rubyntlm
44
16
  requirement: !ruby/object:Gem::Requirement
@@ -137,6 +109,7 @@ files:
137
109
  - LICENSE
138
110
  - README.md
139
111
  - Rakefile
112
+ - UPDATING.md
140
113
  - httpi.gemspec
141
114
  - lib/httpi.rb
142
115
  - lib/httpi/adapter.rb