sass-embedded 1.80.3 → 1.80.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efea36871eaf8e8900baf002520fbe854ff9d9f52019a4dbfe0f817d7d05a5f0
4
- data.tar.gz: a522cf483c17442cd71c72e8f90f7a32b6b1e1260b3fd42b170c5a49a8ab0289
3
+ metadata.gz: 48f9a046796c1128fee72e53aae8da123f2d37d35cf0d27e33e9258f2f58ece6
4
+ data.tar.gz: 839809b0866cf6aed49542e7a4fca8fd64bf01d1a4d15b79be8ca1de630132aa
5
5
  SHA512:
6
- metadata.gz: 8797161cff914c9431daeef2e9870540a6366fbda4945f270fe4d6ed51642d0dc1cc12b923ddec903ad03a20575d0c3f6d2b76a21ebbd10fc495dd2de7dff5a8
7
- data.tar.gz: d3fd1cc3cfe4252d187c9b73f061d51e8733ec6370c07047c392b9ac32e376200f9837d1ff24fcb0f45631874651b2ede67f5575e173c20a64dea474b2bc303e
6
+ metadata.gz: da49936d0d5279f7effac246d314d0138aafee881e167ad619c2f92fb47a3372170fde648c2fe12ed1cd4f33ff26063c5b461a14957e056aff94a7ac7a54dfc2
7
+ data.tar.gz: 371313ed88a584d86c0b841d35347c309a314b935b5acb8fef509660f3ed44ec748f9eeeb905d2dcba26575239b457cd42805d7c4d50e3cd659621a9bdafa753
data/ext/sass/Rakefile CHANGED
@@ -8,17 +8,32 @@ task install: %w[cli.rb] do
8
8
  Rake::Task['embedded_sass_pb.rb'].invoke unless File.exist?('embedded_sass_pb.rb')
9
9
  end
10
10
 
11
- CLEAN.include %w[protoc.exe ruby *.proto *.tar.gz *.zip]
12
-
13
- CLOBBER.include %w[dart-sass cli.rb embedded_sass_pb.rb]
11
+ CLEAN.include %w[
12
+ protoc.exe
13
+ ruby
14
+ *.proto
15
+ *.tar.gz
16
+ *.zip
17
+ ]
18
+
19
+ CLOBBER.include %w[
20
+ dart-sass
21
+ cli.rb
22
+ embedded_sass_pb.rb
23
+ node_modules
24
+ bun.lockb
25
+ package-lock.json
26
+ pnpm-lock.yaml
27
+ yarn.lock
28
+ ]
14
29
 
15
30
  file 'protoc.exe' do |t|
16
31
  fetch(ENV.fetch('PROTOC_BIN') { SassConfig.default_protoc }, t.name)
17
32
  chmod 'a+x', t.name
18
33
  end
19
34
 
20
- file 'dart-sass' do |t|
21
- raise if ENV.key?('DART_SASS')
35
+ file 'dart-sass/sass' do |t|
36
+ raise RuntimeError if ENV.key?('DART_SASS')
22
37
 
23
38
  gem_install 'sass-embedded', SassConfig.gem_version, SassConfig.gem_platform do |dir|
24
39
  mv File.absolute_path("ext/sass/#{t.name}", dir), t.name
@@ -29,34 +44,68 @@ rescue StandardError
29
44
  rm archive
30
45
  end
31
46
 
47
+ file 'node_modules/sass' do
48
+ sh 'npm', 'install'
49
+ rescue StandardError
50
+ begin
51
+ sh 'yarn', 'install'
52
+ rescue StandardError
53
+ begin
54
+ sh 'pnpm', 'install'
55
+ rescue StandardError
56
+ sh 'bun', 'install'
57
+ end
58
+ end
59
+ end
60
+
61
+ task 'dart-sass' do
62
+ Rake::Task['dart-sass/sass'].invoke
63
+ rescue NotImplementedError
64
+ Rake::Task['node_modules/sass'].invoke
65
+ end
66
+
32
67
  file 'cli.rb' => %w[dart-sass] do |t|
33
68
  require_relative '../../lib/sass/elf'
34
69
 
35
- exe = 'dart-sass/sass'
36
- exe = "#{exe}#{['', '.bat', '.exe'].find { |ext| File.exist?("#{exe}#{ext}") }}"
70
+ begin
71
+ exe = 'dart-sass/sass'
72
+ exe = "#{exe}#{['', '.bat', '.exe'].find { |ext| File.exist?("#{exe}#{ext}") }}"
37
73
 
38
- raise "#{exe} not found" unless File.exist?(exe)
74
+ raise Errno::ENOENT, exe unless File.exist?(exe)
39
75
 
