sass-embedded 1.64.0 → 1.64.2

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: d6ab7f4ccdb57babfe8dc2af27348ef74956b60b6051389839211004aee50b4a
4
- data.tar.gz: f423e6703e1beeaaf12d87c2085f2f918812ac6eed6639b939108128abf5b0b1
3
+ metadata.gz: 8ad47619555545c26106956262a00b251d6f6f7c736c86ea8e634f88f58afef2
4
+ data.tar.gz: 1c25d4bb801671dfa714ba3cd6e2df8f0ff75151ec34eeae6f4616d7dffdaacc
5
5
  SHA512:
6
- metadata.gz: df45e1d1804557bd66f0062f4c46f015f74f9ade4349bf0094c61557d32ae2f0b26aea707e449e722d629b41e866ffa0a67fba24d15a1ce5cfc5119ecd7f9261
7
- data.tar.gz: 5eec5885c830ad9d5d2e68ce637c3754c22186da39aa8c12353e38d38ed80748cacbe4b6cf3f2a566950e65fbcff8f8c3852de41657c2a9c8b305c75ec2062ec
6
+ metadata.gz: daa146506e5dc03f2569316a6a1df7b58784d8f7a503bf595c5c30b1e9aee496ed579dc03dd3e541038d2921f4b5fe69a50c597618bf14676385061f998ede12
7
+ data.tar.gz: 84741c2ce654be853b96e627299d0f325b91e14cfda693238e10b18ad899ba2b2286438c9880bacb5b5175a1c001231d9f4fc757035d4f997f79908099a03036
data/ext/sass/Rakefile CHANGED
@@ -413,10 +413,10 @@ module SassConfig
413
413
  end
414
414
 
415
415
  def gem_platform
416
- platform = Gem::Platform.new("#{RbConfig::CONFIG['host_cpu']}-#{RbConfig::CONFIG['host_os']}")
416
+ platform = Gem::Platform.new("#{Platform::EMULATION || Platform::CPU}-#{RbConfig::CONFIG['host_os']}")
417
417
  case Platform::OS
418
418
  when 'darwin'
419
- Gem::Platform.new([platform.cpu, platform.os])
419
+ Gem::Platform.new([RbConfig::CONFIG['host_cpu'], platform.os])
420
420
  when 'linux'
421
421
  if platform.version&.start_with?('gnu')
422
422
  platform
@@ -424,11 +424,9 @@ module SassConfig
424
424
  Gem::Platform.new([platform.cpu, platform.os, "gnu#{platform.version}"])
425
425
  end
426
426
  when 'windows'
427
- case Platform::EMULATION || Platform::CPU
427
+ case platform.cpu
428
428
  when 'x86_64'
429
429
  Gem::Platform.new('x64-mingw32')
430
- when 'i386'
431
- Gem::Platform.new('x86-mingw32')
432
430
  else
433
431
  Gem::Platform.new([platform.cpu, 'mingw32'])
434
432
  end
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "dependencies": {
3
- "sass": "1.64.0"
3
+ "sass": "1.64.2"
4
4
  }
5
5
  }
@@ -230,39 +230,11 @@ module Sass
230
230
  end
231
231
 
232
232
  def from_proto(obj)
233
- case obj.name
234
- when 'calc'
235
- if obj.arguments.length != 1
236
- raise Sass::ScriptError,
237
- 'Value.Calculation.arguments must have exactly one argument for calc().'
238
- end
239
-
240
- Sass::Value::Calculation.calc(*obj.arguments.map { |argument| CalculationValue.from_proto(argument) })
241
- when 'clamp'
242
- if obj.arguments.length != 3
243
- raise Sass::ScriptError,
244
- 'Value.Calculation.arguments must have exactly 3 arguments for clamp().'
245
- end
246
-
247
- Sass::Value::Calculation.clamp(*obj.arguments.map { |argument| CalculationValue.from_proto(argument) })
248
- when 'min'
249
- if obj.arguments.empty?
250
- raise Sass::ScriptError,
251
- 'Value.Calculation.arguments must have at least 1 argument for min().'
252
- end
253
-
254
- Sass::Value::Calculation.min(obj.arguments.map { |argument| CalculationValue.from_proto(argument) })
255
- when 'max'
256
- if obj.arguments.empty?
257
- raise Sass::ScriptError,
258
- 'Value.Calculation.arguments must have at least 1 argument for max().'
259
- end
260
-
261
- Sass::Value::Calculation.max(obj.arguments.map { |argument| CalculationValue.from_proto(argument) })
262
- else
263
- raise Sass::ScriptError,
264
- "Value.Calculation.name #{calculation.name.inspect} is not a recognized calculation type."
265
- end
233
+ Sass::Value::Calculation.send(
234
+ :new,
235
+ obj.name,
236
+ obj.arguments.map { |argument| CalculationValue.from_proto(argument) }
237
+ )
266
238
  end
