sassc-embedded 1.77.4 → 1.77.6

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: dd81bac6ef9d2f86bf538c0143e19267e892a907d8a3b7d3547ce900b6fb8e08
4
- data.tar.gz: 6c9592d7f4f8be038427f7ed893b6bb235f598a7d8a9cf34091b453c325b8551
3
+ metadata.gz: abfda7ec1954206ddeaa5615edb426019fbe31b3eefd755b70123790d7184e17
4
+ data.tar.gz: 82c27c03bb0cafb0066e9e0cb06a6facef27306a3d39bf8ac586ee807e5bd9ff
5
5
  SHA512:
6
- metadata.gz: 4e03d2ba0d17fab117b33f49a03b89ac90f75b49afb0c42db58c5e8a9d42f62737f7c6f81db5eef3a8da77e045b7a686ca036e5475f906a30758388e5624b5b7
7
- data.tar.gz: 12ff6dc22c74b77adef326df8a4f0c102bc34114e9b815e6be65a53307ec9271a040400d3965baad93c0387a7f909c31c3c2e1e1549956d22cb680fc3caf3106
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.4'
5
+ VERSION = '1.77.6'
6
6
  end
7
7
  end
@@ -10,6 +10,8 @@ require_relative 'embedded/version'
10
10
 
11
11
  module SassC
12
12
  class Engine
13
+ remove_method(:render) if public_method_defined?(:render, false)
14
+
13
15
  def render
14
16
  return @template.dup if @template.empty?
15
17
 
@@ -64,6 +66,8 @@ module SassC
64
66
  raise SyntaxError.new(e.full_message, filename: path, line:)
65
67
  end
66
68
 
69
+ remove_method(:dependencies) if public_method_defined?(:dependencies, false)
70
+
67
71
  def dependencies
68
72
  raise NotRenderedError unless @loaded_urls
69
73
 
@@ -72,6 +76,8 @@ module SassC
72
76
  end)
73
77
  end
74
78
 
79
+ remove_method(:source_map) if public_method_defined?(:source_map, false)
80
+
75
81
  def source_map
76
82
  raise NotRenderedError unless @source_map
77
83
 
@@ -101,18 +107,19 @@ module SassC
101
107
  end
102
108
  end
103
109
 
110
+ remove_method(:output_style) if private_method_defined?(:output_style, false)
111
+
104
112
  def output_style
105
113
  @output_style ||= begin
106
- style = @options.fetch(:style, :sass_style_nested).to_s
107
- style = "sass_style_#{style}" unless style.start_with?('sass_style_')
108
- raise InvalidStyleError unless OUTPUT_STYLES.include?(style.to_sym)
114
+ style = @options.fetch(:style, :sass_style_nested).to_s.delete_prefix('sass_style_').to_sym
109
115
 
110
- style = style.delete_prefix('sass_style_').to_sym
111
116
  case style
112
- when :nested, :compact
117
+ when :nested, :compact, :expanded
113
118
  :expanded
119
+ when :compressed
120
+ :compressed
114
121
  else
115
- style
122
+ raise InvalidStyleError
116
123
  end
117
124
  end
118
125
  end
@@ -123,12 +130,16 @@ module SassC
123
130
  syntax
124
131
  end
125
132
 
133
+ remove_method(:load_paths) if private_method_defined?(:load_paths, false)
134
+
126
135
  def load_paths
127
136
  @load_paths ||= (@options[:load_paths] || []) + SassC.load_paths
128
137
  end
129
138
  end
130
139
 
131
140
  class FunctionsHandler
141
+ remove_method(:setup) if public_method_defined?(:setup, false)
142
+
132
143
  def setup(_native_options, functions: Script::Functions)
133
144
  @callbacks = {}
134
145
 
@@ -161,6 +172,8 @@ module SassC
161
172
 
162
173
  private
163
174
 
175
+ remove_method(:arguments_from_native_list) if private_method_defined?(:arguments_from_native_list, false)
176
+
164
177
  def arguments_from_native_list(native_argument_list)
165
178
  native_argument_list.filter_map do |native_value|
166
179
  Script::ValueConversion.from_native(native_value, @options)
