sass-embedded 1.0.0 → 1.0.3

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: 42eb14d20db4890ec57583655ac03f7ccedd413af931581909a874e020cb3a8b
4
- data.tar.gz: bf36fc0fc518277b4693f18452d30e06d39e52677041d9926471af2db6db34b6
3
+ metadata.gz: 62088f9ce8ff61f56c3191f1d7f941779f92583975db9b763a88f99c0255e8e3
4
+ data.tar.gz: 3db4302a699a5b014b271f809a9e3f32e94ae5c841ff114bc2d37bcff1563d43
5
5
  SHA512:
6
- metadata.gz: de5f8d48c8222c65fd4428136d3dd68f5d468942e258ce5d12b151b50e141d3a00ae37e6c1ca4b3ad696e74a56d56fc9508614a9d1e63913e904046451ef2cef
7
- data.tar.gz: 61200f58afacf595f8ab4e7ef96e526fea49ff83573239c46a6ca6a5f000a3f4419b1183a32d12e6a6b4d2cf9dc1a81a5856c1b63180430ed0432d4a9c832668
6
+ metadata.gz: b1eb7486f98a12739ce4b9f19cacc3a13b96e005c6a5cf74053baad538375f5d2c3180a85cfa5b7b264ffda1c8e89ec72ae9f83fc3701ea114ffcdbedf59e3a8
7
+ data.tar.gz: 47d6f81a0617b759b9ca605ee645245197d9ff5e05da6a6ecce93c13fce8d77cd9e8f7c68f61a2da85f6b0e9ca2fd96a6527d842bf9be88bf62ac83e792ef693
data/ext/sass/Makefile CHANGED
@@ -6,18 +6,18 @@ endif
6
6
  EXTCONF = ruby -- extconf.rb
7
7
 
8
8
  .PHONY: all
9
- all: sass_embedded embedded_sass_pb.rb
9
+ all: embedded_sass_pb.rb sass_embedded
10
10
 
11
11
  .PHONY: install
12
- install:
12
+ install: clean
13
+
14
+ .PHONY: uninstall
15
+ uninstall:
16
+ $(RM) embedded_sass_pb.rb sass_embedded
13
17
 
14
18
  .PHONY: clean
15
19
  clean:
16
- $(RM) embedded_sass_pb.rb protoc sass_embedded
17
-
18
- .PHONY: distclean
19
- distclean: clean
20
- $(RM) embedded_sass.proto protoc-*.zip sass_embedded-*.tar.gz
20
+ $(RM) embedded_sass.proto protoc protoc-* sass_embedded-*
21
21
 
22
22
  ifeq ($(OS),Windows_NT)
23
23
  sass_embedded-*.zip:
data/ext/sass/extconf.rb CHANGED
@@ -106,15 +106,15 @@ module Sass
106
106
 
107
107
  def fetch(uri_s)
108
108
  uri = URI.parse(uri_s)
109
- path = File.absolute_path(File.basename(uri.path), __dir__)
109
+ path = URI::DEFAULT_PARSER.unescape(uri.path)
110
+ dest = File.absolute_path(File.basename(path), __dir__)
110
111
  if uri.is_a?(URI::File) || uri.instance_of?(URI::Generic)
111
- source = uri_parser.unescape(uri.path)
112
- puts "cp -- #{source} #{path}"
113
- FileUtils.copy_file(source, path)
112
+ puts "cp -- #{path} #{dest}"
113
+ FileUtils.copy_file(path, dest)
114
114
  elsif uri.respond_to? :open
115
- puts "curl -fsSLo #{path} -- #{uri}"
115
+ puts "curl -fsSLo #{dest} -- #{uri}"
116
116
  uri.open do |stream|
117
- File.binwrite(path, stream.read)
117
+ File.binwrite(dest, stream.read)
118
118
  end
119
119
  else
120
120
  raise
@@ -123,10 +123,6 @@ module Sass
123
123
  raise "Failed to fetch #{uri_s}"
124
124
  end
125
125
 
126
- def uri_parser
127
- @uri_parser ||= URI::Parser.new({ RESERVED: ';/?:@&=+$,' })
128
- end
129
-
130
126
  def default_sass_embedded
131
127
  repo = 'sass/dart-sass-embedded'
132
128
 
@@ -214,7 +210,7 @@ module Sass
214
210
 
215
211
  ext = 'zip'
216
212
 
217
- "https://github.com/#{repo}/releases/download/#{tag_name}/protoc-#{tag_name[1..]}-#{os_arch}.#{ext}"
213
+ "https://github.com/#{repo}/releases/download/#{tag_name}/protoc-#{tag_name.delete_prefix('v')}-#{os_arch}.#{ext}"
218
214
  end
219
215
 
220
216
  def default_sass_embedded_protocol
@@ -49,7 +49,7 @@ module Sass
49
49
 
50
50
  success = value_protofier.to_proto(get(function_call_request).call(arguments))
51
51
  accessed_argument_lists = arguments
52
- .filter do |argument|
52
+ .select do |argument|
53
53
  argument.is_a?(Sass::Value::ArgumentList) && argument.instance_eval do
54
54
  @keywords_accessed
55
55
  end
@@ -29,7 +29,7 @@ module Sass
29
29
  )
30
30
  )
31
31
  when Sass::Value::Color
32
- if obj.instance_eval { @hue.nil? }
32
+ if obj.instance_eval { !defined?(@hue) }
33
33
  Sass::EmbeddedProtocol::Value.new(
34
34
  rgb_color: Sass::EmbeddedProtocol::Value::RgbColor.new(
35
35
  red: obj.red,
@@ -38,7 +38,7 @@ module Sass
38
38
  alpha: obj.alpha.to_f
39
39
  )
40
40
  )
41
- elsif obj.instance_eval { @saturation.nil? }
41
+ elsif obj.instance_eval { !defined?(@saturation) }
42
42
  Sass::EmbeddedProtocol::Value.new(
43
43
  hwb_color: Sass::EmbeddedProtocol::Value::HwbColor.new(
44
44
  hue: obj.hue.to_f,
@@ -8,6 +8,7 @@ module Sass
8
8
  class Host
9
9
  def initialize(channel)
10
10
  @channel = channel
11
+ @mutex = Mutex.new
11
12
  end
12
13
 
13
14
  def id
@@ -118,14 +119,16 @@ module Sass
118
119
  private
119
120
 
120
121
  def await
121
- raise EOFError unless @async.nil?
122
-
123
- @connection = @channel.connect(self)
124
- @async = Async.new
125
- yield
126
- @async.await
127
- ensure
128
- @connection.disconnect
122
+ @mutex.synchronize do
123
+ raise EOFError if defined? @async
124
+
125
+ @connection = @channel.connect(self)
126
+ @async = Async.new
127
+ yield
128
+ @async.await
129
+ ensure
130
+ @connection.disconnect
131
+ end
129
132
  end
130
133
  end
131
134
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  class Embedded
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.3'
6
6
  end
7
7
  end
@@ -70,37 +70,37 @@ module Sass
70
70
  end
71
71
 
72
72
  def red
73
- hsl_to_rgb if @red.nil?
73
+ hsl_to_rgb unless defined? @red
74
74
 
75
75
  @red
76
76
  end
77
77
 
78
78
  def green
79
- hsl_to_rgb if @green.nil?
79
+ hsl_to_rgb unless defined? @green
80
80
 
81
81
  @green
82
82
  end
83
83
 
84
84
  def blue
85
- hsl_to_rgb if @blue.nil?
85
+ hsl_to_rgb unless defined? @blue
86
86
 
87
87
  @blue
88
88
  end
89
89
 
90
90
  def hue
91
- rgb_to_hsl if @hue.nil?
91
+ rgb_to_hsl unless defined? @hue
92
92
 
93
93
  @hue
94
94
  end
95
95
 
96
96
  def saturation
97
- rgb_to_hsl if @saturation.nil?
97
+ rgb_to_hsl unless defined? @saturation
98
98
 
99
99
  @saturation
100
100
  end
101
101
 
102
102
  def lightness
103
- rgb_to_hsl if @lightness.nil?
103
+ rgb_to_hsl unless defined? @lightness
104
104
 
105
105
  @lightness
106
106
  end
data/lib/sass.rb CHANGED
@@ -77,13 +77,13 @@ module Sass
77
77
  private
78
78
 
79
79
  def instance
80
- if @instance.nil?
80
+ if defined? @instance
81
+ @instance = Embedded.new if @instance.closed?
82
+ else
81
83
  @instance = Embedded.new
82
84
  at_exit do
83
85
  @instance.close
84
86
  end
85
- elsif @instance.closed?
86
- @instance = Embedded.new
87
87
  end
88
88
  @instance
89
89
  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.0.0
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-25 00:00:00.000000000 Z
11
+ date: 2022-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -162,8 +162,8 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
162
162
  licenses:
163
163
  - MIT
164
164
  metadata:
165
- documentation_uri: https://www.rubydoc.info/gems/sass-embedded/1.0.0
166
- source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.0.0
165
+ documentation_uri: https://www.rubydoc.info/gems/sass-embedded/1.0.3
166
+ source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.0.3
167
167
  funding_uri: https://github.com/sponsors/ntkme
168
168
  post_install_message:
169
169
  rdoc_options: []