sassc-embedded 1.77.5 → 1.77.6

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: 3f893a88e7993e70cec58055829a076f43869ac843f4b30741ac0377b7a358ab
4
- data.tar.gz: 5a431b6429c3d6e0d1f2d010efc517d926bfebfb2d9ed454087c312b661f028d
3
+ metadata.gz: abfda7ec1954206ddeaa5615edb426019fbe31b3eefd755b70123790d7184e17
4
+ data.tar.gz: 82c27c03bb0cafb0066e9e0cb06a6facef27306a3d39bf8ac586ee807e5bd9ff
5
5
  SHA512:
6
- metadata.gz: 0e49489a1079584157456035a5c1bcf932c53a320e371fdb78c3b2cfc3eb74f7369330df925504943237ccf734cd5e4d8801b1ad37179a1a414595e3b32e5565
7
- data.tar.gz: 1107e84ae76c86f032feb15d9162aef04423daef1726e381e6e515e982e02b69178900fd6e07ce1e82efc95d7fa5859caa07bb60d754e15f6cd335ba69a85647
6
+ metadata.gz: 6ab470b94835dcde4f7c3430b9410535645f4b335283cd777a06932eba4c378fde7319c5c1bf76f127be4c4f36761efb24d99e0de7926a39443832bd84ce60d8
7
+ data.tar.gz: ae24593c836f5878d120ea0d43feea97bba1dabbb80ac4dc347972f840a4321d60cfeca92d071573a6cc6ec7051026919a397b1e707dc5295cbd87fc38a00742
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SassC
4
4
  module Embedded
5
- VERSION = '1.77.5'
5
+ VERSION = '1.77.6'
6
6
  end
7
7
  end
@@ -588,40 +588,51 @@ module SassC
588
588
  ::URI::RFC3986_PARSER.parse(...)
589
589
  end
590
590
 
591
+ encode_uri_hash = {}
592
+ decode_uri_hash = {}
593
+ 256.times do |i|
594
+ c = -[i].pack('C')
595
+ h = c.unpack1('H')
596
+ l = c.unpack1('h')
597
+ pdd = -"%#{h}#{l}"
598
+ pdu = -"%#{h}#{l.upcase}"
599
+ pud = -"%#{h.upcase}#{l}"
600
+ puu = -pdd.upcase
601
+ encode_uri_hash[c] = puu
602
+ decode_uri_hash[pdd] = c
603
+ decode_uri_hash[pdu] = c
604
+ decode_uri_hash[pud] = c
605
+ decode_uri_hash[puu] = c
606
+ end.freeze
607
+ encode_uri_hash.freeze
608
+ decode_uri_hash.freeze
609
+
591
610
  {
592
- encode_uri_path_component: "!$&'()*+,;=:/@",
593
- encode_uri_query_component: "!$&'()*+,;=:/?@",
594
- encode_uri_component: nil,
595
- encode_uri: "!$&'()*+,;=:/?#[]@"
611
+ uri_path_component: "!$&'()*+,;=:/@",
612
+ uri_query_component: "!$&'()*+,;=:/?@",
613
+ uri_component: nil,
614
+ uri: "!$&'()*+,;=:/?#[]@"
596
615
  }
597
- .each do |symbol, extra_unescaped|
598
- regexp = Regexp.new("[^0-9A-Za-z#{Regexp.escape("-._~#{extra_unescaped}")}]", Regexp::NOENCODING)
599
- define_method(symbol) do |str|
600
- str.b.gsub(regexp) do |match|
601
- "%#{match.unpack1('H2').upcase}"
602
- end.force_encoding(str.encoding)
616
+ .each do |symbol, unescaped|
617
+ encode_regexp = Regexp.new("[^0-9A-Za-z#{Regexp.escape("-._~#{unescaped}")}]", Regexp::NOENCODING)
618
+
619
+ define_method(:"encode_#{symbol}") do |str|
620
+ str.b.gsub(encode_regexp, encode_uri_hash).force_encoding(str.encoding)
603
621
  end
604
- end
605
622
 
606
- {
607
- decode_uri_component: nil,
608
- decode_uri: "!$&'()*+,;=:/?#[]@"
609
- }
610
- .each do |symbol, preserve_escaped|
611
- regexp = /%[0-9A-Fa-f]{2}/o
612
- if preserve_escaped.nil? || preserve_escaped.empty?
613
- define_method(symbol) do |str|
614
- str.gsub(regexp) do |match|
615
- [match.reverse!].pack('h2')
616
- end.force_encoding(str.encoding)
617
- end
618
- else
619
- define_method(symbol) do |str|
620
- str.gsub(regexp) do |match|
621
- decoded = [match.reverse].pack('h2')
622
- preserve_escaped.include?(decoded) ? match : decoded
623
- end.force_encoding(str.encoding)
624
- end
623
+ next if symbol.match?(/_.+_/o)
624
+
625
+ decode_regexp = /%[0-9A-Fa-f]{2}/o
626
+ decode_uri_hash_with_preserve_escaped = if unescaped.nil? || unescaped.empty?
627
+ decode_uri_hash
628
+ else
629
+ decode_uri_hash.to_h do |key, value|
630
+ [key, unescaped.include?(value) ? key : value]
631
+ end.freeze
632
+ end
633
+
634
+ define_method(:"decode_#{symbol}") do |str|
635
+ str.gsub(decode_regexp, decode_uri_hash_with_preserve_escaped).force_encoding(str.encoding)
625
636
  end
626
637
  end
627
638
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sassc-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.77.5
4
+ version: 1.77.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-05 00:00:00.000000000 Z
11
+ date: 2024-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass-embedded
@@ -79,7 +79,7 @@ licenses:
79
79
  metadata:
80
80
  bug_tracker_uri: https://github.com/sass-contrib/sassc-embedded-shim-ruby/issues
81
81
  documentation_uri: https://rubydoc.info/gems/sassc
82
- source_code_uri: https://github.com/sass-contrib/sassc-embedded-shim-ruby/tree/v1.77.5
82
+ source_code_uri: https://github.com/sass-contrib/sassc-embedded-shim-ruby/tree/v1.77.6
83
83
  funding_uri: https://github.com/sponsors/ntkme
84
84
  rubygems_mfa_required: 'true'
85
85
  post_install_message: