sprockets 3.7.3 → 3.7.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8d2739c5e14edf6aa95989aef8057d65eeb1525b4fccda72ba6099a8fe94bd3
4
- data.tar.gz: 42fea69a2cf60adff7848fea3c8cd7fff222703611feda467aa8c5236aed9d84
3
+ metadata.gz: 1247cdff923f74bc8e25b4941797f3137e9d1765306bb79543543e17e4f1bc50
4
+ data.tar.gz: 4e05e0a201f4cb7713392c5ba7187d43663c1c23d0e44d1b0b2343ba7138f378
5
5
  SHA512:
6
- metadata.gz: 753ee6f089d3e281ba3eb81fe4fbd133d50065337f84c02891895de4544d2204bc884c1599781d632f290b1d407d684f473e101e5ba535f12afebc82a979cdd8
7
- data.tar.gz: 9c57173eb38957dc992617903bd15b922caf20468c5952c158ffa00472c52ce6e0029011495f8b2fcd9a9148cd7b4ce3525b1749b3c9b1a982038ca9afe0e737
6
+ metadata.gz: fae3ef101561cdcde39a89c15d9953d9492317d1072bbf339dd94f4bc9fa4fbffd81c258d302dde38fef3e3225b4029fa63328312a19cd808ea05fb6c2b6cd81
7
+ data.tar.gz: be67fc1164cf0a748c9c437d29f70502f6df06a09a3ab2a4b306eecdf1d7fcdee8492479a6290601dac261e285def2dce56dc3e2f44b71b56820bb843bfac4e6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ **3.7.4** (March 28, 2024)
2
+
3
+ * Fix deprecated calls to the `uri` gem.
4
+
1
5
  **3.7.3** (March 28, 2024)
2
6
 
3
7
  * Various compatibility fixes for newer Ruby versions.
@@ -154,18 +154,10 @@ module Sprockets
154
154
  end
155
155
  end
156
156
 
157
- # URI.unescape is deprecated on 1.9. We need to use URI::Parser
158
- # if its available.
159
- if defined? URI::DEFAULT_PARSER
160
- def unescape(str)
161
- str = URI::DEFAULT_PARSER.unescape(str)
162
- str.force_encoding(Encoding.default_internal) if Encoding.default_internal
163
- str
164
- end
165
- else
166
- def unescape(str)
167
- URI.unescape(str)
168
- end
157
+ def unescape(str)
158
+ URIUtils::URI_PARSER.unescape(str)
159
+ str.force_encoding(Encoding.default_internal) if Encoding.default_internal
160
+ str
169
161
  end
170
162
  end
171
163
 
@@ -20,6 +20,8 @@ module Sprockets
20
20
  module URIUtils
21
21
  extend self
22
22
 
23
+ URI_PARSER = defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::RFC2396_Parser.new
24
+
23
25
  # Internal: Parse URI into component parts.
24
26
  #
25
27
  # uri - String uri
@@ -44,7 +46,7 @@ module Sprockets
44
46
  def split_file_uri(uri)
45
47
  scheme, _, host, _, _, path, _, query, _ = URI.split(uri)
46
48
 
47
- path = URI::Generic::DEFAULT_PARSER.unescape(path)
49
+ path = URI_PARSER.unescape(path)
48
50
  path.force_encoding(Encoding::UTF_8)
49
51
 
50
52
  # Hack for parsing Windows "file:///C:/Users/IEUser" paths
@@ -63,7 +65,7 @@ module Sprockets
63
65
  str = "#{scheme}://"
64
66
  str << host if host
65
67
  path = "/#{path}" unless path.start_with?("/")
66
- str << URI::Generic::DEFAULT_PARSER.escape(path)
68
+ str << URI_PARSER.escape(path)
67
69
  str << "?#{query}" if query
68
70
  str
69
71
  end
@@ -162,7 +164,7 @@ module Sprockets
162
164
  when Integer
163
165
  query << "#{key}=#{value}"
164
166
  when String, Symbol
165
- query << "#{key}=#{URI::Generic::DEFAULT_PARSER.escape(value.to_s)}"
167
+ query << "#{key}=#{URI_PARSER.escape(value.to_s)}"
166
168
  when TrueClass
167
169
  query << "#{key}"
168
170
  when FalseClass, NilClass
@@ -182,7 +184,7 @@ module Sprockets
182
184
  def parse_uri_query_params(query)
183
185
  query.to_s.split('&').reduce({}) do |h, p|
184
186
  k, v = p.split('=', 2)
185
- v = URI::Generic::DEFAULT_PARSER.unescape(v) if v
187
+ v = URI_PARSER.unescape(v) if v
186
188
  h[k.to_sym] = v || true
187
189
  h
188
190
  end
@@ -1,3 +1,3 @@
1
1
  module Sprockets
2
- VERSION = "3.7.3"
2
+ VERSION = "3.7.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.3
4
+ version: 3.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stephenson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-03-28 00:00:00.000000000 Z
12
+ date: 2024-09-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: base64
@@ -346,7 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
346
346
  - !ruby/object:Gem::Version
347
347
  version: '0'
348
348
  requirements: []
349
- rubygems_version: 3.5.3
349
+ rubygems_version: 3.5.11
350
350
  signing_key:
351
351
  specification_version: 4
352
352
  summary: Rack-based asset packaging system