267
239
  end
268
240
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  class Embedded
5
- VERSION = '1.64.0'
5
+ VERSION = '1.64.2'
6
6
  end
7
7
  end
@@ -9,38 +9,24 @@ module Sass
9
9
  include Value
10
10
  include CalculationValue
11
11
 
12
- def initialize(name, arguments)
13
- @name = name.freeze
14
- @arguments = arguments.freeze
15
- end
16
-
17
- # @return [::String]
18
- attr_reader :name
19
-
20
- # @return [Array<CalculationValue>]
21
- attr_reader :arguments
22
-
23
- private_class_method :new
24
-
25
12
  class << self
13
+ private :new
14
+
26
15
  # @param argument [CalculationValue]
27
16
  # @return [Calculation]
28
17
  def calc(argument)
29
- argument.assert_calculation_value
30
18
  new('calc', [argument])
31
19
  end
32
20
 
33
21
  # @param arguments [Array<CalculationValue>]
34
22
  # @return [Calculation]
35
23
  def min(arguments)
36
- arguments.each(&:assert_calculation_value)
37
24
  new('min', arguments)
38
25
  end
39
26
 
40
27
  # @param arguments [Array<CalculationValue>]
41
28
  # @return [Calculation]
42
29
  def max(arguments)
43
- arguments.each(&:assert_calculation_value)
44
30
  new('max', arguments)
45
31
  end
46
32
 
@@ -54,11 +40,7 @@ module Sass
54
40
  raise Sass::ScriptError, 'Argument must be an unquoted SassString or CalculationInterpolation.'
55
41
  end
56
42
 
57
- arguments = [min]
58
- arguments.push(value) unless value.nil?
59
- arguments.push(max) unless max.nil?
60
- arguments.each(&:assert_calculation_value)
61
- new('clamp', arguments)
43
+ new('clamp', [min, value, max].compact)
62
44
  end
63
45
 
64
46
  private
@@ -69,6 +51,23 @@ module Sass
69
51
  end
70
52
  end
71
53
 
54
+ private
55
+
56
+ def initialize(name, arguments)
57
+ arguments.each(&:assert_calculation_value)
58
+
59
+ @name = name.freeze
60
+ @arguments = arguments.freeze
61
+ end
62
+
63
+ public
64
+
65
+ # @return [::String]
66
+ attr_reader :name
67
+
68
+ # @return [Array<CalculationValue>]
69
+ attr_reader :arguments
70
+
72
71
  # @return [Calculation]
73
72
  def assert_calculation(_name = nil)
74
73
  self
@@ -41,8 +41,8 @@ module Sass
41
41
 
42
42
  # @return [CalculationValue]
43
43
  # @raise [ScriptError]
44
- def assert_calculation_value(_name = nil)
45
- raise Sass::ScriptError, "Expected #{self} to be an unquoted string." if quoted?
44
+ def assert_calculation_value(name = nil)
45
+ raise Sass::ScriptError.new("Expected #{self} to be an unquoted string.", name) if quoted?
46
46
 
47
47
  self
48
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.64.0
4
+ version: 1.64.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-20 00:00:00.000000000 Z
11
+ date: 2023-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -98,8 +98,8 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
98
98
  licenses:
99
99
  - MIT
100
100
  metadata:
101
- documentation_uri: https://rubydoc.info/gems/sass-embedded/1.64.0
102
- source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.64.0
101
+ documentation_uri: https://rubydoc.info/gems/sass-embedded/1.64.2
102
+ source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.64.2
103
103
  funding_uri: https://github.com/sponsors/ntkme
104
104
  post_install_message:
105
105
  rdoc_options: []