sass-embedded 1.69.4-arm-linux-musleabihf → 1.69.6-arm-linux-musleabihf

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/exe/sass +2 -2
  4. data/ext/sass/dart-sass/src/LICENSE +32 -0
  5. data/ext/sass/dart-sass/src/dart +0 -0
  6. data/ext/sass/dart-sass/src/sass.snapshot +0 -0
  7. data/ext/sass/embedded_sass_pb.rb +1 -1
  8. data/lib/sass/compiler/connection.rb +92 -0
  9. data/lib/sass/{embedded → compiler}/dispatcher.rb +31 -10
  10. data/lib/sass/{embedded → compiler}/host/function_registry.rb +3 -3
  11. data/lib/sass/{embedded → compiler}/host/importer_registry.rb +3 -3
  12. data/lib/sass/{embedded → compiler}/host/logger_registry.rb +1 -1
  13. data/lib/sass/{embedded → compiler}/host/protofier.rb +1 -1
  14. data/lib/sass/{embedded → compiler}/host/structifier.rb +3 -3
  15. data/lib/sass/{embedded → compiler}/host/value_protofier.rb +1 -1
  16. data/lib/sass/{embedded → compiler}/host.rb +15 -13
  17. data/lib/sass/{embedded → compiler}/resilient_dispatcher.rb +5 -4
  18. data/lib/sass/{embedded → compiler}/varint.rb +1 -1
  19. data/lib/sass/compiler.rb +188 -0
  20. data/lib/sass/embedded/version.rb +2 -2
  21. data/lib/sass/embedded.rb +65 -205
  22. data/lib/sass/exception.rb +65 -0
  23. data/lib/sass/fork_tracker.rb +51 -0
  24. data/lib/sass/serializer.rb +73 -0
  25. data/lib/sass/value/argument_list.rb +1 -1
  26. data/lib/sass/value/color.rb +6 -6
  27. data/lib/sass/value/function.rb +1 -1
  28. data/lib/sass/value/map.rb +1 -1
  29. data/lib/sass/value/number.rb +11 -11
  30. data/lib/sass/value.rb +0 -1
  31. metadata +25 -23
  32. data/lib/sass/compile_error.rb +0 -31
  33. data/lib/sass/embedded/connection.rb +0 -68
  34. data/lib/sass/script_error.rb +0 -10
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sass
4
+ # The {Serializer} module.
5
+ module Serializer
6
+ module_function
7
+
8
+ def dump_quoted_string(string)
9
+ include_double_quote = false
10
+ include_single_quote = false
11
+ buffer = [34]
12
+ string.each_codepoint do |codepoint|
13
+ case codepoint
14
+ when 34
15
+ return dump_double_quoted_string(string) if include_single_quote
16
+
17
+ include_double_quote = true
18
+ buffer << 34
19
+ when 39
20
+ return dump_double_quoted_string(string) if include_double_quote
21
+
22
+ include_single_quote = true
23
+ buffer << 39
24
+ when 92
25
+ buffer << 92 << 92
26
+ when 9
27
+ buffer << 9
28
+ else
29
+ if codepoint < 32 || codepoint > 126
30
+ buffer << 92
31
+ buffer.concat(codepoint.to_s(16).codepoints)
32
+ buffer << 32
33
+ else
34
+ buffer << codepoint
35
+ end
36
+ end
37
+ end
38
+ if include_double_quote
39
+ buffer[0] = 39
40
+ buffer << 39
41
+ else
42
+ buffer << 34
43
+ end
44
+ buffer.pack('U*')
45
+ end
46
+
47
+ def dump_double_quoted_string(string)
48
+ buffer = [34]
49
+ string.each_codepoint do |codepoint|
50
+ case codepoint
51
+ when 34
52
+ buffer << 92 << 34
53
+ when 92
54
+ buffer << 92 << 92
55
+ when 9
56
+ buffer << 9
57
+ else
58
+ if codepoint < 32 || codepoint > 126
59
+ buffer << 92
60
+ buffer.concat(codepoint.to_s(16).codepoints)
61
+ buffer << 32
62
+ else
63
+ buffer << codepoint
64
+ end
65
+ end
66
+ end
67
+ buffer << 34
68
+ buffer.pack('U*')
69
+ end
70
+ end
71
+
72
+ private_constant :Serializer
73
+ end
@@ -13,7 +13,7 @@ module Sass
13
13
  # @param keywords [Hash<::String, Value>]
