sass-embedded 1.105.0 → 1.105.1

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: 6f1645dd09c0f7d844933041a214aa7473e13c21a71a8c502142939ecbc34de8
4
- data.tar.gz: a7ead5ad42def6711604a7e0c3c97748eb7b969760f580320e8bdd261db701e8
3
+ metadata.gz: 97faa2ce792bcc737ded3a7ba1c27cf5f9eb9fae01658c6a07b9dd5ad4abdcf1
4
+ data.tar.gz: 0aef0c7269199e19170b7c3dd12ebe6d6b9bea26ec3c52572be987ca3bd525b9
5
5
  SHA512:
6
- metadata.gz: f8e3d6cdbcb4b72e20aca0e7e013e521be75e33b65416382131113085720c6319c89611c025da752db8c3f2e264af7fc499e9b3b84860aa3d0c31c88417c0834
7
- data.tar.gz: dc2d9b0e0c0d792e2afe309e13e384f1429cc3eea820d4ae30e4bc748fd2d9f791834ea612a96beaa9ab67399059e676b2ba7f5894c99943d1f1b6620ef2d367
6
+ metadata.gz: 84d5e4ff326edbf5337e1ecefbbf16092e3408d425c248f2471f7538a4a0919f0b41b8e99df692b7ae30f44045255a2924fe43d3e1134c129ce3479d3fc4f52f
7
+ data.tar.gz: 6e3b0f9deebb23caddd25ea363bcc7f0523b47e4b5609401570367486a8aadf88e9d2ce10bdf77f1dd9dd86526e9879b5f65b6126ffabcd116b440d207b97307
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "sass": "file:sass-1.105.0.tgz"
3
+ "sass": "file:sass-1.105.1.tgz"
4
4
  },
5
5
  "allowScripts": {
6
6
  "@parcel/watcher": true
Binary file
@@ -109,7 +109,7 @@ module Sass
109
109
  singleton: :NULL
110
110
  )
111
111
  else
112
- raise Sass::ScriptError, "Unknown Sass::Value #{obj}"
112
+ raise Sass::ScriptError, "Unknown Sass::Value #{obj.inspect}"
113
113
  end
114
114
  end
115
115
 
@@ -190,7 +190,7 @@ module Sass
190
190
 
191
191
  def assert_compiler_value(value)
192
192
  unless value.instance_variable_get(:@compile_context) == @function_registry.compile_context
193
- raise Sass::ScriptError, "Value #{value} does not belong to this compilation"
193
+ raise Sass::ScriptError, "Value #{value.inspect} does not belong to this compilation"
194
194
  end
195
195
 
196
196
  value
@@ -275,7 +275,7 @@ module Sass
275
275
  )
276
276
  )
277
277
  else
278
- raise Sass::ScriptError, "Unknown CalculationValue #{value}"
278
+ raise Sass::ScriptError, "Unknown CalculationValue #{value.inspect}"
279
279
  end
280
280
  end
281
281
 
@@ -318,7 +318,7 @@ module Sass
318
318
  when '/'
319
319
  :DIVIDE
320
320
  else
321
- raise Sass::ScriptError, "Unknown CalculationOperator #{separator}"
321
+ raise Sass::ScriptError, "Unknown CalculationOperator #{separator.inspect}"
322
322
  end
323
323
  end
324
324
 
@@ -355,7 +355,7 @@ module Sass
355
355
  when nil
356
356
  :UNDECIDED
357
357
  else
358
- raise Sass::ScriptError, "Unknown ListSeparator #{separator}"
358
+ raise Sass::ScriptError, "Unknown ListSeparator #{separator.inspect}"
359
359
  end
360
360
  end
361
361
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  module Embedded
5
- VERSION = '1.105.0'
5
+ VERSION = '1.105.1'
6
6
  end
7
7
  end
@@ -31,6 +31,13 @@ module Sass
31
31
  @hash ||= value.hash
32
32
  end
33
33
 
34
+ # @return [::String]
35
+ def to_s
36
+ value.to_s
37
+ end
38
+
39
+ alias inspect to_s
40
+
34
41
  alias to_bool value
35
42
 
36
43
  # @return [Boolean]
@@ -124,7 +124,7 @@ module Sass
124
124
  return channel2 if channel == channels[2].name
125
125
  return alpha if channel == 'alpha'
126
126
 
127
- raise Sass::ScriptError.new("Color #{self} doesn't have a channel named \"#{channel}\".", channel)
127
+ raise Sass::ScriptError.new("Color #{inspect} doesn't have a channel named \"#{channel}\".", channel)
128
128
  end
129
129
 
130
130
  # @param channel [::String]
@@ -136,7 +136,7 @@ module Sass
136
136
  return channel2_missing? if channel == channels[2].name
