sprockets 3.7.3 → 3.7.5

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: 8824196f3f212af5ad78b5109661583431f1c7e2c8616061992ad10b1f4ffbf7
4
+ data.tar.gz: 29db43e310d5fb10852c1ab7e2d3408e04f6a829edc82da388ac8618af4789f8
5
5
  SHA512:
6
- metadata.gz: 753ee6f089d3e281ba3eb81fe4fbd133d50065337f84c02891895de4544d2204bc884c1599781d632f290b1d407d684f473e101e5ba535f12afebc82a979cdd8
7
- data.tar.gz: 9c57173eb38957dc992617903bd15b922caf20468c5952c158ffa00472c52ce6e0029011495f8b2fcd9a9148cd7b4ce3525b1749b3c9b1a982038ca9afe0e737
6
+ metadata.gz: 41b8112ac0d3d420e98b85749326089157c3090f93dcadd411d6304b035f5004fa622ef66ea222b40bbd3cde2400410b60efbd259fa70b2f90f23ee9062c4841
7
+ data.tar.gz: 267728252c1d71c2b8f513950a52d793eea54c93636cae0e6de2007e7fd25d5552a70fe5650ade766bad72d141f2b283c2d544afdd986fe61dcd274d61054102
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ **3.7.5** (Spet 19, 2024)
2
+
3
+ * Fix `Sprockets::Base#unescape` #808.
4
+
5
+ **3.7.4** (March 28, 2024)
6
+
7
+ * Fix deprecated calls to the `uri` gem.
8
+
1
9
  **3.7.3** (March 28, 2024)
2
10
 
3
11
  * 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
+ str = 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.5"
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.5
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-19 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