sass-embedded 0.7.13 → 0.7.17

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: 103336d18b4ff3eba9898df0ee3dc4c28b7f3e9ab81d8548b1665f1636a518ed
4
- data.tar.gz: 9cba67666361efb314c98798a3de2fc9370e5a6eb0c42b3fdbab96fc4f64a566
3
+ metadata.gz: ab9e58a331ab32c7ac7842a49200124f034125b8c53ec98abf6f28c8d90950bf
4
+ data.tar.gz: c29daf3c44f78f0426785d32d23088ba18363f4c8298f1cfef5bd434ec509285
5
5
  SHA512:
6
- metadata.gz: e3d2307ce9fdaaf8635c8803e24a85aa82a3a1ee8b72e5284fe282adc28cb20ee69f9f7a3612ecc5a4e09423034a3d0dc680c47d7eebe489f806da916d85532e
7
- data.tar.gz: c105838b5b082e657acc917600c0b7fb664e53541800ebda1f4fcd1b44be2f16c3849d06b34c1ba19e82c029144f264d22dacdb678d928cee3a210ba8d90b89d
6
+ metadata.gz: 35373b7a328421190d33408781b4cbb46eb9552b44b4f9c6fe7f198e70b4d9308988e234b08412e2d3e4d63adf4cef610fec6746f03a9cded99a7066dca474d1
7
+ data.tar.gz: 50dea130d22068359ec76c874318059508f91a01f11d78050a00d4c36fe0d5e406a03b6c0952239edd76d2638a5f177e89830682b32fda7ea15104bfee089b01
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Embedded Sass Host for Ruby
2
2
 
3
3
  [![build](https://github.com/ntkme/embedded-host-ruby/actions/workflows/build.yml/badge.svg)](https://github.com/ntkme/embedded-host-ruby/actions/workflows/build.yml)
4
+ [![gem](https://badge.fury.io/rb/sass-embedded.svg)](https://rubygems.org/gems/sass-embedded)
4
5
 
5
6
  This is a Ruby library that implements the host side of the [Embedded Sass protocol](https://github.com/sass/sass-embedded-protocol).
6
7
 
data/ext/dependencies.rb CHANGED
@@ -5,7 +5,7 @@ module Sass
5
5
  REQUIREMENTS = {
6
6
  'protocolbuffers/protobuf' => '~> 3.17',
7
7
  'sass/embedded-protocol' => '~> 1.0.0-beta.12',
8
- 'sass/dart-sass-embedded' => '~> 1.0.0-beta.9'
8
+ 'sass/dart-sass-embedded' => '~> 1.0.0-beta.10'
9
9
  }.freeze
10
10
  end
11
11
  end
data/lib/sass/compile.rb CHANGED
@@ -161,9 +161,13 @@ module Sass
161
161
  end
162
162
 
163
163
  def function_call_response(function_call_request)
164
+ # TODO: convert argument_list to **kwargs
164
165
  EmbeddedProtocol::InboundMessage::FunctionCallResponse.new(
165
166
  id: function_call_request.id,
166
- success: @functions[function_call_request.name].call(*function_call_request.arguments)
167
+ success: @functions[function_call_request.name].call(*function_call_request.arguments),
168
+ accessed_argument_lists: function_call_request.arguments
169
+ .filter { |argument| argument.value == :argument_list }
170
+ .map { |argument| argument.argument_list.id }
167
171
  )
168
172
  rescue StandardError => e
169
173
  EmbeddedProtocol::InboundMessage::FunctionCallResponse.new(
@@ -30,6 +30,9 @@ module Sass
30
30
  @observerable_mutex = Mutex.new
31
31
  @stdin_mutex = Mutex.new
32
32
  @stdin, @stdout, @stderr, @wait_thread = Open3.popen3(DART_SASS_EMBEDDED)
33
+
34
+ [@stdin, @stdout].each(&:binmode)
35
+
33
36
  poll do
34
37
  warn(@stderr.readline, uplevel: 1)
35
38
  end
@@ -107,21 +110,24 @@ module Sass
107
110
  end
108
111
 
109
112
  def read_varint(readable)
110
- varint = bits = 0
113
+ value = bits = 0
111
114
  loop do
112
115
  byte = readable.readbyte
113
- varint += (byte & 0x7f) << bits
116
+ value |= (byte & 0x7f) << bits
114
117
  bits += 7
115
- break if byte <= 0x7f
118
+ break if byte < 0x80
116
119
  end
117
- varint
120
+ value
118
121
  end
119
122
 
120
- def write_varint(writeable, varint)
121
- while varint.positive?
122
- writeable.write ((varint > 0x7f ? 0x80 : 0) | (varint & 0x7f)).chr
123
- varint >>= 7
123
+ def write_varint(writeable, value)
124
+ bytes = []
125
+ until value < 0x80
126
+ bytes << (0x80 | (value & 0x7f))
127
+ value >>= 7
124
128
  end
129
+ bytes << value
130
+ writeable.write bytes.pack('C*')
125
131
  end
126
132
  end
127
133
  end
data/lib/sass/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sass
4
- VERSION = '0.7.13'
4
+ VERSION = '0.7.17'
5
5
  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: 0.7.13
4
+ version: 0.7.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-20 00:00:00.000000000 Z
11
+ date: 2021-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -166,7 +166,7 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
166
166
  licenses:
167
167
  - MIT
168
168
  metadata:
169
- source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.7.13
169
+ source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.7.17
170
170
  post_install_message:
171
171
  rdoc_options: []
172
172
  require_paths: