sass-embedded 0.7.7 → 0.7.11
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/extconf.rb +31 -17
- data/lib/sass.rb +1 -1
- data/lib/sass/{render.rb → compile.rb} +1 -1
- data/lib/sass/embedded.rb +10 -10
- data/lib/sass/transport.rb +3 -5
- data/lib/sass/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f134ae1ed21b1641b3c781ed7dc7c901c059ce3a8c9ac7038f4ee5f2ae9d313
|
4
|
+
data.tar.gz: 3c4758ba9de6440b17acca78d23d9b60ffd7b6683462168bd44f1aff0f466ded
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbe0c28c51e406f51262ca10bffe6453caa73badc17cbfa61938030bbf94c9a1d9747dacde5471a28b9403409082da526815b5c23f37d0ade1844fd06cfd3ad2
|
7
|
+
data.tar.gz: d57f31a01741d59aa49bbf74be30d41f0da85f26b9d555e8a60695f9490a74e5043e9c7e6e148e6bf9d7fe5a740ea7e9cd34725f52ec68d46998b9a9a0b3cf8b
|
data/ext/extconf.rb
CHANGED
@@ -52,6 +52,7 @@ module Sass
|
|
52
52
|
if uri.is_a?(URI::File) || uri.instance_of?(URI::Generic)
|
53
53
|
FileUtils.copy_file uri.path, path
|
54
54
|
elsif uri.respond_to? :open
|
55
|
+
puts "curl -fsSLo #{path} -- #{uri}"
|
55
56
|
uri.open do |source|
|
56
57
|
File.open(path, 'wb') do |destination|
|
57
58
|
destination.write source.read
|
@@ -64,12 +65,18 @@ module Sass
|
|
64
65
|
raise "Failed to get: #{uri}"
|
65
66
|
end
|
66
67
|
|
67
|
-
def latest_release(repo, prerelease: false)
|
68
|
-
if prerelease
|
68
|
+
def latest_release(repo, prerelease: false, tag: false)
|
69
|
+
if prerelease || tag
|
69
70
|
headers = {}
|
70
71
|
headers['Authorization'] = "token #{ENV['GITHUB_TOKEN']}" if ENV['GITHUB_TOKEN']
|
71
|
-
|
72
|
-
|
72
|
+
if tag
|
73
|
+
URI.parse("https://api.github.com/repos/#{repo}/tags").open(headers) do |file|
|
74
|
+
JSON.parse(file.read)[0]['name']
|
75
|
+
end
|
76
|
+
else
|
77
|
+
URI.parse("https://api.github.com/repos/#{repo}/releases").open(headers) do |file|
|
78
|
+
JSON.parse(file.read)[0]['tag_name']
|
79
|
+
end
|
73
80
|
end
|
74
81
|
else
|
75
82
|
URI.parse("https://github.com/#{repo}/releases/latest").open do |file|
|
@@ -81,10 +88,10 @@ module Sass
|
|
81
88
|
def latest_sass_embedded
|
82
89
|
repo = 'sass/dart-sass-embedded'
|
83
90
|
|
84
|
-
# TODO
|
91
|
+
# TODO: don't use prerelease once a release is available
|
85
92
|
tag_name = latest_release repo, prerelease: true
|
86
93
|
|
87
|
-
os = case
|
94
|
+
os = case Platform::OS
|
88
95
|
when 'darwin'
|
89
96
|
'macos'
|
90
97
|
when 'linux'
|
@@ -92,16 +99,20 @@ module Sass
|
|
92
99
|
when 'windows'
|
93
100
|
'windows'
|
94
101
|
else
|
95
|
-
raise "Unsupported OS: #{
|
102
|
+
raise "Unsupported OS: #{Platform::OS}"
|
96
103
|
end
|
97
104
|
|
98
|
-
arch = case
|
105
|
+
arch = case Platform::ARCH
|
99
106
|
when 'x86_64'
|
100
107
|
'x64'
|
101
108
|
when 'i386'
|
102
109
|
'ia32'
|
110
|
+
when 'aarch64'
|
111
|
+
raise "Unsupported Arch: #{Platform::ARCH}" unless Platform::OS == 'darwin'
|
112
|
+
|
113
|
+
'x64'
|
103
114
|
else
|
104
|
-
raise "Unsupported Arch: #{
|
115
|
+
raise "Unsupported Arch: #{Platform::ARCH}"
|
105
116
|
end
|
106
117
|
|
107
118
|
ext = case os
|
@@ -119,7 +130,7 @@ module Sass
|
|
119
130
|
|
120
131
|
tag_name = latest_release repo
|
121
132
|
|
122
|
-
os = case
|
133
|
+
os = case Platform::OS
|
123
134
|
when 'darwin'
|
124
135
|
'osx'
|
125
136
|
when 'linux'
|
@@ -127,12 +138,16 @@ module Sass
|
|
127
138
|
when 'windows'
|
128
139
|
'win'
|
129
140
|
else
|
130
|
-
raise "Unsupported OS: #{
|
141
|
+
raise "Unsupported OS: #{Platform::OS}"
|
131
142
|
end
|
132
143
|
|
133
|
-
arch = case
|
144
|
+
arch = case Platform::ARCH
|
134
145
|
when 'aarch64'
|
135
|
-
'
|
146
|
+
if Platform::OS == 'darwin'
|
147
|
+
'x86_64'
|
148
|
+
else
|
149
|
+
'aarch_64'
|
150
|
+
end
|
136
151
|
when 'sparcv9'
|
137
152
|
's390'
|
138
153
|
when 'i386'
|
@@ -142,7 +157,7 @@ module Sass
|
|
142
157
|
when 'powerpc64'
|
143
158
|
'ppcle_64'
|
144
159
|
else
|
145
|
-
raise "Unsupported Arch: #{
|
160
|
+
raise "Unsupported Arch: #{Platform::ARCH}"
|
146
161
|
end
|
147
162
|
|
148
163
|
os_arch = case os
|
@@ -160,9 +175,8 @@ module Sass
|
|
160
175
|
def latest_sass_embedded_protocol
|
161
176
|
repo = 'sass/embedded-protocol'
|
162
177
|
|
163
|
-
# TODO: use
|
164
|
-
|
165
|
-
tag_name = 'HEAD'
|
178
|
+
# TODO: don't use tag once a release is available
|
179
|
+
tag_name = latest_release repo, tag: true
|
166
180
|
|
167
181
|
"https://raw.githubusercontent.com/#{repo}/#{tag_name}/embedded_sass.proto"
|
168
182
|
end
|
data/lib/sass.rb
CHANGED
data/lib/sass/embedded.rb
CHANGED
@@ -55,16 +55,16 @@ module Sass
|
|
55
55
|
indent_width = parse_indent_width(indent_width)
|
56
56
|
linefeed = parse_linefeed(linefeed)
|
57
57
|
|
58
|
-
message =
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
58
|
+
message = CompileContext.new(@transport, next_id,
|
59
|
+
data: data,
|
60
|
+
file: file,
|
61
|
+
indented_syntax: indented_syntax,
|
62
|
+
include_paths: include_paths,
|
63
|
+
output_style: output_style,
|
64
|
+
source_map: source_map,
|
65
|
+
out_file: out_file,
|
66
|
+
functions: functions,
|
67
|
+
importer: importer).receive_message
|
68
68
|
|
69
69
|
if message.failure
|
70
70
|
raise RenderError.new(
|
data/lib/sass/transport.rb
CHANGED
@@ -31,7 +31,7 @@ module Sass
|
|
31
31
|
@stdin_mutex = Mutex.new
|
32
32
|
@stdin, @stdout, @stderr, @wait_thread = Open3.popen3(DART_SASS_EMBEDDED)
|
33
33
|
poll do
|
34
|
-
|
34
|
+
warn(@stderr.readline, uplevel: 1)
|
35
35
|
end
|
36
36
|
poll do
|
37
37
|
receive_proto read
|
@@ -68,9 +68,7 @@ module Sass
|
|
68
68
|
Thread.new do
|
69
69
|
loop do
|
70
70
|
yield
|
71
|
-
rescue
|
72
|
-
break
|
73
|
-
rescue IOError => e
|
71
|
+
rescue StandardError => e
|
74
72
|
notify_observers(e, nil)
|
75
73
|
close
|
76
74
|
break
|
@@ -90,7 +88,7 @@ module Sass
|
|
90
88
|
message = payload[payload.message.to_s]
|
91
89
|
case message
|
92
90
|
when EmbeddedProtocol::ProtocolError
|
93
|
-
|
91
|
+
raise ProtocolError, message.message
|
94
92
|
else
|
95
93
|
notify_observers(nil, message)
|
96
94
|
end
|
data/lib/sass/version.rb
CHANGED
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.
|
4
|
+
version: 0.7.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- なつき
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06
|
11
|
+
date: 2021-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -150,12 +150,12 @@ files:
|
|
150
150
|
- ext/Makefile
|
151
151
|
- ext/extconf.rb
|
152
152
|
- lib/sass.rb
|
153
|
+
- lib/sass/compile.rb
|
153
154
|
- lib/sass/embedded.rb
|
154
155
|
- lib/sass/error.rb
|
155
156
|
- lib/sass/info.rb
|
156
157
|
- lib/sass/observer.rb
|
157
158
|
- lib/sass/platform.rb
|
158
|
-
- lib/sass/render.rb
|
159
159
|
- lib/sass/result.rb
|
160
160
|
- lib/sass/struct.rb
|
161
161
|
- lib/sass/transport.rb
|
@@ -165,7 +165,7 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
|
|
165
165
|
licenses:
|
166
166
|
- MIT
|
167
167
|
metadata:
|
168
|
-
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.7.
|
168
|
+
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.7.11
|
169
169
|
post_install_message:
|
170
170
|
rdoc_options: []
|
171
171
|
require_paths:
|
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
- !ruby/object:Gem::Version
|
182
182
|
version: '0'
|
183
183
|
requirements: []
|
184
|
-
rubygems_version: 3.2.
|
184
|
+
rubygems_version: 3.2.22
|
185
185
|
signing_key:
|
186
186
|
specification_version: 4
|
187
187
|
summary: Use dart-sass with Ruby!
|