Skip to content

Commit 89d49d5

Browse files
authored
Merge pull request #42 from ntkme/sass-embedded
Use dart-sass distributed by sass-embedded gem
2 parents 4d67726 + 1f37a87 commit 89d49d5

File tree

17 files changed

+12
-4670
lines changed

17 files changed

+12
-4670
lines changed

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ PATH
33
specs:
44
dartsass-rails (0.4.1)
55
railties (>= 6.0.0)
6+
sass-embedded (~> 1.63)
67

78
GEM
89
remote: https://rubygems.org/
@@ -45,6 +46,7 @@ GEM
4546
erubi (1.10.0)
4647
globalid (1.0.0)
4748
activesupport (>= 5.0)
49+
google-protobuf (3.23.2)
4850
i18n (1.8.11)
4951
concurrent-ruby (~> 1.0)
5052
io-console (0.5.9)
@@ -80,6 +82,9 @@ GEM
8082
rake (13.0.6)
8183
reline (0.2.7)
8284
io-console (~> 0.5)
85+
sass-embedded (1.63.3)
86+
google-protobuf (~> 3.23)
87+
rake (>= 10.0.0)
8388
sqlite3 (1.4.2)
8489
thor (1.2.1)
8590
tzinfo (2.0.4)

LICENSE-DEPENDENCIES

Lines changed: 0 additions & 26 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[Sass](https://sass-lang.com) is a stylesheet language that’s compiled to CSS. It allows you to use variables, nested rules, mixins, functions, and more, all with a fully CSS-compatible syntax.
44

5-
This gem wraps [the standalone executable version](https://github.com/sass/dart-sass/releases) of the Dart version of Sass. These executables are platform specific, but included in this gem are the ones for macOS (Intel, Apple Silicon), Linux (x86-64, AArch64), and Windows (x86-64).
5+
This gem wraps [the standalone executable version](https://github.com/sass/dart-sass/releases) of the Dart version of Sass. The platform specific Dart Sass executables are distributed by [sass-embedded](https://rubygems.org/gems/sass-embedded) gem.
66

77
The installer will create your default Sass input file in `app/assets/stylesheets/application.scss`. This is where you should import all the style files to be compiled [using the @use rule](https://sass-lang.com/documentation/at-rules/use). When you run `rails dartsass:build`, this input file will be used to generate the output in `app/assets/builds/application.css`. That's the output CSS that you'll include in your app. The load path for Sass is automatically configured to be `app/assets/stylesheets`.
88

@@ -123,8 +123,9 @@ the following command: `bundle exec rails dartsass:build`.
123123
124124
## Version
125125
126-
Dart Sass 1.49.0
127-
126+
``` sh
127+
bundle exec dartsass --version
128+
```
128129

129130
## License
130131

dartsass-rails.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ Gem::Specification.new do |spec|
1919
spec.executables << "dartsass"
2020

2121
spec.add_dependency "railties", ">= 6.0.0"
22+
spec.add_dependency "sass-embedded", "~> 1.63"
2223
end

exe/aarch64-linux/sass

-9.05 MB
Binary file not shown.

exe/arm64-darwin/sass

-8.22 MB
Binary file not shown.

exe/dartsass

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
11
#! /usr/bin/env ruby
2-
# because rubygems shims assume a gem's executables are Ruby
2+
# frozen_string_literal: true
33

4-
require "shellwords"
5-
require "rbconfig"
6-
7-
system_config = RbConfig::CONFIG
8-
platform_string = "#{system_config["host_cpu"]}-#{system_config["host_os"]}"
9-
10-
exe_path =
11-
case platform_string
12-
when /aarch64-linux/ then File.join(__dir__, "aarch64-linux/sass")
13-
when /arm(64)?-darwin/ then File.join(__dir__, "arm64-darwin/sass")
14-
when /darwin/ then File.join(__dir__, "darwin/sass")
15-
when /linux/ then File.join(__dir__, "linux/sass")
16-
when /mswin|mingw|cygwin/ then File.join(__dir__, "mingw32/sass.bat")
17-
else
18-
STDERR.puts(<<~ERRMSG)
19-
ERROR: dartsass-rails does not support the #{platform_string} platform
20-
ERRMSG
21-
exit 1
22-
end
23-
24-
command = Shellwords.join([ exe_path, ARGV ].flatten)
25-
puts "+ #{command}"
26-
exec(command)
4+
load Gem.bin_path("sass-embedded", "sass")

0 commit comments

Comments
 (0)