Skip to content

Commit c040b0a

Browse files
committed
Initial
0 parents  commit c040b0a

34 files changed

+5087
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.0, 2, 2.7, 2.6, 3-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 2.6-bullseye, 3-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster
2+
ARG VARIANT=2-bullseye
3+
FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT}
4+
5+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
6+
ARG NODE_VERSION="none"
7+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
8+
9+
# [Optional] Uncomment this section to install additional OS packages.
10+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
11+
# && apt-get -y install --no-install-recommends <your-package-list-here>
12+
13+
# [Optional] Uncomment this line to install additional gems.
14+
# RUN gem install <your-gem-names-here>
15+
16+
# [Optional] Uncomment this line to install global node packages.
17+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/base.Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.0, 2, 2.7, 2.6, 3-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 2.6-bullseye, 3-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster
2+
ARG VARIANT=2-bullseye
3+
FROM ruby:${VARIANT}
4+
5+
# Copy library scripts to execute
6+
COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/
7+
8+
# [Option] Install zsh
9+
ARG INSTALL_ZSH="true"
10+
# [Option] Upgrade OS packages to their latest versions
11+
ARG UPGRADE_PACKAGES="true"
12+
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
13+
ARG USERNAME=vscode
14+
ARG USER_UID=1000
15+
ARG USER_GID=$USER_UID
16+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
17+
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
18+
&& apt-get purge -y imagemagick imagemagick-6-common \
19+
# Install common packages, non-root user, rvm, core build tools
20+
&& bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
21+
&& bash /tmp/library-scripts/ruby-debian.sh "none" "${USERNAME}" "true" "true" \
22+
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
23+
24+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
25+
ARG NODE_VERSION="none"
26+
ENV NVM_DIR=/usr/local/share/nvm
27+
ENV NVM_SYMLINK_CURRENT=true \
28+
PATH=${NVM_DIR}/current/bin:${PATH}
29+
RUN bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \
30+
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
31+
32+
# Remove library scripts for final image
33+
RUN rm -rf /tmp/library-scripts
34+
35+
# [Optional] Uncomment this section to install additional OS packages.
36+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
37+
# && apt-get -y install --no-install-recommends <your-package-list-here>
38+
39+
# [Optional] Uncomment this line to install additional gems.
40+
# RUN gem install <your-gem-names-here>
41+
42+
# [Optional] Uncomment this line to install global node packages.
43+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/devcontainer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/ruby
3+
{
4+
"name": "Ruby",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"args": {
8+
// Update 'VARIANT' to pick a Ruby version: 3, 3.0, 2, 2.7, 2.6
9+
// Append -bullseye or -buster to pin to an OS version.
10+
// Use -bullseye variants on local on arm64/Apple Silicon.
11+
"VARIANT": "3-bullseye",
12+
// Options
13+
"NODE_VERSION": "lts/*"
14+
}
15+
},
16+
17+
// Set *default* container specific settings.json values on container create.
18+
"settings": {},
19+
20+
// Add the IDs of extensions you want installed when the container is created.
21+
"extensions": [
22+
"rebornix.Ruby"
23+
],
24+
25+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
26+
// "forwardPorts": [],
27+
28+
// Use 'postCreateCommand' to run commands after the container is created.
29+
// "postCreateCommand": "ruby --version",
30+
31+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
32+
"remoteUser": "vscode",
33+
"features": {
34+
"github-cli": "latest"
35+
}
36+
37+
}

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/.bundle/
2+
/doc/
3+
/log/*.log
4+
/pkg/
5+
/tmp/
6+
/test/dummy/db/*.sqlite3
7+
/test/dummy/db/*.sqlite3-*
8+
/test/dummy/log/*.log
9+
/test/dummy/storage/
10+
/test/dummy/tmp/
11+
/node_modules
12+
.byebug_history
13+
*.gem
14+
.idea/
15+
**/tmp/
16+
/exe/*/tailwindcss

Gemfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
source 'https://rubygems.org'
2+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3+
gemspec
4+
5+
gem "sqlite3"
6+
gem "debug", ">= 1.0.0"
7+
8+
group :test do
9+
gem "actionmailer", ">= 6.0.0"
10+
end

Gemfile.lock

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
PATH
2+
remote: .
3+
specs:
4+
dartsass-rails (0.0.1)
5+
railties (>= 6.0.0)
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
actionmailer (6.1.4.1)
11+
actionpack (= 6.1.4.1)
12+
actionview (= 6.1.4.1)
13+
activejob (= 6.1.4.1)
14+
activesupport (= 6.1.4.1)
15+
mail (~> 2.5, >= 2.5.4)
16+
rails-dom-testing (~> 2.0)
17+
actionpack (6.1.4.1)
18+
actionview (= 6.1.4.1)
19+
activesupport (= 6.1.4.1)
20+
rack (~> 2.0, >= 2.0.9)
21+
rack-test (>= 0.6.3)
22+
rails-dom-testing (~> 2.0)
23+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
24+
actionview (6.1.4.1)
25+
activesupport (= 6.1.4.1)
26+
builder (~> 3.1)
27+
erubi (~> 1.4)
28+
rails-dom-testing (~> 2.0)
29+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
30+
activejob (6.1.4.1)
31+
activesupport (= 6.1.4.1)
32+
globalid (>= 0.3.6)
33+
activesupport (6.1.4.1)
34+
concurrent-ruby (~> 1.0, >= 1.0.2)
35+
i18n (>= 1.6, < 2)
36+
minitest (>= 5.1)
37+
tzinfo (~> 2.0)
38+
zeitwerk (~> 2.3)
39+
builder (3.2.4)
40+
concurrent-ruby (1.1.9)
41+
crass (1.0.6)
42+
debug (1.1.0)
43+
irb
44+
reline (>= 0.2.7)
45+
erubi (1.10.0)
46+
globalid (1.0.0)
47+
activesupport (>= 5.0)
48+
i18n (1.8.11)
49+
concurrent-ruby (~> 1.0)
50+
io-console (0.5.9)
51+
irb (1.3.7)
52+
reline (>= 0.2.7)
53+
loofah (2.12.0)
54+
crass (~> 1.0.2)
55+
nokogiri (>= 1.5.9)
56+
mail (2.7.1)
57+
mini_mime (>= 0.1.1)
58+
method_source (1.0.0)
59+
mini_mime (1.1.2)
60+
mini_portile2 (2.6.1)
61+
minitest (5.14.4)
62+
nokogiri (1.12.5)
63+
mini_portile2 (~> 2.6.1)
64+
racc (~> 1.4)
65+
racc (1.6.0)
66+
rack (2.2.3)
67+
rack-test (1.1.0)
68+
rack (>= 1.0, < 3)
69+
rails-dom-testing (2.0.3)
70+
activesupport (>= 4.2.0)
71+
nokogiri (>= 1.6)
72+
rails-html-sanitizer (1.4.2)
73+
loofah (~> 2.3)
74+
railties (6.1.4.1)
75+
actionpack (= 6.1.4.1)
76+
activesupport (= 6.1.4.1)
77+
method_source
78+
rake (>= 0.13)
79+
thor (~> 1.0)
80+
rake (13.0.6)
81+
reline (0.2.7)
82+
io-console (~> 0.5)
83+
sqlite3 (1.4.2)
84+
thor (1.2.1)
85+
tzinfo (2.0.4)
86+
concurrent-ruby (~> 1.0)
87+
zeitwerk (2.5.1)
88+
89+
PLATFORMS
90+
ruby
91+
92+
DEPENDENCIES
93+
actionmailer (>= 6.0.0)
94+
dartsass-rails!
95+
debug (>= 1.0.0)
96+
sqlite3
97+
98+
BUNDLED WITH
99+
2.2.32

LICENSE-DEPENDENCIES

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
dartsass-rails redistributes executables from the https://github.com/sass/dart-sass/ project
2+
3+
The license for that software can be found at https://github.com/sass/dart-sass/blob/main/LICENSE which is reproduced here for your convenience:
4+
5+
Copyright (c) 2016, Google Inc.
6+
7+
Permission is hereby granted, free of charge, to any person obtaining
8+
a copy of this software and associated documentation files (the
9+
"Software"), to deal in the Software without restriction, including
10+
without limitation the rights to use, copy, modify, merge, publish,
11+
distribute, sublicense, and/or sell copies of the Software, and to
12+
permit persons to whom the Software is furnished to do so, subject to
13+
the following conditions:
14+
15+
The above copyright notice and this permission notice shall be
16+
included in all copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25+
26+
Licenses for individual platform binaries are available under exe/[platform]/LICENSE

MIT-LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2022 David Heinemeier Hansson
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Dart Sass for Rails
2+
3+
[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.
4+
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, Linux, and Windows. The Linux and Windows versions are the ones for 64-bit, and the macOS version is compiled for Intel but will run on ARM as well.
6+
7+
The installer will create your 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.
8+
9+
If you need to use a custom input or output file, you can run `bundle exec dartsass` to access the platform-specific executable, and give it your own build options.
10+
11+
When you're developing your application, you want to run Dart Sass in watch mode, so changes are automatically reflected in the generated CSS output. You can do this either by running `rails dartsass:watch` as a separate process, or by running `./bin/dev` which uses [foreman](https://github.com/ddollar/foreman) to starts both the Dart Sass watch process and the rails server in development mode.
12+
13+
14+
## Installation
15+
16+
1. Run `./bin/bundle add dartsass-rails`
17+
2. Run `./bin/rails dartsass:install`
18+
19+
20+
## Building in production
21+
22+
The `dartsass:build` is automatically attached to `assets:precompile`, so before the asset pipeline digests the files, the Dart Sass output will be generated.
23+
24+
25+
## License
26+
27+
Dart Sass for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).
28+
Sass is released under the [MIT License](https://opensource.org/licenses/MIT).

Rakefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
require "bundler/setup"
2+
3+
require "bundler/gem_tasks"
4+
5+
require "rake/testtask"
6+
7+
Rake::TestTask.new(:test) do |t|
8+
t.libs << 'test'
9+
t.pattern = 'test/**/*_test.rb'
10+
t.verbose = false
11+
t.warning = true
12+
end
13+
14+
task default: :test

0 commit comments

Comments
 (0)