137
137
  return alpha_missing? if channel == 'alpha'
138
138
 
139
- raise Sass::ScriptError.new("Color #{self} doesn't have a channel named \"#{channel}\".", channel)
139
+ raise Sass::ScriptError.new("Color #{inspect} doesn't have a channel named \"#{channel}\".", channel)
140
140
  end
141
141
 
142
142
  # @param channel [::String]
@@ -151,7 +151,7 @@ module Sass
151
151
  return channel2_powerless? if channel == channels[2].name
152
152
  return false if channel == 'alpha'
153
153
 
154
- raise Sass::ScriptError.new("Color #{self} doesn't have a channel named \"#{channel}\".", channel)
154
+ raise Sass::ScriptError.new("Color #{inspect} doesn't have a channel named \"#{channel}\".", channel)
155
155
  end
156
156
 
157
157
  # @param other [Color]
@@ -43,6 +43,20 @@ module Sass
43
43
  @hash ||= defined?(@id) ? [compile_context, id].hash : [signature, callback].hash
44
44
  end
45
45
 
46
+ # @raise [ScriptError]
47
+ def to_s
48
+ return super unless defined?(@id)
49
+
50
+ raise Sass::ScriptError, "#{inspect} isn't a valid CSS value."
51
+ end
52
+
53
+ # @return [::String]
54
+ def inspect
55
+ return super unless defined?(@id)
56
+
57
+ 'get-function(<anonymous>)'
58
+ end
59
+
46
60
  # @return [Function]
47
61
  def assert_function(_name = nil)
48
62
  self
@@ -58,6 +58,16 @@ module Sass
58
58
  @contents
59
59
  end
60
60
 
61
+ # @return [Hash<Value, Value>]
62
+ # @raise [ScriptError, ArgumentError, TypeError]
63
+ def to_h(...)
64
+ return super if block_given?
65
+
66
+ super do |element|
67
+ element.is_a?(Sass::Value::List) ? element.to_a : element
68
+ end
69
+ end
70
+
61
71
  # @return [Map, nil]
62
72
  def to_map
63
73
  to_a.empty? ? Sass::Value::Map.new({}) : nil
@@ -51,6 +51,12 @@ module Sass
51
51
  contents.map { |key, value| Sass::Value::List.new([key, value], separator: ' ') }
52
52
  end
53
53
 
54
+ # @return [Hash<Value, Value>]
55
+ # @raise [ScriptError, ArgumentError, TypeError]
56
+ def to_h(...)
57
+ contents.to_h(...)
58
+ end
59
+
54
60
  # @return [Map]
55
61
  def to_map
56
62
  self
@@ -28,6 +28,16 @@ module Sass
28
28
  @hash ||= [compile_context, id].hash
29
29
  end
30
30
 
31
+ # @raise [ScriptError]
32
+ def to_s
33
+ raise Sass::ScriptError, "#{inspect} isn't a valid CSS value."
34
+ end
35
+
36
+ # @return [::String]
37
+ def inspect
38
+ 'get-mixin(<anonymous>)'
39
+ end
40
+
31
41
  # @return [Mixin]
32
42
  def assert_mixin(_name = nil)
33
43
  self
@@ -28,6 +28,16 @@ module Sass
28
28
  @hash ||= [compile_context, id].hash
29
29
  end
30
30
 
31
+ # @raise [ScriptError]
32
+ def to_s
33
+ raise Sass::ScriptError, "#{inspect} isn't a valid CSS value."
34
+ end
35
+
36
+ # @return [::String]
37
+ def inspect
38
+ 'get-module(<anonymous>)'
39
+ end
40
+
31
41
  # @return [Module]
32
42
  def assert_module(_name = nil)
33
43
  self
@@ -30,6 +30,16 @@ module Sass
30
30
  @hash ||= value.hash
31
31
  end
32
32
 
33
+ # @return [::String]
34
+ def to_s
35
+ ''
36
+ end
37
+
38
+ # @return [::String]
39
+ def inspect
40
+ 'null'
41
+ end
42
+
33
43
  # @return [::Boolean]
34
44
  def to_bool # rubocop:disable Naming/PredicateMethod
35
45
  false
@@ -110,7 +110,7 @@ module Sass
110
110
  # @return [Number]
111
111
  # @raise [ScriptError]
112
112
  def assert_unitless(name = nil)
113
- raise Sass::ScriptError.new("Expected #{self} to have no units", name) unless unitless?
113
+ raise Sass::ScriptError.new("Expected #{inspect} to have no units", name) unless unitless?
114
114
 
115
115
  self
116
116
  end
@@ -130,7 +130,7 @@ module Sass
130
130
  # @return [Number]
131
131
  # @raise [ScriptError]
