sass-embedded 0.7.8 → 0.7.12
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/dependencies.rb +11 -0
- data/ext/extconf.rb +50 -31
- 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/version.rb +1 -1
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af7015aac4279ef9b4ea9a4cca2ca236e1722c70db19e4c21a35c9df64d5667e
|
4
|
+
data.tar.gz: 8dcf794cff743d2e5f24b7bcd817d7bcef2867549fe0eda94634966a96e8e8c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76a76058b210b7ae057ed71dd25f12625a04396c84c447dd8075ca4ff6ca4d52df009243cbd110009902fa727489e79bd20b1798670222cbe3c312f5ade5aa7d
|
7
|
+
data.tar.gz: f5d40d128f9c9fbaee17728c9092b6b6c86f1908f474a94e6b43918cb2db389154fa246d4b2b9ee083e916d62ba19f9aec767e35cd8d7c39c25462e90a3f9d5c
|
data/ext/dependencies.rb
ADDED
data/ext/extconf.rb
CHANGED
@@ -5,13 +5,14 @@ require 'mkmf'
|
|
5
5
|
require 'json'
|
6
6
|
require 'open-uri'
|
7
7
|
require 'fileutils'
|
8
|
+
require_relative './dependencies'
|
8
9
|
require_relative '../lib/sass/platform'
|
9
10
|
|
10
11
|
module Sass
|
11
12
|
# The dependency downloader. This downloads all the dependencies during gem
|
12
13
|
# installation. The companion Makefile then unpacks all downloaded
|
13
|
-
# dependencies. By default it downloads the
|
14
|
-
#
|
14
|
+
# dependencies. By default it downloads the release of each dependency
|
15
|
+
# from GitHub releases.
|
15
16
|
#
|
16
17
|
# It is possible to specify an alternative source or version of each
|
17
18
|
# dependency. Local sources can be used for offline installation.
|
@@ -23,9 +24,9 @@ module Sass
|
|
23
24
|
# --with-sass-embedded-protocol=file:///path/to/embedded_sass.proto
|
24
25
|
class Extconf
|
25
26
|
def initialize
|
26
|
-
get_with_config('protoc', true) {
|
27
|
-
get_with_config('sass-embedded', true) {
|
28
|
-
get_with_config('sass-embedded-protocol', true) {
|
27
|
+
get_with_config('protoc', true) { default_protoc }
|
28
|
+
get_with_config('sass-embedded', true) { default_sass_embedded }
|
29
|
+
get_with_config('sass-embedded-protocol', true) { default_sass_embedded_protocol }
|
29
30
|
end
|
30
31
|
|
31
32
|
private
|
@@ -52,6 +53,7 @@ module Sass
|
|
52
53
|
if uri.is_a?(URI::File) || uri.instance_of?(URI::Generic)
|
53
54
|
FileUtils.copy_file uri.path, path
|
54
55
|
elsif uri.respond_to? :open
|
56
|
+
puts "curl -fsSLo #{path} -- #{uri}"
|
55
57
|
uri.open do |source|
|
56
58
|
File.open(path, 'wb') do |destination|
|
57
59
|
destination.write source.read
|
@@ -64,27 +66,36 @@ module Sass
|
|
64
66
|
raise "Failed to get: #{uri}"
|
65
67
|
end
|
66
68
|
|
67
|
-
def
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
URI.parse("https://api.github.com/repos/#{repo}/releases").open(headers) do |file|
|
72
|
-
JSON.parse(file.read)[0]['tag_name']
|
73
|
-
end
|
74
|
-
else
|
69
|
+
def resolve_tag_name(repo, *requirements, gh_release: true)
|
70
|
+
requirements = Gem::Requirement.create(*requirements)
|
71
|
+
|
72
|
+
if requirements == Gem::Requirement.default && gh_release
|
75
73
|
URI.parse("https://github.com/#{repo}/releases/latest").open do |file|
|
76
74
|
File.basename file.base_uri.to_s
|
77
75
|
end
|
76
|
+
else
|
77
|
+
headers = {}
|
78
|
+
headers['Authorization'] = "token #{ENV['GITHUB_TOKEN']}" if ENV['GITHUB_TOKEN']
|
79
|
+
if gh_release
|
80
|
+
URI.parse("https://api.github.com/repos/#{repo}/releases?per_page=100").open(headers) do |file|
|
81
|
+
JSON.parse(file.read).map { |release| release['tag_name'] }
|
82
|
+
end
|
83
|
+
else
|
84
|
+
URI.parse("https://api.github.com/repos/#{repo}/tags?per_page=100").open(headers) do |file|
|
85
|
+
JSON.parse(file.read).map { |tag| tag['name'] }
|
86
|
+
end
|
87
|
+
end
|
88
|
+
.find { |version| Gem::Version.correct?(version) && requirements.satisfied_by?(Gem::Version.new(version)) }
|
89
|
+
&.to_s
|
78
90
|
end
|
79
91
|
end
|
80
92
|
|
81
|
-
def
|
93
|
+
def default_sass_embedded
|
82
94
|
repo = 'sass/dart-sass-embedded'
|
83
95
|
|
84
|
-
|
85
|
-
tag_name = latest_release repo, prerelease: true
|
96
|
+
tag_name = resolve_tag_name(repo, Sass::Dependencies::REQUIREMENTS[repo])
|
86
97
|
|
87
|
-
os = case
|
98
|
+
os = case Platform::OS
|
88
99
|
when 'darwin'
|
89
100
|
'macos'
|
90
101
|
when 'linux'
|
@@ -92,16 +103,20 @@ module Sass
|
|
92
103
|
when 'windows'
|
93
104
|
'windows'
|
94
105
|
else
|
95
|
-
raise "Unsupported OS: #{
|
106
|
+
raise "Unsupported OS: #{Platform::OS}"
|
96
107
|
end
|
97
108
|
|
98
|
-
arch = case
|
109
|
+
arch = case Platform::ARCH
|
99
110
|
when 'x86_64'
|
100
111
|
'x64'
|
101
112
|
when 'i386'
|
102
113
|
'ia32'
|
114
|
+
when 'aarch64'
|
115
|
+
raise "Unsupported Arch: #{Platform::ARCH}" unless Platform::OS == 'darwin'
|
116
|
+
|
117
|
+
'x64'
|
103
118
|
else
|
104
|
-
raise "Unsupported Arch: #{
|
119
|
+
raise "Unsupported Arch: #{Platform::ARCH}"
|
105
120
|
end
|
106
121
|
|
107
122
|
ext = case os
|
@@ -114,12 +129,14 @@ module Sass
|
|
114
129
|
"https://github.com/#{repo}/releases/download/#{tag_name}/sass_embedded-#{tag_name}-#{os}-#{arch}.#{ext}"
|
115
130
|
end
|
116
131
|
|
117
|
-
def
|
132
|
+
def default_protoc
|
118
133
|
repo = 'protocolbuffers/protobuf'
|
119
134
|
|
120
|
-
|
135
|
+
spec = Gem::Dependency.new('google-protobuf', Sass::Dependencies::REQUIREMENTS[repo]).to_spec
|
136
|
+
|
137
|
+
tag_name = "v#{spec.version}"
|
121
138
|
|
122
|
-
os = case
|
139
|
+
os = case Platform::OS
|
123
140
|
when 'darwin'
|
124
141
|
'osx'
|
125
142
|
when 'linux'
|
@@ -127,12 +144,16 @@ module Sass
|
|
127
144
|
when 'windows'
|
128
145
|
'win'
|
129
146
|
else
|
130
|
-
raise "Unsupported OS: #{
|
147
|
+
raise "Unsupported OS: #{Platform::OS}"
|
131
148
|
end
|
132
149
|
|
133
|
-
arch = case
|
150
|
+
arch = case Platform::ARCH
|
134
151
|
when 'aarch64'
|
135
|
-
'
|
152
|
+
if Platform::OS == 'darwin'
|
153
|
+
'x86_64'
|
154
|
+
else
|
155
|
+
'aarch_64'
|
156
|
+
end
|
136
157
|
when 'sparcv9'
|
137
158
|
's390'
|
138
159
|
when 'i386'
|
@@ -142,7 +163,7 @@ module Sass
|
|
142
163
|
when 'powerpc64'
|
143
164
|
'ppcle_64'
|
144
165
|
else
|
145
|
-
raise "Unsupported Arch: #{
|
166
|
+
raise "Unsupported Arch: #{Platform::ARCH}"
|
146
167
|
end
|
147
168
|
|
148
169
|
os_arch = case os
|
@@ -157,12 +178,10 @@ module Sass
|
|
157
178
|
"https://github.com/#{repo}/releases/download/#{tag_name}/protoc-#{tag_name[1..]}-#{os_arch}.#{ext}"
|
158
179
|
end
|
159
180
|
|
160
|
-
def
|
181
|
+
def default_sass_embedded_protocol
|
161
182
|
repo = 'sass/embedded-protocol'
|
162
183
|
|
163
|
-
|
164
|
-
# tag_name = latest_release repo
|
165
|
-
tag_name = 'HEAD'
|
184
|
+
tag_name = resolve_tag_name(repo, Sass::Dependencies::REQUIREMENTS[repo], gh_release: false)
|
166
185
|
|
167
186
|
"https://raw.githubusercontent.com/#{repo}/#{tag_name}/embedded_sass.proto"
|
168
187
|
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/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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- なつき
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-20 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.17
|
19
|
+
version: '3.17'
|
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.17
|
26
|
+
version: '3.17'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,14 +148,15 @@ files:
|
|
148
148
|
- LICENSE
|
149
149
|
- README.md
|
150
150
|
- ext/Makefile
|
151
|
+
- ext/dependencies.rb
|
151
152
|
- ext/extconf.rb
|
152
153
|
- lib/sass.rb
|
154
|
+
- lib/sass/compile.rb
|
153
155
|
- lib/sass/embedded.rb
|
154
156
|
- lib/sass/error.rb
|
155
157
|
- lib/sass/info.rb
|
156
158
|
- lib/sass/observer.rb
|
157
159
|
- lib/sass/platform.rb
|
158
|
-
- lib/sass/render.rb
|
159
160
|
- lib/sass/result.rb
|
160
161
|
- lib/sass/struct.rb
|
161
162
|
- lib/sass/transport.rb
|
@@ -165,8 +166,8 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
|
|
165
166
|
licenses:
|
166
167
|
- MIT
|
167
168
|
metadata:
|
168
|
-
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.7.
|
169
|
-
post_install_message:
|
169
|
+
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.7.12
|
170
|
+
post_install_message:
|
170
171
|
rdoc_options: []
|
171
172
|
require_paths:
|
172
173
|
- lib
|
@@ -181,8 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
182
|
- !ruby/object:Gem::Version
|
182
183
|
version: '0'
|
183
184
|
requirements: []
|
184
|
-
rubygems_version: 3.2.
|
185
|
-
signing_key:
|
185
|
+
rubygems_version: 3.2.26
|
186
|
+
signing_key:
|
186
187
|
specification_version: 4
|
187
188
|
summary: Use dart-sass with Ruby!
|
188
189
|
test_files: []
|