webmock 3.8.1 → 3.8.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4eb1f45308b980dfaa6f5e292efad872723d4f4d5d51a2edc07fac71f58ff79
4
- data.tar.gz: b26aea6c4f2823a534274984ddf7a1d77bf69b0f9eb41e62dea9341c13efa028
3
+ metadata.gz: e810298e20d5299b4db93de105d6bfd2928db868ed70d6113e1e308091130f7c
4
+ data.tar.gz: d35d0053907cb949df0a891e9b9e6e4f2c62143651fc2b19a2d02192fb1d6f91
5
5
  SHA512:
6
- metadata.gz: d914ab7d87674019a2f2ffe195a296ff488067b2971caf588f221ff6810fdbc7b646f529c680d7b0aefd09eb98a6db7b66fa1c8767f0fe6ee244df32e5ac583a
7
- data.tar.gz: af18127a0082d5b74b400af4406909393de802ffc775ed5ecae25305ea0d06dbd571ed92d042d064c0aefad4e07b5ff32a660037fc63467143a4e0a71be3309b
6
+ metadata.gz: f42ea1b65f3203df24d0dc5cf39204274c30339eb8831bc95570da25cc497cb51bb9cc696636a437b941aea050940574d01c6632dbe9db29bd67f67eab2e15d9
7
+ data.tar.gz: 902b36dd0712ecafe4e26eca7416e6444638ea2687a86b434382428a6158c6b7a9155b17b62c30755712cc5cf51985482b6d7c386461d11ed5ade0afa069b45c
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.8.2
4
+
5
+ * Support correct encoding parameter for HTTP.rb 2.x and earlier
6
+
7
+ Thanks to [Alex Coomans](https://github.com/drcapulet)
8
+
3
9
  ## 3.8.1
4
10
 
5
11
  * Added support for mocking non-ASCII bodies when making requests with HTTP.rb
data/README.md CHANGED
@@ -1119,6 +1119,7 @@ People who submitted patches and new features or suggested improvements. Many th
1119
1119
  * Brandur
1120
1120
  * Samuel Williams
1121
1121
  * Patrik Ragnarsson
1122
+ * Alex Coomans
1122
1123
 
1123
1124
  For a full list of contributors you can visit the
1124
1125
  [contributors](https://github.com/bblimke/webmock/contributors) page.
@@ -14,9 +14,19 @@ module HTTP
14
14
  def from_webmock(webmock_response, request_signature = nil)
15
15
  status = Status.new(webmock_response.status.first)
16
16
  headers = webmock_response.headers || {}
17
- body = Body.new(Streamer.new(webmock_response.body), encoding: webmock_response.body.encoding)
18
17
  uri = normalize_uri(request_signature && request_signature.uri)
19
18
 
19
+ # HTTP.rb 3.0+ uses a keyword argument to pass the encoding, but 1.x
20
+ # and 2.x use a positional argument, and 0.x don't support supplying
21
+ # the encoding.
22
+ body = if HTTP::VERSION < "1.0.0"
23
+ Body.new(Streamer.new(webmock_response.body))
24
+ elsif HTTP::VERSION < "3.0.0"
25
+ Body.new(Streamer.new(webmock_response.body), webmock_response.body.encoding)
26
+ else
27
+ Body.new(Streamer.new(webmock_response.body), encoding: webmock_response.body.encoding)
28
+ end
29
+
20
30
  return new(status, "1.1", headers, body, uri) if HTTP::VERSION < "1.0.0"
21
31
 
22
32
  new({
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '3.8.1' unless defined?(::WebMock::VERSION)
2
+ VERSION = '3.8.2' unless defined?(::WebMock::VERSION)
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmock
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.1
4
+ version: 3.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartosz Blimke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-05 00:00:00.000000000 Z
11
+ date: 2020-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -407,9 +407,9 @@ licenses:
407
407
  - MIT
408
408
  metadata:
409
409
  bug_tracker_uri: https://github.com/bblimke/webmock/issues
410
- changelog_uri: https://github.com/bblimke/webmock/blob/v3.8.1/CHANGELOG.md
411
- documentation_uri: https://www.rubydoc.info/gems/webmock/3.8.1
412
- source_code_uri: https://github.com/bblimke/webmock/tree/v3.8.1
410
+ changelog_uri: https://github.com/bblimke/webmock/blob/v3.8.2/CHANGELOG.md
411
+ documentation_uri: https://www.rubydoc.info/gems/webmock/3.8.2
412
+ source_code_uri: https://github.com/bblimke/webmock/tree/v3.8.2
413
413
  wiki_uri: https://github.com/bblimke/webmock/wiki
414
414
  post_install_message:
415
415
  rdoc_options: []