132
132
  def assert_unit(unit, name = nil)
133
- raise Sass::ScriptError.new("Expected #{self} to have unit #{unit.inspect}", name) unless unit?(unit)
133
+ raise Sass::ScriptError.new("Expected #{inspect} to have unit #{unit.inspect}", name) unless unit?(unit)
134
134
 
135
135
  self
136
136
  end
@@ -143,7 +143,7 @@ module Sass
143
143
  # @return [Integer]
144
144
  # @raise [ScriptError]
145
145
  def assert_integer(name = nil)
146
- raise Sass::ScriptError.new("#{self} is not an integer", name) unless integer?
146
+ raise Sass::ScriptError.new("#{inspect} is not an integer", name) unless integer?
147
147
 
148
148
  to_i
149
149
  end
@@ -288,25 +288,25 @@ module Sass
288
288
 
289
289
  compatibility_error = lambda {
290
290
  unless other.nil?
291
- message = "#{self} and"
291
+ message = "#{inspect} and"
292
292
  message << " $#{other_name}:" unless other_name.nil?
293
293
  message << " #{other} have incompatible units"
294
294
  message << " (one has units and the other doesn't)" if unitless? || other_unitless
295
295
  return Sass::ScriptError.new(message, name)
296
296
  end
297
297
 
298
- return Sass::ScriptError.new("Expected #{self} to have no units", name) unless other_unitless
298
+ return Sass::ScriptError.new("Expected #{inspect} to have no units", name) unless other_unitless
299
299
 
300
300
  if new_numerator_units.length == 1 && new_denominator_units.empty?
301
301
  type = Unit::TYPES_BY_UNIT[new_numerator_units.first]
302
302
  return Sass::ScriptError.new(
303
- "Expected #{self} to have a #{type} unit (#{Unit::UNITS_BY_TYPE[type].join(', ')})", name
303
+ "Expected #{inspect} to have a #{type} unit (#{Unit::UNITS_BY_TYPE[type].join(', ')})", name
304
304
  )
305
305
  end
306
306
 
307
307
  unit_length = new_numerator_units.length + new_denominator_units.length
308
308
  units = unit_string(new_numerator_units, new_denominator_units)
309
- Sass::ScriptError.new("Expected #{self} to have unit#{'s' if unit_length > 1} #{units}", name)
309
+ Sass::ScriptError.new("Expected #{inspect} to have unit#{'s' if unit_length > 1} #{units}", name)
310
310
  }
311
311
 
312
312
  result = value
@@ -24,6 +24,16 @@ module Sass
24
24
  @quoted
25
25
  end
26
26
 
27
+ # @return [String]
28
+ # @raise [TypeError]
29
+ def +(other)
30
+ unless other.respond_to?(:to_str)
31
+ raise TypeError, "no implicit conversion of #{other&.class.inspect} into String"
32
+ end
33
+
34
+ Sass::Value::String.new(to_str + other.to_str, quoted: quoted?)
35
+ end
36
+
27
37
  # @return [::Boolean]
28
38
  def ==(other)
29
39
  other.is_a?(Sass::Value::String) && other.text == text
@@ -34,6 +44,18 @@ module Sass
34
44
  @hash ||= text.hash
35
45
  end
36
46
 
47
+ # @return [::String]
48
+ def to_s
49
+ @quoted ? Serializer.serialize_quoted_string(@text) : Serializer.serialize_unquoted_string(@text)
50
+ end
51
+
52
+ alias inspect to_s
53
+
54
+ # @return [::String]
55
+ def to_str
56
+ text.to_str
57
+ end
58
+
37
59
  # @return [String]
38
60
  def assert_string(_name = nil)
39
61
  self
@@ -51,11 +73,6 @@ module Sass
51
73
 
52
74
  index.negative? ? text.length + index : index - 1
53
75
  end
54
-
55
- # @return [::String]
56
- def to_s
57
- @quoted ? Serializer.serialize_quoted_string(@text) : Serializer.serialize_unquoted_string(@text)
58
- end
59
76
  end
60
77
  end
61
78
  end
data/lib/sass/value.rb CHANGED
@@ -37,6 +37,37 @@ module Sass
37
37
  [self]
38
38
  end
39
39
 
