webmock 3.12.2 → 3.13.0

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: 6cf9216e779a2041d66197b6842541c77cb4bbcccc93c5d1b1260283b1003264
4
- data.tar.gz: '04926e981765e34e6c39919a14dc7f41ce7b7a272484762269adae18004902d0'
3
+ metadata.gz: 8469a0c06ac5d0deb2f5c5442083a044ccd57ef57055f3afb915c1db3b818113
4
+ data.tar.gz: 8fce88c63437fac8eca97a21bc85fd96ca6311c7566b6bbd975c131471b06759
5
5
  SHA512:
6
- metadata.gz: d0998bb9620479a4c3036ea2872ba8de5f0748b5cb4b62e454239324cdecede5007d7dd63e65ebc676f9798574ebf680255737623088a01293dbca7eaa95a1b2
7
- data.tar.gz: 7afd145d161fe7460ad0ef10f4eb1ec29e67b58cd0462de7bfc5fac39fc210f9bd27f7d56b508ab8552be1152ec807245044ebe009cdca15b944fe58bdc9d679
6
+ metadata.gz: 4ba632d82b141c68922e567ded64ebad6a1ffd979ecb9d82487782f9464306fb49e9c4a65024d8501886268a4c40a6af639c4c3967ad56e5426e74a8d8b84516
7
+ data.tar.gz: a35a08185af128a39344c36517d25fef3b02e8d9bffeba840bfb07846a94701fefdd918291943b2595e13ec634921345ac7eb18744f4d206770877dcfde67c81
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ # 3.13.0
4
+
5
+ * Support http.rb 5.x
6
+
7
+ Thanks to [Will Storey](https://github.com/horgh)
8
+
3
9
  # 3.12.2
4
10
 
5
11
  * Fixed em-http-request adapter to avoid calling middleware twice.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  WebMock
2
2
  =======
3
3
  [![Gem Version](https://badge.fury.io/rb/webmock.svg)](http://badge.fury.io/rb/webmock)
4
- [![Build Status](https://secure.travis-ci.org/bblimke/webmock.svg?branch=master)](http://travis-ci.org/bblimke/webmock)
4
+ [![Build Status](https://github.com/bblimke/webmock/workflows/CI/badge.svg?branch=master)](https://github.com/bblimke/webmock/actions)
5
5
  [![Code Climate](https://codeclimate.com/github/bblimke/webmock/badges/gpa.svg)](https://codeclimate.com/github/bblimke/webmock)
6
6
  [![Mentioned in Awesome Ruby](https://awesome.re/mentioned-badge.svg)](https://github.com/markets/awesome-ruby)
7
7
  [![Inline docs](http://inch-ci.org/github/bblimke/webmock.svg?branch=master)](http://inch-ci.org/github/bblimke/webmock)
@@ -1159,6 +1159,7 @@ People who submitted patches and new features or suggested improvements. Many th
1159
1159
  * Niklas Hösl
1160
1160
  * Johanna Hartmann
1161
1161
  * Alex Vondrak
1162
+ * Will Storey
1162
1163
 
1163
1164
  For a full list of contributors you can visit the
1164
1165
  [contributors](https://github.com/bblimke/webmock/contributors) page.
@@ -11,7 +11,7 @@ module HTTP
11
11
  end
12
12
 
13
13
  class << self
14
- def from_webmock(webmock_response, request_signature = nil)
14
+ def from_webmock(request, webmock_response, request_signature = nil)
15
15
  status = Status.new(webmock_response.status.first)
16
16
  headers = webmock_response.headers || {}
17
17
  uri = normalize_uri(request_signature && request_signature.uri)
@@ -29,12 +29,23 @@ module HTTP
29
29
 
30
30
  return new(status, "1.1", headers, body, uri) if HTTP::VERSION < "1.0.0"
31
31
 
32
+ # 5.0.0 had a breaking change to require request instead of uri.
33
+ if HTTP::VERSION < '5.0.0'
34
+ return new({
35
+ status: status,
36
+ version: "1.1",
37
+ headers: headers,
38
+ body: body,
39
+ uri: uri
40
+ })
41
+ end
42
+
32
43
  new({
33
44
  status: status,
34
45
  version: "1.1",
35
46
  headers: headers,
36
47
  body: body,
37
- uri: uri
48
+ request: request,
38
49
  })
39
50
  end
40
51
 
@@ -38,7 +38,7 @@ module HTTP
38
38
  webmock_response.raise_error_if_any
39
39
 
40
40
  invoke_callbacks(webmock_response, real_request: false)
41
- ::HTTP::Response.from_webmock webmock_response, request_signature
41
+ ::HTTP::Response.from_webmock @request, webmock_response, request_signature
42
42
  end
43
43
 
44
44
  def raise_timeout_error
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '3.12.2' unless defined?(::WebMock::VERSION)
2
+ VERSION = '3.13.0' 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.12.2
4
+ version: 3.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartosz Blimke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-26 00:00:00.000000000 Z
11
+ date: 2021-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -422,9 +422,9 @@ licenses:
422
422
  - MIT
423
423
  metadata:
424
424
  bug_tracker_uri: https://github.com/bblimke/webmock/issues
425
- changelog_uri: https://github.com/bblimke/webmock/blob/v3.12.2/CHANGELOG.md
426
- documentation_uri: https://www.rubydoc.info/gems/webmock/3.12.2
427
- source_code_uri: https://github.com/bblimke/webmock/tree/v3.12.2
425
+ changelog_uri: https://github.com/bblimke/webmock/blob/v3.13.0/CHANGELOG.md
426
+ documentation_uri: https://www.rubydoc.info/gems/webmock/3.13.0
427
+ source_code_uri: https://github.com/bblimke/webmock/tree/v3.13.0
428
428
  wiki_uri: https://github.com/bblimke/webmock/wiki
429
429
  post_install_message:
430
430
  rdoc_options: []