@@ -179,6 +192,8 @@ module SassC
179
192
  private_constant :NoopImporter
180
193
 
181
194
  class ImportHandler
195
+ remove_method(:setup) if public_method_defined?(:setup, false)
196
+
182
197
  def setup(_native_options)
183
198
  if @importer
184
199
  import_cache = ImportCache.new(@importer)
@@ -402,6 +417,10 @@ module SassC
402
417
  end
403
418
 
404
419
  class Sass2Scss
420
+ class << self
421
+ remove_method(:convert) if public_method_defined?(:convert, false)
422
+ end
423
+
405
424
  def self.convert(sass)
406
425
  {
407
426
  contents: sass,
@@ -413,6 +432,10 @@ module SassC
413
432
  module Script
414
433
  class Value
415
434
  class String
435
+ class << self
436
+ remove_method(:quote) if public_method_defined?(:quote, false)
437
+ end
438
+
416
439
  # Returns the quoted string representation of `contents`.
417
440
  #
418
441
  # @options opts :quote [String]
@@ -425,6 +448,8 @@ module SassC
425
448
  opts[:sass] ? contents.gsub('#', '\#') : contents
426
449
  end
427
450
 
451
+ remove_method(:to_s) if public_method_defined?(:to_s, false)
452
+
428
453
  def to_s(opts = {})
429
454
  opts = { quote: :none }.merge!(opts) if @type == :identifier
430
455
  self.class.quote(@value, opts)
@@ -433,6 +458,10 @@ module SassC
433
458
  end
434
459
 
435
460
  module ValueConversion
461
+ class << self
462
+ remove_method(:from_native) if public_method_defined?(:from_native, false)
463
+ end
464
+
436
465
  def self.from_native(value, options)
437
466
  case value
438
467
  when ::Sass::Value::Null::NULL
@@ -488,6 +517,10 @@ module SassC
488
517
  end
489
518
  end
490
519
 
520
+ class << self
521
+ remove_method(:to_native) if public_method_defined?(:to_native, false)
522
+ end
523
+
491
524
  def self.to_native(value)
492
525
  case value
493
526
  when nil
@@ -555,40 +588,51 @@ module SassC
555
588
  ::URI::RFC3986_PARSER.parse(...)
556
589
  end
557
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
+
558
610
  {
559
- encode_uri_path_component: "!$&'()*+,;=:/@",
560
- encode_uri_query_component: "!$&'()*+,;=:/?@",
561
- encode_uri_component: nil,
562
- encode_uri: "!$&'()*+,;=:/?#[]@"
611
+ uri_path_component: "!$&'()*+,;=:/@",
612
+ uri_query_component: "!$&'()*+,;=:/?@",
613
+ uri_component: nil,
614
+ uri: "!$&'()*+,;=:/?#[]@"
563
615
  }
564
- .each do |symbol, extra_unescaped|
565
- regexp = Regexp.new("[^0-9A-Za-z#{Regexp.escape("-._~#{extra_unescaped}")}]", Regexp::NOENCODING)
566
- define_method(symbol) do |str|
567
- str.b.gsub(regexp) do |match|
568
- "%#{match.unpack1('H2').upcase}"
569
- 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)
570
621
  end
571
- end
572
622
 
573
- {
574
- decode_uri_component: nil,
575
- decode_uri: "!$&'()*+,;=:/?#[]@"
576
- }
577
- .each do |symbol, preserve_escaped|
578
- regexp = /%[0-9A-Fa-f]{2}/o
579
- if preserve_escaped.nil? || preserve_escaped.empty?
580
- define_method(symbol) do |str|
581
- str.gsub(regexp) do |match|
582
- [match.reverse!].pack('h2')
583
- end.force_encoding(str.encoding)
584
- end
585
- else
586
- define_method(symbol) do |str|
587
- str.gsub(regexp) do |match|
588
- decoded = [match.reverse].pack('h2')
589
- preserve_escaped.include?(decoded) ? match : decoded
590
- end.force_encoding(str.encoding)
591
- 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)
592
636
  end
593
637
  end
594
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.4
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.4
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: