webmock 3.24.0 → 3.25.1

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: 9283efd8ecb49795fe14fc5903295b0d143fbdd17f5cc1611e89d918f917c33f
4
- data.tar.gz: ea556e59d242667816568c75f7c42be613e09f688c3ada07c65f0c9de0e3d05d
3
+ metadata.gz: 4471c79f7254ad167ce3c961c4304c8e59e2301afd7932a55f752948a9df4a68
4
+ data.tar.gz: d369c322527d0497c124b9782637098e787211ac1c86b237557fb1cb0043aad5
5
5
  SHA512:
6
- metadata.gz: bcd310894ba47584609ffafcd332cbd824d3921ec938a7ca63e84e983436188dbf7f44a13137e407b3c5798fd9a02ced95e5797ac9ee3e923adf588cf04c4015
7
- data.tar.gz: 617bcf11b564bf6cc2faf4a973e9882dbb9639e685ed989fe6bc11b65c1ea7e66d12a106484e2e641ff4fda4c8c7336fe83509852b2a858f94fe0a657b5aae6c
6
+ metadata.gz: b0d6e23baead2656c34e64af8c6e7fa3d6b751283af3337e2bb19a09267919639995cd8f66ff5fe8eb84a629d12ed772ef678628832a8a10c069fd1b7bb035ba
7
+ data.tar.gz: eeba044f07023a9e1b285f992726046c8f47ec6602ee47b9334403660a2c88703a41acf4f8ad605d20c05be362ed79b312929c1d2a3db223f98790900ee9c737
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ # 3.25.1
4
+
5
+ * Fix FrozenError in Typhoeus streaming response body
6
+
7
+ Thanks to [Patrick Jaberg](https://github.com/patrickjaberg)
8
+
9
+ # 3.25.0
10
+
11
+ * Resolve net-http adapter deprecation Ruby 3.4
12
+
13
+ Thanks to [Earlopain](https://github.com/Earlopain)
14
+
3
15
  # 3.24.0
4
16
 
5
17
  * Ignore parsing errors when parsing invalid JSON or XML body to match against body pattern #1066
data/README.md CHANGED
@@ -44,6 +44,7 @@ Supported Ruby Interpreters
44
44
  * MRI 3.1
45
45
  * MRI 3.2
46
46
  * MRI 3.3
47
+ * MRI 3.4
47
48
  * JRuby
48
49
 
49
50
  ## Installation
@@ -1206,6 +1207,7 @@ People who submitted patches and new features or suggested improvements. Many th
1206
1207
  * Jacob Frautschi
1207
1208
  * Christian Schmidt
1208
1209
  * Rodrigo Argumedo
1210
+ * Patrick Jaberg
1209
1211
 
1210
1212
  For a full list of contributors you can visit the
1211
1213
  [contributors](https://github.com/bblimke/webmock/contributors) page.
@@ -12,19 +12,25 @@ module WebMock
12
12
  adapter_for :net_http
13
13
 
14
14
  OriginalNetHTTP = Net::HTTP unless const_defined?(:OriginalNetHTTP)
15
+ # This will be removed in Ruby 3.5. In Ruby 3.4, const_remove will warn.
16
+ HAS_LEGACY_CONSTANT = Net.const_defined?(:HTTPSession)
15
17
 
16
18
  def self.enable!
17
19
  Net.send(:remove_const, :HTTP)
18
- Net.send(:remove_const, :HTTPSession)
19
20
  Net.send(:const_set, :HTTP, @webMockNetHTTP)
20
- Net.send(:const_set, :HTTPSession, @webMockNetHTTP)
21
+ if HAS_LEGACY_CONSTANT
22
+ remove_silently(Net, :HTTPSession)
23
+ Net.send(:const_set, :HTTPSession, @webMockNetHTTP)
24
+ end
21
25
  end
22
26
 
23
27
  def self.disable!
24
28
  Net.send(:remove_const, :HTTP)
25
- Net.send(:remove_const, :HTTPSession)
26
29
  Net.send(:const_set, :HTTP, OriginalNetHTTP)
27
- Net.send(:const_set, :HTTPSession, OriginalNetHTTP)
30
+ if HAS_LEGACY_CONSTANT
31
+ remove_silently(Net, :HTTPSession)
32
+ Net.send(:const_set, :HTTPSession, OriginalNetHTTP)
33
+ end
28
34
 
29
35
  #copy all constants from @webMockNetHTTP to original Net::HTTP
30
36
  #in case any constants were added to @webMockNetHTTP instead of Net::HTTP
@@ -37,6 +43,14 @@ module WebMock
37
43
  end
38
44
  end
39
45
 
46
+ def self.remove_silently(mod, const) #:nodoc:
47
+ # Don't warn on removing the deprecated constant
48
+ verbose, $VERBOSE = $VERBOSE, nil
49
+ mod.send(:remove_const, const)
50
+ ensure
51
+ $VERBOSE = verbose
52
+ end
53
+
40
54
  @webMockNetHTTP = Class.new(Net::HTTP) do
41
55
  class << self
42
56
  def socket_type
@@ -172,7 +172,7 @@ if defined?(Typhoeus)
172
172
  request.execute_headers_callbacks(response)
173
173
  end
174
174
  if request.respond_to?(:streaming?) && request.streaming?
175
- response.options[:response_body] = ""
175
+ response.options[:response_body] = "".dup
176
176
  request.on_body.each { |callback| callback.call(webmock_response.body, response) }
177
177
  end
178
178
  request.finish(response)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebMock
4
- VERSION = '3.24.0' unless defined?(::WebMock::VERSION)
4
+ VERSION = '3.25.1' unless defined?(::WebMock::VERSION)
5
5
  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.24.0
4
+ version: 3.25.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartosz Blimke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-30 00:00:00.000000000 Z
11
+ date: 2025-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -373,9 +373,9 @@ licenses:
373
373
  - MIT
374
374
  metadata:
375
375
  bug_tracker_uri: https://github.com/bblimke/webmock/issues
376
- changelog_uri: https://github.com/bblimke/webmock/blob/v3.24.0/CHANGELOG.md
377
- documentation_uri: https://www.rubydoc.info/gems/webmock/3.24.0
378
- source_code_uri: https://github.com/bblimke/webmock/tree/v3.24.0
376
+ changelog_uri: https://github.com/bblimke/webmock/blob/v3.25.1/CHANGELOG.md
377
+ documentation_uri: https://www.rubydoc.info/gems/webmock/3.25.1
378
+ source_code_uri: https://github.com/bblimke/webmock/tree/v3.25.1
379
379
  wiki_uri: https://github.com/bblimke/webmock/wiki
380
380
  post_install_message:
381
381
  rdoc_options: []
@@ -385,14 +385,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
385
385
  requirements:
386
386
  - - ">="
387
387
  - !ruby/object:Gem::Version
388
- version: '2.5'
388
+ version: '2.6'
389
389
  required_rubygems_version: !ruby/object:Gem::Requirement
390
390
  requirements:
391
391
  - - ">="
392
392
  - !ruby/object:Gem::Version
393
393
  version: '0'
394
394
  requirements: []
395
- rubygems_version: 3.5.16
395
+ rubygems_version: 3.2.3
396
396
  signing_key:
397
397
  specification_version: 4
398
398
  summary: Library for stubbing HTTP requests in Ruby.