sass-embedded 1.0.2 → 1.0.5
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 +4 -4
- data/ext/sass/Makefile +5 -5
- data/ext/sass/extconf.rb +19 -6
- data/lib/sass/embedded/host/value_protofier.rb +2 -2
- data/lib/sass/embedded/host.rb +11 -8
- data/lib/sass/embedded/version.rb +1 -1
- data/lib/sass/value/color.rb +6 -6
- data/lib/sass.rb +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d191baae4f4080d338f5dd27a96165515160e78fb83390550fedbd683bdc8ae
|
4
|
+
data.tar.gz: 8e7323fbb7a3408e58a1b1c9db09b2858d6809b54675370d50a01401a5638716
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e6a68bfb1068e58483198d7d5b5dd5cdb742f06fbfc39557a7dc367dcef183a6c0b38631e6749ff4f3dc19d9b853644ea46602a81e7ac37a655c8cd864448b7
|
7
|
+
data.tar.gz: f23fcefbcb06b6235e35c41298e2204d8b4397222f41e19f567d3b0550486655d9d2745bd08f7864d7333c238c5eb0d41d9dbe3e75edc24d2b4bfc61b5a5e049
|
data/ext/sass/Makefile
CHANGED
@@ -9,14 +9,14 @@ EXTCONF = ruby -- extconf.rb
|
|
9
9
|
all: embedded_sass_pb.rb sass_embedded
|
10
10
|
|
11
11
|
.PHONY: install
|
12
|
-
install:
|
13
|
-
|
14
|
-
.PHONY: uninstall
|
15
|
-
uninstall:
|
16
|
-
$(RM) embedded_sass_pb.rb sass_embedded
|
12
|
+
install: distclean
|
17
13
|
|
18
14
|
.PHONY: clean
|
19
15
|
clean:
|
16
|
+
$(RM) embedded_sass_pb.rb sass_embedded
|
17
|
+
|
18
|
+
.PHONY: distclean
|
19
|
+
distclean:
|
20
20
|
$(RM) embedded_sass.proto protoc protoc-* sass_embedded-*
|
21
21
|
|
22
22
|
ifeq ($(OS),Windows_NT)
|
data/ext/sass/extconf.rb
CHANGED
@@ -104,14 +104,27 @@ module Sass
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
def fetch(
|
108
|
-
|
109
|
-
|
107
|
+
def fetch(uri_or_path)
|
108
|
+
begin
|
109
|
+
uri = URI.parse(uri_or_path)
|
110
|
+
path = URI::DEFAULT_PARSER.unescape(uri.path)
|
111
|
+
if uri.instance_of?(URI::File) || uri.instance_of?(URI::Generic)
|
112
|
+
path = path.delete_prefix('/') if Platform::OS == 'windows' && !File.file?(path)
|
113
|
+
raise unless File.file?(path)
|
114
|
+
end
|
115
|
+
rescue StandardError
|
116
|
+
raise unless File.file?(uri_or_path)
|
117
|
+
|
118
|
+
uri = nil
|
119
|
+
path = uri_or_path
|
120
|
+
end
|
121
|
+
|
110
122
|
dest = File.absolute_path(File.basename(path), __dir__)
|
111
|
-
|
123
|
+
|
124
|
+
if uri.nil? || uri.instance_of?(URI::File) || uri.instance_of?(URI::Generic)
|
112
125
|
puts "cp -- #{path} #{dest}"
|
113
126
|
FileUtils.copy_file(path, dest)
|
114
|
-
elsif uri.respond_to?
|
127
|
+
elsif uri.respond_to?(:open)
|
115
128
|
puts "curl -fsSLo #{dest} -- #{uri}"
|
116
129
|
uri.open do |stream|
|
117
130
|
File.binwrite(dest, stream.read)
|
@@ -120,7 +133,7 @@ module Sass
|
|
120
133
|
raise
|
121
134
|
end
|
122
135
|
rescue StandardError
|
123
|
-
raise "Failed to fetch #{
|
136
|
+
raise "Failed to fetch #{uri_or_path}"
|
124
137
|
end
|
125
138
|
|
126
139
|
def default_sass_embedded
|
@@ -29,7 +29,7 @@ module Sass
|
|
29
29
|
)
|
30
30
|
)
|
31
31
|
when Sass::Value::Color
|
32
|
-
if obj.instance_eval { @hue
|
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
|
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,
|
data/lib/sass/embedded/host.rb
CHANGED
@@ -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
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
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
|
|
data/lib/sass/value/color.rb
CHANGED
@@ -70,37 +70,37 @@ module Sass
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def red
|
73
|
-
hsl_to_rgb
|
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
|
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
|
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
|
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
|
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
|
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
|
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.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- なつき
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-28 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.
|
166
|
-
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.0.
|
165
|
+
documentation_uri: https://www.rubydoc.info/gems/sass-embedded/1.0.5
|
166
|
+
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.0.5
|
167
167
|
funding_uri: https://github.com/sponsors/ntkme
|
168
168
|
post_install_message:
|
169
169
|
rdoc_options: []
|