14
14
  # @param separator [::String]
15
15
  def initialize(contents = [], keywords = {}, separator = ',')
16
- super(contents, separator: separator)
16
+ super(contents, separator:)
17
17
 
18
18
  @id = 0
19
19
  @keywords_accessed = false
@@ -50,42 +50,42 @@ module Sass
50
50
 
51
51
  # @return [Integer]
52
52
  def red
53
- hsl_to_rgb unless defined? @red
53
+ hsl_to_rgb unless defined?(@red)
54
54
 
55
55
  @red
56
56
  end
57
57
 
58
58
  # @return [Integer]
59
59
  def green
60
- hsl_to_rgb unless defined? @green
60
+ hsl_to_rgb unless defined?(@green)
61
61
 
62
62
  @green
63
63
  end
64
64
 
65
65
  # @return [Integer]
66
66
  def blue
67
- hsl_to_rgb unless defined? @blue
67
+ hsl_to_rgb unless defined?(@blue)
68
68
 
69
69
  @blue
70
70
  end
71
71
 
72
72
  # @return [Numeric]
73
73
  def hue
74
- rgb_to_hsl unless defined? @hue
74
+ rgb_to_hsl unless defined?(@hue)
75
75
 
76
76
  @hue
77
77
  end
78
78
 
79
79
  # @return [Numeric]
80
80
  def saturation
81
- rgb_to_hsl unless defined? @saturation
81
+ rgb_to_hsl unless defined?(@saturation)
82
82
 
83
83
  @saturation
84
84
  end
85
85
 
86
86
  # @return [Numeric]
87
87
  def lightness
88
- rgb_to_hsl unless defined? @lightness
88
+ rgb_to_hsl unless defined?(@lightness)
89
89
 
90
90
  @lightness
91
91
  end
@@ -29,7 +29,7 @@ module Sass
29
29
  # @return [::Boolean]
30
30
  def ==(other)
31
31
  if id.nil?
32
- other.equal? self
32
+ other.equal?(self)
33
33
  else
34
34
  other.is_a?(Sass::Value::Function) && other.id == id
35
35
  end
@@ -30,7 +30,7 @@ module Sass
30
30
  # @param index [Numeric, Value]
31
31
  # @return [List<(Value, Value)>, Value]
32
32
  def at(index)
33
- if index.is_a? Numeric
33
+ if index.is_a?(Numeric)
34
34
  index = index.floor
35
35
  index = to_a_length + index if index.negative?
36
36
  return nil if index.negative? || index >= to_a_length
@@ -25,12 +25,12 @@ module Sass
25
25
  denominator_units = []
26
26
  when ::Hash
27
27
  numerator_units = unit.fetch(:numerator_units, [])
28
- unless numerator_units.is_a? Array
28
+ unless numerator_units.is_a?(Array)
29
29
  raise Sass::ScriptError, "invalid numerator_units #{numerator_units.inspect}"
30
30
  end
31
31
 
32
32
  denominator_units = unit.fetch(:denominator_units, [])
33
- unless denominator_units.is_a? Array
33
+ unless denominator_units.is_a?(Array)
34
34
  raise Sass::ScriptError, "invalid denominator_units #{denominator_units.inspect}"
35
35
  end
36
36
  else
@@ -75,7 +75,7 @@ module Sass
75
75
 
76
76
  # @return [::Boolean]
77
77
  def ==(other)
78
- return false unless other.is_a? Sass::Value::Number
78
+ return false unless other.is_a?(Sass::Value::Number)
79
79
 
80
80
  return false if numerator_units.length != other.numerator_units.length ||
81
81
  denominator_units.length != other.denominator_units.length
@@ -183,7 +183,7 @@ module Sass
183
183
  def convert_value(new_numerator_units, new_denominator_units, name = nil)
184
184
  coerce_or_convert_value(new_numerator_units, new_denominator_units,
185
185
  coerce_unitless: false,
186
- name: name)
186
+ name:)
187
187
  end
188
188
 
189
189
  # @param other [Number]
@@ -200,9 +200,9 @@ module Sass
200
200
  def convert_value_to_match(other, name = nil, other_name = nil)