40
- runtime = 'dart-sass/src/dart'
41
- runtime = "#{runtime}#{['', '.exe'].find { |ext| File.exist?("#{runtime}#{ext}") }}"
42
- snapshot = 'dart-sass/src/sass.snapshot'
76
+ runtime = 'dart-sass/src/dart'
77
+ runtime = "#{runtime}#{['', '.exe'].find { |ext| File.exist?("#{runtime}#{ext}") }}"
78
+ snapshot = 'dart-sass/src/sass.snapshot'
43
79
 
44
- command = if File.exist?(runtime) && File.exist?(snapshot)
45
- [runtime, snapshot]
46
- else
47
- [exe]
48
- end
80
+ command = if File.exist?(runtime) && File.exist?(snapshot)
81
+ [runtime, snapshot]
82
+ else
83
+ [exe]
84
+ end
49
85
 
50
- interpreter = File.open(command[0], 'rb') do |file|
51
- Sass.const_get(:ELF).new(file).interpreter
52
- rescue ArgumentError
53
- nil
54
- end
86
+ interpreter = File.open(command[0], 'rb') do |file|
87
+ Sass.const_get(:ELF).new(file).interpreter
88
+ rescue ArgumentError
89
+ nil
90
+ end
55
91
 
56
- command_source = command.map do |argument|
57
- "File.absolute_path('#{argument}', __dir__).freeze"
58
- end.join(',
92
+ command_source = command.map do |argument|
93
+ "File.absolute_path('#{argument}', __dir__).freeze"
94
+ end.join(',
59
95
  ')
96
+ rescue Errno::ENOENT
97
+ package = 'node_modules/sass'
98
+
99
+ script = File.join(package, SassConfig.package_json(package)['bin']['sass'])
100
+
101
+ interpreter = nil
102
+
103
+ command_source = [
104
+ "'node'",
105
+ "File.absolute_path('#{script}', __dir__).freeze"
106
+ ].join(',
107
+ ')
108
+ end
60
109
 
61
110
  if interpreter.nil?
62
111
  File.write(t.name, <<~CLI_RB)
@@ -135,7 +184,7 @@ module FileUtils
135
184
  entry = entries.nextElement
136
185
  name = entry.getName
137
186
  path = dest_path.resolve(name).normalize
138
- raise unless path.startsWith(dest_path)
187
+ raise SecurityError unless path.startsWith(dest_path)
139
188
 
140
189
  Rake.rake_output_message " inflating: #{name}" if Rake::FileUtilsExt.verbose_flag
141
190
 
@@ -231,7 +280,7 @@ module FileUtils
231
280
  s.platform == platform
232
281
  end
233
282
 
234
- raise if resolver_spec.nil?
283
+ raise Gem::UnsatisfiableDependencyError, dependency_request if resolver_spec.nil?
235
284
 
236
285
  options = { force: true, install_dir: }
237
286
  if Rake::FileUtilsExt.nowrite_flag
@@ -290,12 +339,14 @@ module SassConfig
290
339
 
291
340
  module_function
292
341
 
293
- def dart_sass_version
342
+ def package_json(path = '.')
294
343
  require 'json'
295
344
 
296
- spec = JSON.parse(File.read(File.absolute_path('package.json', __dir__)))
345
+ JSON.parse(File.read(File.absolute_path('package.json', path)))
346
+ end
297
347
 
298
- spec['dependencies']['sass']
348
+ def dart_sass_version
349
+ package_json['dependencies']['sass']
299
350
  end
300
351
 
301
352
  def default_dart_sass
@@ -359,7 +410,7 @@ module SassConfig
359
410
  os = case Platform::OS
360
411
  when 'darwin'
361
412
  'osx'
362
- when 'linux'
413
+ when 'linux', 'linux-android', 'linux-musl', 'linux-uclibc'
363
414
  'linux'
364
415
  when 'windows'
365
416
  'windows'
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "dependencies": {
3
- "sass": "1.80.3"
3
+ "sass": "1.80.5"
4
4
  }
5
5
  }
@@ -116,7 +116,7 @@ module Sass
116
116
 
117
117
  case version_response.implementation_name
118
118
  when 'dart-sass'
119
- info << '[Dart]'
119
+ info << (CLI::COMMAND.first == 'node' ? '[JavaScript]' : '[Dart]')
120
120
  end
121
121
 
122
122
  info
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  module Embedded
5
- VERSION = '1.80.3'
5
+ VERSION = '1.80.5'
6
6
  end
7
7
  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.80.3
4
+ version: 1.80.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-19 00:00:00.000000000 Z
11
+ date: 2024-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -125,8 +125,8 @@ licenses:
125
125
  - MIT
126
126
  metadata:
127
127
  bug_tracker_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/issues
128
- documentation_uri: https://rubydoc.info/gems/sass-embedded/1.80.3
129
- source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.80.3
128
+ documentation_uri: https://rubydoc.info/gems/sass-embedded/1.80.5
129
+ source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.80.5
130
130
  funding_uri: https://github.com/sponsors/ntkme
131
131
  rubygems_mfa_required: 'true'
132
132
  post_install_message: