faraday-gzip 3.0.2 → 3.0.4

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: 45d5422fd045656fc52c28af8bb61860c73290f2b7882cb72a47136b5a837b10
4
- data.tar.gz: 79e16aa5064e33c5f54459e14f0cb6c8f35b808344b374703bc6a628c9cd5652
3
+ metadata.gz: 5183c6f188272ea7e213adf03bb2d637c348e9f273b1b8829255f135a95b8c92
4
+ data.tar.gz: ce73797d7aa191ef07c376af0193ea704a653237146affec2806031194d064c7
5
5
  SHA512:
6
- metadata.gz: 8e2dbcd91159e307205222561cf2070b1ba8070e057a8ab846d9d03c093886c13103f86e79104dc2c76cf9566fe6a6610cf076504d76c1776de4499b1c6eb9c4
7
- data.tar.gz: 924a0d4a6c4a76188d8f2bc9890ae12c4a185d3bb0b86495de457ee8109ffc1e95e99e43dcfccd969cf86f7f6c1668103d4efad5c9158d7b46d1e94870c3e5c8
6
+ metadata.gz: 8f9add78a8ff2c274ef021ae4e8ebfc1f525847ba4d05ca6ccf52cba1bc9f9d891e4627a354fdbf724393cb420e1225c33521d55f15f0c292490c8466e6ba202
7
+ data.tar.gz: 2edf0cd82a52d2bf33d9024ed3363b4735dc7a7645f847bf1aca250947d14663d696d2bc64bb10fc83019a677a2b701d933766ed1afcc7f76d554a30b4e6c5f9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.4 (06-Apr-2025)
4
+
5
+ * Require StringIO that might not always be readily available
6
+
7
+ ## 3.0.3 (25-Feb-2025)
8
+
9
+ * Minor code fixes, make some methods more solid
10
+
3
11
  ## 3.0.1 / 3.0.2 (01-Nov-2024)
4
12
 
5
13
  * Minor fixes in gemspec
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'zlib'
4
+ require 'stringio'
4
5
 
5
6
  # Middleware to automatically decompress response bodies. If the
6
7
  # "Accept-Encoding" header wasn't set in the request, this sets it to
@@ -67,7 +68,11 @@ module Faraday
67
68
  def uncompress_gzip(body)
68
69
  io = StringIO.new(body)
69
70
  gzip_reader = Zlib::GzipReader.new(io, encoding: 'ASCII-8BIT')
70
- gzip_reader.read
71
+ begin
72
+ gzip_reader.read
73
+ ensure
74
+ gzip_reader.close
75
+ end
71
76
  end
72
77
 
73
78
  # Process deflate
@@ -103,7 +108,7 @@ module Faraday
103
108
 
104
109
  # Method providing the processors
105
110
  def processors
106
- {
111
+ @processors ||= {
107
112
  'gzip' => ->(body) { uncompress_gzip(body) },
108
113
  'deflate' => ->(body) { inflate(body) },
109
114
  'br' => ->(body) { brotli_inflate(body) }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Faraday
4
4
  module Gzip
5
- VERSION = '3.0.2'
5
+ VERSION = '3.0.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday-gzip
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Krukowski
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-01 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: faraday
@@ -114,20 +113,6 @@ dependencies:
114
113
  - - "~>"
115
114
  - !ruby/object:Gem::Version
116
115
  version: '1.32'
117
- - !ruby/object:Gem::Dependency
118
- name: rubocop-packaging
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: 0.5.0
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: 0.5.0
131
116
  - !ruby/object:Gem::Dependency
132
117
  name: rubocop-performance
133
118
  requirement: !ruby/object:Gem::Requirement
@@ -178,11 +163,9 @@ licenses:
178
163
  metadata:
179
164
  bug_tracker_uri: https://github.com/bodrovis/faraday-gzip/issues
180
165
  changelog_uri: https://github.com/bodrovis/faraday-gzip/blob/master/CHANGELOG.md
181
- documentation_uri: http://www.rubydoc.info/gems/faraday-gzip/3.0.2
182
- homepage_uri: https://github.com/bodrovis/faraday-gzip
166
+ documentation_uri: http://www.rubydoc.info/gems/faraday-gzip/3.0.4
183
167
  source_code_uri: https://github.com/bodrovis/faraday-gzip
184
168
  rubygems_mfa_required: 'true'
185
- post_install_message:
186
169
  rdoc_options: []
187
170
  require_paths:
188
171
  - lib
@@ -197,8 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
180
  - !ruby/object:Gem::Version
198
181
  version: '0'
199
182
  requirements: []
200
- rubygems_version: 3.5.22
201
- signing_key:
183
+ rubygems_version: 3.6.7
202
184
  specification_version: 4
203
185
  summary: Automatically sets compression headers and decompresses the response
204
186
  test_files: []