201
201
  coerce_or_convert_value(other.numerator_units, other.denominator_units,
202
202
  coerce_unitless: false,
203
- name: name,
204
- other: other,
205
- other_name: other_name)
203
+ name:,
204
+ other:,
205
+ other_name:)
206
206
  end
207
207
 
208
208
  # @param new_numerator_units [Array<::String>]
@@ -221,7 +221,7 @@ module Sass
221
221
  def coerce_value(new_numerator_units, new_denominator_units, name = nil)
222
222
  coerce_or_convert_value(new_numerator_units, new_denominator_units,
223
223
  coerce_unitless: true,
224
- name: name)
224
+ name:)
225
225
  end
226
226
 
227
227
  # @param unit [::String]
@@ -244,9 +244,9 @@ module Sass
244
244
  def coerce_value_to_match(other, name = nil, other_name = nil)
245
245
  coerce_or_convert_value(other.numerator_units, other.denominator_units,
246
246
  coerce_unitless: true,
247
- name: name,
248
- other: other,
249
- other_name: other_name)
247
+ name:,
248
+ other:,
249
+ other_name:)
250
250
  end
251
251
 
252
252
  # @return [Number]
data/lib/sass/value.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'calculation_value'
4
- require_relative 'script_error'
5
4
 
6
5
  module Sass
7
6
  # The abstract base class of Sass's value types.
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.69.4
4
+ version: 1.69.6
5
5
  platform: arm-linux-musleabihf
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-17 00:00:00.000000000 Z
11
+ date: 2023-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.23'
19
+ version: '3.25'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '3.23'
26
+ version: '3.25'
27
27
  description: A Ruby library that will communicate with Embedded Dart Sass using the
28
28
  Embedded Sass protocol.
29
29
  email:
@@ -46,27 +46,29 @@ files:
46
46
  - lib/sass/calculation_value.rb
47
47
  - lib/sass/calculation_value/calculation_operation.rb
48
48
  - lib/sass/canonicalize_context.rb
49
- - lib/sass/compile_error.rb
50
49
  - lib/sass/compile_result.rb
50
+ - lib/sass/compiler.rb
51
+ - lib/sass/compiler/connection.rb
52
+ - lib/sass/compiler/dispatcher.rb
53
+ - lib/sass/compiler/host.rb
54
+ - lib/sass/compiler/host/function_registry.rb
55
+ - lib/sass/compiler/host/importer_registry.rb
56
+ - lib/sass/compiler/host/logger_registry.rb
57
+ - lib/sass/compiler/host/protofier.rb
58
+ - lib/sass/compiler/host/structifier.rb
59
+ - lib/sass/compiler/host/value_protofier.rb
60
+ - lib/sass/compiler/resilient_dispatcher.rb
61
+ - lib/sass/compiler/varint.rb
51
62
  - lib/sass/elf.rb
52
63
  - lib/sass/embedded.rb
53
- - lib/sass/embedded/connection.rb
54
- - lib/sass/embedded/dispatcher.rb
55
- - lib/sass/embedded/host.rb
56
- - lib/sass/embedded/host/function_registry.rb
57
- - lib/sass/embedded/host/importer_registry.rb
58
- - lib/sass/embedded/host/logger_registry.rb
59
- - lib/sass/embedded/host/protofier.rb
60
- - lib/sass/embedded/host/structifier.rb
61
- - lib/sass/embedded/host/value_protofier.rb
62
- - lib/sass/embedded/resilient_dispatcher.rb
63
- - lib/sass/embedded/varint.rb
64
64
  - lib/sass/embedded/version.rb
65
65
  - lib/sass/embedded_protocol.rb
66
+ - lib/sass/exception.rb
67
+ - lib/sass/fork_tracker.rb
66
68
  - lib/sass/logger/silent.rb
67
69
  - lib/sass/logger/source_location.rb
68
70
  - lib/sass/logger/source_span.rb
69
- - lib/sass/script_error.rb
71
+ - lib/sass/serializer.rb
70
72
  - lib/sass/value.rb
71
73
  - lib/sass/value/argument_list.rb
72
74
  - lib/sass/value/boolean.rb
@@ -81,12 +83,12 @@ files:
81
83
  - lib/sass/value/number.rb
82
84
  - lib/sass/value/number/unit.rb
83
85
  - lib/sass/value/string.rb
