webmock 3.26.1 → 3.26.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: f6212b8ecba4f6e6456df9e174ac656119cbe8b602a928bcb93e533af153ac10
4
- data.tar.gz: 46ca0c2ebe868b176b1f2d9b9fef674d40657c19e8e5114849ea6c67cb64fe11
3
+ metadata.gz: d61b9a1ba2457ef06a173ec71523bedaaecdac935b59611abeff105679da7cb3
4
+ data.tar.gz: 1d78e1c3b493bd1fc2af0961a6bebae5a273e1937b6cad6aaa7ef501e4b70778
5
5
  SHA512:
6
- metadata.gz: 230dd002efafa1cc4cfe78c9b353316b14438960c3d20f2172b4f62e01cb97f97c39cbe8bdff0eddb828cb17ef3c348383739a54197d2ba5ab0ab65912c90135
7
- data.tar.gz: 4689be33d041de6c62ca4ebc80cada85ef1b49f8b52d412083005586a92fc8337d5bbfde3cf68e02becec9cdcee15122bc84ca7b2c9cdecf3922d4bda44484d0
6
+ metadata.gz: 4e56c8868b81ac1465e6b28b96041f9ea0a3cda7ef3728d0bc6715215d84baa44af5b5e1f4ba48597f34e6fd2e6f00f86cb5d61c194fb2eebd0a58caf92f615b
7
+ data.tar.gz: ea6072e9d1dbba86925558f31e10df790c5979f470806b92be7cfa483d47b1158ba55b1453981d696751ca2b2c98a1847f50cb635779a7eef7e7a377598777b4
data/CHANGELOG.md CHANGED
@@ -1,8 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ # 3.26.2
4
+
5
+ * Add support to parse http/2 request on curb adapter
6
+
7
+ Thanks to [Christoph Rieß](https://github.com/criess)
8
+
9
+ * CurbAdapter alias `code` from `response_code`
10
+
11
+ Thanks to [Christoph Rieß](https://github.com/criess)
12
+
13
+ * Add HTTP.rb v6.0.0 compatibility to http_rb adapter
14
+
15
+ Thanks to [Erik Berlin](https://github.com/sferik)
16
+
3
17
  # 3.26.1
4
18
 
5
- Fix compatibility with recent async-http versions
19
+ * Fix compatibility with recent async-http versions
6
20
 
7
21
  Thanks to [Mikhail Doronin](https://github.com/misdoro)
8
22
 
data/README.md CHANGED
@@ -45,6 +45,7 @@ Supported Ruby Interpreters
45
45
  * MRI 3.2
46
46
  * MRI 3.3
47
47
  * MRI 3.4
48
+ * MRI 4.0
48
49
  * JRuby
49
50
 
50
51
  ## Installation
@@ -1210,6 +1211,8 @@ People who submitted patches and new features or suggested improvements. Many th
1210
1211
  * Patrick Jaberg
1211
1212
  * Oleg
1212
1213
  * Mikhail Doronin
1214
+ * Christoph Rieß
1215
+ * Erik Berlin
1213
1216
 
1214
1217
  For a full list of contributors you can visit the
1215
1218
  [contributors](https://github.com/bblimke/webmock/contributors) page.
@@ -7,7 +7,7 @@ rescue LoadError
7
7
  end
8
8
 
9
9
  if defined?(Curl)
10
- WebMock::VersionChecker.new('Curb', Curl::CURB_VERSION, '0.7.16', '1.0.1', ['0.8.7']).check_version!
10
+ WebMock::VersionChecker.new('Curb', Curl::CURB_VERSION, '0.7.16', '1.2.2', ['0.8.7']).check_version!
11
11
 
12
12
  module WebMock
13
13
  module HttpLibAdapters
@@ -32,8 +32,8 @@ if defined?(Curl)
32
32
  status, headers = nil, {}
33
33
 
34
34
  header_string.split(/\r\n/).each do |header|
35
- if header =~ %r|^HTTP/1.[01] \d\d\d (.*)|
36
- status = $1
35
+ if header =~ %r{\AHTTP/(1\.[01]|2) (\d{3})\s*(.*)}
36
+ status = $3
37
37
  else
38
38
  parts = header.split(':', 2)
39
39
  unless parts.empty?
@@ -313,6 +313,7 @@ if defined?(Curl)
313
313
  def response_code
314
314
  @response_code ||= super
315
315
  end
316
+ alias code response_code
316
317
 
317
318
  def header_str
318
319
  @header_str ||= super
@@ -28,9 +28,6 @@ module HTTP
28
28
  headers = webmock_response.headers || {}
29
29
  uri = normalize_uri(request_signature && request_signature.uri)
30
30
 
31
- # HTTP.rb 3.0+ uses a keyword argument to pass the encoding, but 1.x
32
- # and 2.x use a positional argument, and 0.x don't support supplying
33
- # the encoding.
34
31
  body = build_http_rb_response_body_from_webmock_response(webmock_response)
35
32
 
36
33
  return new(status, "1.1", headers, body, uri) if HTTP::VERSION < "1.0.0"
@@ -46,6 +43,17 @@ module HTTP
46
43
  })
47
44
  end
48
45
 
46
+ # 6.0.0 changed Response.new from a positional hash to keyword arguments.
47
+ if HTTP::VERSION >= '6.0.0'
48
+ return new(
49
+ status: status,
50
+ version: "1.1",
51
+ headers: headers,
52
+ body: body,
53
+ request: request,
54
+ )
55
+ end
56
+
49
57
  new({
50
58
  status: status,
51
59
  version: "1.1",
@@ -10,15 +10,22 @@ module HTTP
10
10
 
11
11
  def readpartial(size = nil, outbuf = nil)
12
12
  unless size
13
- if defined?(HTTP::Client::BUFFER_SIZE)
14
- size = HTTP::Client::BUFFER_SIZE
15
- elsif defined?(HTTP::Connection::BUFFER_SIZE)
13
+ if defined?(HTTP::Connection::BUFFER_SIZE)
16
14
  size = HTTP::Connection::BUFFER_SIZE
15
+ elsif defined?(HTTP::Client::BUFFER_SIZE)
16
+ size = HTTP::Client::BUFFER_SIZE
17
17
  end
18
18
  end
19
19
 
20
- chunk = @io.read size, outbuf
21
- chunk.force_encoding(@encoding) if chunk
20
+ chunk = @io.read(size, outbuf)
21
+
22
+ # HTTP.rb 6.0+ expects EOFError at end-of-stream instead of nil
23
+ if chunk.nil?
24
+ raise EOFError if HTTP::VERSION >= "6.0.0"
25
+ return nil
26
+ end
27
+
28
+ chunk.force_encoding(@encoding)
22
29
  end
23
30
 
24
31
  def close
@@ -43,7 +43,10 @@ module HTTP
43
43
  invoke_callbacks(webmock_response, real_request: false)
44
44
  response = ::HTTP::Response.from_webmock @request, webmock_response, request_signature
45
45
 
46
- @options.features.each { |_name, feature| response = feature.wrap_response(response) }
46
+ # HTTP.rb 6.0+ wraps responses in reverse feature order
47
+ features = @options.features.values
48
+ features = features.reverse if HTTP::VERSION >= "6.0.0"
49
+ features.each { |feature| response = feature.wrap_response(response) }
47
50
  response
48
51
  end
49
52
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebMock
4
- VERSION = '3.26.1' unless defined?(::WebMock::VERSION)
4
+ VERSION = '3.26.2' unless defined?(::WebMock::VERSION)
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmock
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.26.1
4
+ version: 3.26.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartosz Blimke
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-10-30 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: addressable
@@ -359,11 +358,10 @@ licenses:
359
358
  - MIT
360
359
  metadata:
361
360
  bug_tracker_uri: https://github.com/bblimke/webmock/issues
362
- changelog_uri: https://github.com/bblimke/webmock/blob/v3.26.1/CHANGELOG.md
363
- documentation_uri: https://www.rubydoc.info/gems/webmock/3.26.1
364
- source_code_uri: https://github.com/bblimke/webmock/tree/v3.26.1
361
+ changelog_uri: https://github.com/bblimke/webmock/blob/v3.26.2/CHANGELOG.md
362
+ documentation_uri: https://www.rubydoc.info/gems/webmock/3.26.2
363
+ source_code_uri: https://github.com/bblimke/webmock/tree/v3.26.2
365
364
  wiki_uri: https://github.com/bblimke/webmock/wiki
366
- post_install_message:
367
365
  rdoc_options: []
368
366
  require_paths:
369
367
  - lib
@@ -378,8 +376,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
378
376
  - !ruby/object:Gem::Version
379
377
  version: '0'
380
378
  requirements: []
381
- rubygems_version: 3.5.16
382
- signing_key:
379
+ rubygems_version: 4.1.0.dev
383
380
  specification_version: 4
384
381
  summary: Library for stubbing HTTP requests in Ruby.
385
382
  test_files: []