40
+ # @return [Hash<Value, Value>]
41
+ # @raise [ScriptError, ArgumentError, TypeError]
42
+ def to_h(...)
43
+ to_a.to_h(...)
44
+ end
45
+
46
+ # @return [::String]
47
+ # @raise [ScriptError]
48
+ def to_s
49
+ s = nil
50
+ Sass.compile_string('$_:o(#{i()});', functions: { # rubocop:disable Lint/InterpolationCheck
51
+ 'i()' => ->(_) { self },
52
+ 'o($s)' => ->(args) { s = args[0].assert_string }
53
+ })
54
+ s.text
55
+ rescue Sass::CompileError => e
56
+ raise Sass::ScriptError.new(e.message), cause: nil
57
+ end
58
+
59
+ # @return [::String]
60
+ def inspect
61
+ s = nil
62
+ Sass.compile_string('@use "sass:meta";$_:o(meta.inspect(i()));', functions: {
63
+ 'i()' => ->(_) { self },
64
+ 'o($s)' => ->(args) { s = args[0].assert_string }
65
+ })
66
+ s.text
67
+ rescue StandardError
68
+ super
69
+ end
70
+
40
71
  # @return [::Boolean]
41
72
  def to_bool # rubocop:disable Naming/PredicateMethod
42
73
  true
@@ -55,55 +86,55 @@ module Sass
55
86
  # @return [Boolean]
56
87
  # @raise [ScriptError]
57
88
  def assert_boolean(name = nil)
58
- raise Sass::ScriptError.new("#{self} is not a boolean", name)
89
+ raise Sass::ScriptError.new("#{inspect} is not a boolean", name)
59
90
  end
60
91
 
61
92
  # @return [Calculation]
62
93
  # @raise [ScriptError]
63
94
  def assert_calculation(name = nil)
64
- raise Sass::ScriptError.new("#{self} is not a calculation", name)
95
+ raise Sass::ScriptError.new("#{inspect} is not a calculation", name)
65
96
  end
66
97
 
67
98
  # @return [Color]
68
99
  # @raise [ScriptError]
69
100
  def assert_color(name = nil)
70
- raise Sass::ScriptError.new("#{self} is not a color", name)
101
+ raise Sass::ScriptError.new("#{inspect} is not a color", name)
71
102
  end
72
103
 
73
104
  # @return [Function]
74
105
  # @raise [ScriptError]
75
106
  def assert_function(name = nil)
76
- raise Sass::ScriptError.new("#{self} is not a function", name)
107
+ raise Sass::ScriptError.new("#{inspect} is not a function", name)
77
108
  end
78
109
 
79
110
  # @return [Map]
80
111
  # @raise [ScriptError]
81
112
  def assert_map(name = nil)
82
- raise Sass::ScriptError.new("#{self} is not a map", name)
113
+ raise Sass::ScriptError.new("#{inspect} is not a map", name)
83
114
  end
84
115
 
85
116
  # @return [Mixin]
86
117
  # @raise [ScriptError]
87
118
  def assert_mixin(name = nil)
88
- raise Sass::ScriptError.new("#{self} is not a mixin", name)
119
+ raise Sass::ScriptError.new("#{inspect} is not a mixin", name)
89
120
  end
90
121
 
91
122
  # @return [Module]
92
123
  # @raise [ScriptError]
93
124
  def assert_module(name = nil)
94
- raise Sass::ScriptError.new("#{self} is not a module", name)
125
+ raise Sass::ScriptError.new("#{inspect} is not a module", name)
95
126
  end
96
127
 
97
128
  # @return [Number]
98
129
  # @raise [ScriptError]
99
130
  def assert_number(name = nil)
100
- raise Sass::ScriptError.new("#{self} is not a number", name)
131
+ raise Sass::ScriptError.new("#{inspect} is not a number", name)
101
132
  end
102
133
 
103
134
  # @return [String]
104
135
  # @raise [ScriptError]
105
136
  def assert_string(name = nil)
106
- raise Sass::ScriptError.new("#{self} is not a string", name)
137
+ raise Sass::ScriptError.new("#{inspect} is not a string", name)
107
138
  end
108
139
 
109
140
  # @param sass_index [Number]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.105.0
4
+ version: 1.105.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
@@ -54,7 +54,7 @@ files:
54
54
  - ext/sass/file_utils.rb
55
55
  - ext/sass/package.json
56
56
  - ext/sass/platform.rb
57
- - ext/sass/sass-1.105.0.tgz
57
+ - ext/sass/sass-1.105.1.tgz
58
58
  - ext/sass/sass_config.rb
59
59
  - ext/sass/utils.rb
60
60
  - lib/sass-embedded.rb
@@ -133,8 +133,8 @@ licenses:
133
133
  - MIT
134
134
  metadata:
135
135
  bug_tracker_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/issues
136
- documentation_uri: https://rubydoc.info/gems/sass-embedded/1.105.0
137
- source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.105.0
136
+ documentation_uri: https://rubydoc.info/gems/sass-embedded/1.105.1
137
+ source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.105.1
138
138
  funding_uri: https://github.com/sponsors/ntkme
139
139
  rubygems_mfa_required: 'true'
140
140
  rdoc_options: []
Binary file