84
- homepage: https://github.com/ntkme/sass-embedded-host-ruby
86
+ homepage: https://github.com/sass-contrib/sass-embedded-host-ruby
85
87
  licenses:
86
88
  - MIT
87
89
  metadata:
88
- documentation_uri: https://rubydoc.info/gems/sass-embedded/1.69.4
89
- source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.69.4
90
+ documentation_uri: https://rubydoc.info/gems/sass-embedded/1.69.6
91
+ source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.69.6
90
92
  funding_uri: https://github.com/sponsors/ntkme
91
93
  post_install_message:
92
94
  rdoc_options: []
@@ -96,14 +98,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
98
  requirements:
97
99
  - - ">="
98
100
  - !ruby/object:Gem::Version
99
- version: 3.0.0
101
+ version: 3.1.3
100
102
  required_rubygems_version: !ruby/object:Gem::Requirement
101
103
  requirements:
102
104
  - - ">="
103
105
  - !ruby/object:Gem::Version
104
- version: 3.3.22
106
+ version: '0'
105
107
  requirements: []
106
- rubygems_version: 3.4.21
108
+ rubygems_version: 3.5.3
107
109
  signing_key:
108
110
  specification_version: 4
109
111
  summary: Use dart-sass with Ruby!
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Sass
4
- # An exception thrown because a Sass compilation failed.
5
- class CompileError < StandardError
6
- # @return [String, nil]
7
- attr_reader :sass_stack
8
-
9
- # @return [Logger::SourceSpan, nil]
10
- attr_reader :span
11
-
12
- # @return [Array<String>]
13
- attr_reader :loaded_urls
14
-
15
- # @!visibility private
16
- def initialize(message, full_message, sass_stack, span, loaded_urls)
17
- super(message)
18
- @full_message = full_message
19
- @sass_stack = sass_stack
20
- @span = span
21
- @loaded_urls = loaded_urls
22
- end
23
-
24
- # @return [String]
25
- def full_message(...)
26
- return super(...) if @full_message.nil?
27
-
28
- @full_message = +@full_message
29
- end
30
- end
31
- end
@@ -1,68 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'open3'
4
-
5
- require_relative '../../../ext/sass/cli'
6
-
7
- module Sass
8
- class Embedded
9
- # The stdio based {Connection} between the {Dispatcher} and the compiler.
10
- #
11
- # It runs the `sass --embedded` command.
12
- class Connection
13
- def initialize(dispatcher)
14
- @stdin, stdout, stderr, @wait_thread = begin
15
- Open3.popen3(*CLI::COMMAND, '--embedded', chdir: __dir__)
16
- rescue Errno::ENOENT
17
- require_relative '../elf'
18
-
19
- raise if ELF::INTERPRETER.nil?
20
-
21
- Open3.popen3(ELF::INTERPRETER, *CLI::COMMAND, '--embedded', chdir: __dir__)
22
- end
23
- @stdin.binmode
24
-
25
- Thread.new do
26
- stdout.binmode
27
- loop do
28
- length = Varint.read(stdout)
29
- id = Varint.read(stdout)
30
- proto = stdout.read(length - Varint.length(id))
31
- dispatcher.receive_proto(id, proto)
32
- rescue IOError, Errno::EBADF, Errno::EPROTO => e
33
- dispatcher.error(e)
34
- break
35
- end
36
- stdout.close
37
- end
38
-
39
- Thread.new do
40
- loop do
41
- warn(stderr.readline, uplevel: 1)
42
- rescue IOError, Errno::EBADF
43
- break
44
- end
45
- stderr.close
46
- end
47
- end
48
-
49
- def close
50
- @stdin.close
51
- @wait_thread.join
52
- end
53
-
54
- def closed?
55
- @stdin.closed? && !@wait_thread.alive?
56
- end
57
-
58
- def write(id, proto)
59
- buffer = []
60
- Varint.write(buffer, Varint.length(id) + proto.length)
61
- Varint.write(buffer, id)
62
- @stdin.write(buffer.pack('C*'), proto)
63
- end
64
- end
65
-
66
- private_constant :Connection
67
- end
68
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Sass
4
- # An exception thrown by Sass Script.
5
- class ScriptError < StandardError
6
- def initialize(message, name = nil)
7
- super(name.nil? ? message : "$#{name}: #{message}")
8
- end
9
- end
10
- end