sassc-rails 1.0.0 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +17 -6
- data/CODE_OF_CONDUCT.md +10 -0
- data/README.md +36 -12
- data/Rakefile +5 -4
- data/gemfiles/{rails_4_0.gemfile → rails_5_2.gemfile} +1 -1
- data/gemfiles/{sprockets_2_12.gemfile → sprockets-rails_2_3.gemfile} +1 -1
- data/gemfiles/{with_sass_rails.gemfile → sprockets-rails_3_0.gemfile} +1 -1
- data/gemfiles/sprockets_3_0.gemfile +1 -1
- data/gemfiles/{rails_4_1.gemfile → sprockets_4_0.gemfile} +1 -1
- data/lib/rails/generators/sass/assets/assets_generator.rb +13 -0
- data/lib/rails/generators/sass/assets/templates/stylesheet.sass +3 -0
- data/lib/rails/generators/sass/scaffold/scaffold_generator.rb +9 -0
- data/lib/rails/generators/sass_scaffold.rb +15 -0
- data/lib/rails/generators/scss/assets/assets_generator.rb +13 -0
- data/lib/rails/generators/scss/assets/templates/stylesheet.scss +3 -0
- data/lib/rails/generators/scss/scaffold/scaffold_generator.rb +10 -0
- data/lib/sassc/rails/compressor.rb +13 -0
- data/lib/sassc/rails/functions.rb +3 -1
- data/lib/sassc/rails/importer.rb +11 -6
- data/lib/sassc/rails/railtie.rb +23 -8
- data/lib/sassc/rails/template.rb +76 -60
- data/lib/sassc/rails/version.rb +3 -1
- data/lib/sassc/rails.rb +2 -0
- data/lib/sassc-rails.rb +1 -5
- data/sassc-rails.gemspec +7 -10
- data/test/dummy/app/assets/config/manifest.js +3 -0
- data/test/dummy/app/assets/stylesheets/glob_multiple_extensions_test.scss +1 -0
- data/{test_old/fixtures/scss_project/app/assets/stylesheets/css_erb_handler.css.erb → test/dummy/app/assets/stylesheets/globbed_multiple_extensions/glob.scss.erb} +1 -1
- data/test/dummy/app/assets/stylesheets/imports_test.scss +1 -0
- data/test/dummy/app/assets/stylesheets/in_load_paths/partial_in_load_paths.scss +3 -0
- data/test/sassc_rails_test.rb +65 -39
- data/test/test_helper.rb +3 -1
- metadata +49 -245
- data/test_old/fixtures/alternate_config_project/.gitignore +0 -5
- data/test_old/fixtures/alternate_config_project/Gemfile +0 -7
- data/test_old/fixtures/alternate_config_project/README +0 -261
- data/test_old/fixtures/alternate_config_project/Rakefile +0 -7
- data/test_old/fixtures/alternate_config_project/app/assets/images/1x1.png +0 -0
- data/test_old/fixtures/alternate_config_project/app/assets/images/rails.png +0 -0
- data/test_old/fixtures/alternate_config_project/app/assets/javascripts/application.js +0 -9
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/_top_level_partial.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/application.scss +0 -32
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/css_application.css +0 -11
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/globbed/globbed.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/globbed/nested/nested_glob.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_sass_import.sass +0 -5
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_scss_import.scss +0 -9
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_without_css_ext.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/_relative_sass.sass +0 -2
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/_relative_scss.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.scss +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/another_plain.css +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/plain.css +0 -3
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/second_level.scss +0 -1
- data/test_old/fixtures/alternate_config_project/app/controllers/application_controller.rb +0 -3
- data/test_old/fixtures/alternate_config_project/app/helpers/application_helper.rb +0 -2
- data/test_old/fixtures/alternate_config_project/app/mailers/.gitkeep +0 -0
- data/test_old/fixtures/alternate_config_project/app/models/.gitkeep +0 -0
- data/test_old/fixtures/alternate_config_project/app/views/layouts/application.html.erb +0 -14
- data/test_old/fixtures/alternate_config_project/config/application.rb +0 -49
- data/test_old/fixtures/alternate_config_project/config/boot.rb +0 -6
- data/test_old/fixtures/alternate_config_project/config/database.yml +0 -25
- data/test_old/fixtures/alternate_config_project/config/environment.rb +0 -5
- data/test_old/fixtures/alternate_config_project/config/environments/development.rb +0 -27
- data/test_old/fixtures/alternate_config_project/config/environments/production.rb +0 -60
- data/test_old/fixtures/alternate_config_project/config/environments/test.rb +0 -42
- data/test_old/fixtures/alternate_config_project/config/initializers/backtrace_silencers.rb +0 -7
- data/test_old/fixtures/alternate_config_project/config/initializers/inflections.rb +0 -10
- data/test_old/fixtures/alternate_config_project/config/initializers/mime_types.rb +0 -5
- data/test_old/fixtures/alternate_config_project/config/initializers/secret_token.rb +0 -7
- data/test_old/fixtures/alternate_config_project/config/initializers/session_store.rb +0 -8
- data/test_old/fixtures/alternate_config_project/config/initializers/wrap_parameters.rb +0 -12
- data/test_old/fixtures/alternate_config_project/config/locales/en.yml +0 -5
- data/test_old/fixtures/alternate_config_project/config/routes.rb +0 -58
- data/test_old/fixtures/alternate_config_project/config.ru +0 -4
- data/test_old/fixtures/alternate_config_project/db/seeds.rb +0 -7
- data/test_old/fixtures/alternate_config_project/doc/README_FOR_APP +0 -2
- data/test_old/fixtures/alternate_config_project/lib/tasks/.gitkeep +0 -0
- data/test_old/fixtures/alternate_config_project/log/.gitkeep +0 -0
- data/test_old/fixtures/alternate_config_project/public/404.html +0 -26
- data/test_old/fixtures/alternate_config_project/public/422.html +0 -26
- data/test_old/fixtures/alternate_config_project/public/500.html +0 -26
- data/test_old/fixtures/alternate_config_project/public/favicon.ico +0 -0
- data/test_old/fixtures/alternate_config_project/public/index.html +0 -241
- data/test_old/fixtures/alternate_config_project/public/robots.txt +0 -5
- data/test_old/fixtures/alternate_config_project/script/rails +0 -6
- data/test_old/fixtures/engine_project/.gitignore +0 -8
- data/test_old/fixtures/engine_project/Gemfile +0 -14
- data/test_old/fixtures/engine_project/MIT-LICENSE +0 -20
- data/test_old/fixtures/engine_project/README.rdoc +0 -3
- data/test_old/fixtures/engine_project/Rakefile +0 -34
- data/test_old/fixtures/engine_project/app/assets/images/engine_project/.keep +0 -0
- data/test_old/fixtures/engine_project/app/assets/javascripts/engine_project/application.js +0 -16
- data/test_old/fixtures/engine_project/app/assets/stylesheets/engine_project/application.css +0 -13
- data/test_old/fixtures/engine_project/app/controllers/engine_project/application_controller.rb +0 -4
- data/test_old/fixtures/engine_project/app/helpers/engine_project/application_helper.rb +0 -4
- data/test_old/fixtures/engine_project/app/views/layouts/engine_project/application.html.erb +0 -14
- data/test_old/fixtures/engine_project/config/routes.rb +0 -2
- data/test_old/fixtures/engine_project/engine_project.gemspec +0 -23
- data/test_old/fixtures/engine_project/lib/engine_project/engine.rb +0 -5
- data/test_old/fixtures/engine_project/lib/engine_project/version.rb +0 -3
- data/test_old/fixtures/engine_project/lib/engine_project.rb +0 -4
- data/test_old/fixtures/engine_project/lib/tasks/engine_project_tasks.rake +0 -4
- data/test_old/fixtures/engine_project/script/rails +0 -8
- data/test_old/fixtures/engine_project/test/dummy/README.rdoc +0 -28
- data/test_old/fixtures/engine_project/test/dummy/Rakefile +0 -6
- data/test_old/fixtures/engine_project/test/dummy/app/assets/javascripts/application.js +0 -16
- data/test_old/fixtures/engine_project/test/dummy/app/assets/stylesheets/application.css +0 -13
- data/test_old/fixtures/engine_project/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test_old/fixtures/engine_project/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test_old/fixtures/engine_project/test/dummy/app/mailers/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/app/models/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/app/models/concerns/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test_old/fixtures/engine_project/test/dummy/bin/bundle +0 -3
- data/test_old/fixtures/engine_project/test/dummy/bin/rails +0 -4
- data/test_old/fixtures/engine_project/test/dummy/bin/rake +0 -4
- data/test_old/fixtures/engine_project/test/dummy/config/application.rb +0 -23
- data/test_old/fixtures/engine_project/test/dummy/config/boot.rb +0 -9
- data/test_old/fixtures/engine_project/test/dummy/config/database.yml +0 -25
- data/test_old/fixtures/engine_project/test/dummy/config/environment.rb +0 -5
- data/test_old/fixtures/engine_project/test/dummy/config/environments/development.rb +0 -27
- data/test_old/fixtures/engine_project/test/dummy/config/environments/production.rb +0 -84
- data/test_old/fixtures/engine_project/test/dummy/config/environments/test.rb +0 -40
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/inflections.rb +0 -16
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/secret_token.rb +0 -12
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/session_store.rb +0 -3
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test_old/fixtures/engine_project/test/dummy/config/locales/en.yml +0 -23
- data/test_old/fixtures/engine_project/test/dummy/config/routes.rb +0 -4
- data/test_old/fixtures/engine_project/test/dummy/config.ru +0 -4
- data/test_old/fixtures/engine_project/test/dummy/lib/assets/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/log/.keep +0 -0
- data/test_old/fixtures/engine_project/test/dummy/public/404.html +0 -27
- data/test_old/fixtures/engine_project/test/dummy/public/422.html +0 -26
- data/test_old/fixtures/engine_project/test/dummy/public/500.html +0 -26
- data/test_old/fixtures/engine_project/test/dummy/public/favicon.ico +0 -0
- data/test_old/fixtures/sass_project/.gitignore +0 -5
- data/test_old/fixtures/sass_project/Gemfile +0 -7
- data/test_old/fixtures/sass_project/README +0 -261
- data/test_old/fixtures/sass_project/Rakefile +0 -7
- data/test_old/fixtures/sass_project/app/assets/images/rails.png +0 -0
- data/test_old/fixtures/sass_project/app/assets/javascripts/application.js +0 -9
- data/test_old/fixtures/sass_project/app/assets/stylesheets/application.css +0 -7
- data/test_old/fixtures/sass_project/app/controllers/application_controller.rb +0 -3
- data/test_old/fixtures/sass_project/app/helpers/application_helper.rb +0 -2
- data/test_old/fixtures/sass_project/app/mailers/.gitkeep +0 -0
- data/test_old/fixtures/sass_project/app/models/.gitkeep +0 -0
- data/test_old/fixtures/sass_project/app/views/layouts/application.html.erb +0 -14
- data/test_old/fixtures/sass_project/config/application.rb +0 -52
- data/test_old/fixtures/sass_project/config/boot.rb +0 -6
- data/test_old/fixtures/sass_project/config/database.yml +0 -25
- data/test_old/fixtures/sass_project/config/environment.rb +0 -5
- data/test_old/fixtures/sass_project/config/environments/development.rb +0 -24
- data/test_old/fixtures/sass_project/config/environments/production.rb +0 -58
- data/test_old/fixtures/sass_project/config/environments/test.rb +0 -43
- data/test_old/fixtures/sass_project/config/initializers/backtrace_silencers.rb +0 -7
- data/test_old/fixtures/sass_project/config/initializers/inflections.rb +0 -10
- data/test_old/fixtures/sass_project/config/initializers/mime_types.rb +0 -5
- data/test_old/fixtures/sass_project/config/initializers/secret_token.rb +0 -7
- data/test_old/fixtures/sass_project/config/initializers/session_store.rb +0 -8
- data/test_old/fixtures/sass_project/config/initializers/wrap_parameters.rb +0 -12
- data/test_old/fixtures/sass_project/config/locales/en.yml +0 -5
- data/test_old/fixtures/sass_project/config/routes.rb +0 -58
- data/test_old/fixtures/sass_project/config.ru +0 -4
- data/test_old/fixtures/sass_project/db/seeds.rb +0 -7
- data/test_old/fixtures/sass_project/doc/README_FOR_APP +0 -2
- data/test_old/fixtures/sass_project/lib/tasks/.gitkeep +0 -0
- data/test_old/fixtures/sass_project/log/.gitkeep +0 -0
- data/test_old/fixtures/sass_project/public/404.html +0 -26
- data/test_old/fixtures/sass_project/public/422.html +0 -26
- data/test_old/fixtures/sass_project/public/500.html +0 -26
- data/test_old/fixtures/sass_project/public/favicon.ico +0 -0
- data/test_old/fixtures/sass_project/public/index.html +0 -241
- data/test_old/fixtures/sass_project/public/robots.txt +0 -5
- data/test_old/fixtures/sass_project/script/rails +0 -6
- data/test_old/fixtures/scss_project/.gitignore +0 -5
- data/test_old/fixtures/scss_project/Gemfile +0 -7
- data/test_old/fixtures/scss_project/README +0 -261
- data/test_old/fixtures/scss_project/Rakefile +0 -7
- data/test_old/fixtures/scss_project/app/assets/images/1x1.png +0 -0
- data/test_old/fixtures/scss_project/app/assets/images/rails.png +0 -0
- data/test_old/fixtures/scss_project/app/assets/javascripts/application.js +0 -9
- data/test_old/fixtures/scss_project/app/assets/stylesheets/_top_level_partial.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/application.scss +0 -38
- data/test_old/fixtures/scss_project/app/assets/stylesheets/css_application.css +0 -11
- data/test_old/fixtures/scss_project/app/assets/stylesheets/css_sass_erb_handler.sass.erb +0 -2
- data/test_old/fixtures/scss_project/app/assets/stylesheets/css_scss_erb_handler.scss.erb +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/globbed/globbed.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/globbed/nested/nested_glob.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/import_css_application.scss +0 -5
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_css_sass_import.sass +0 -5
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_sass_import.sass +0 -2
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_scss_import.scss +0 -9
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_without_css_ext.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_sass.sass +0 -2
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_scss.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/sass_erb_handler.sass.erb +0 -2
- data/test_old/fixtures/scss_project/app/assets/stylesheets/scss_erb_handler.scss.erb +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/_defaults.scss +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/another_plain.css +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/plain.css +0 -3
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/second_level.scss +0 -2
- data/test_old/fixtures/scss_project/app/controllers/application_controller.rb +0 -3
- data/test_old/fixtures/scss_project/app/helpers/application_helper.rb +0 -2
- data/test_old/fixtures/scss_project/app/mailers/.gitkeep +0 -0
- data/test_old/fixtures/scss_project/app/models/.gitkeep +0 -0
- data/test_old/fixtures/scss_project/app/views/layouts/application.html.erb +0 -14
- data/test_old/fixtures/scss_project/config/application.rb +0 -49
- data/test_old/fixtures/scss_project/config/boot.rb +0 -6
- data/test_old/fixtures/scss_project/config/database.yml +0 -25
- data/test_old/fixtures/scss_project/config/environment.rb +0 -5
- data/test_old/fixtures/scss_project/config/environments/development.rb +0 -23
- data/test_old/fixtures/scss_project/config/environments/production.rb +0 -57
- data/test_old/fixtures/scss_project/config/environments/test.rb +0 -42
- data/test_old/fixtures/scss_project/config/initializers/backtrace_silencers.rb +0 -7
- data/test_old/fixtures/scss_project/config/initializers/inflections.rb +0 -10
- data/test_old/fixtures/scss_project/config/initializers/mime_types.rb +0 -5
- data/test_old/fixtures/scss_project/config/initializers/postprocessor.rb +0 -3
- data/test_old/fixtures/scss_project/config/initializers/secret_token.rb +0 -7
- data/test_old/fixtures/scss_project/config/initializers/session_store.rb +0 -8
- data/test_old/fixtures/scss_project/config/initializers/wrap_parameters.rb +0 -12
- data/test_old/fixtures/scss_project/config/locales/en.yml +0 -5
- data/test_old/fixtures/scss_project/config/routes.rb +0 -58
- data/test_old/fixtures/scss_project/config.ru +0 -4
- data/test_old/fixtures/scss_project/db/seeds.rb +0 -7
- data/test_old/fixtures/scss_project/doc/README_FOR_APP +0 -2
- data/test_old/fixtures/scss_project/lib/tasks/.gitkeep +0 -0
- data/test_old/fixtures/scss_project/log/.gitkeep +0 -0
- data/test_old/fixtures/scss_project/public/404.html +0 -26
- data/test_old/fixtures/scss_project/public/422.html +0 -26
- data/test_old/fixtures/scss_project/public/500.html +0 -26
- data/test_old/fixtures/scss_project/public/favicon.ico +0 -0
- data/test_old/fixtures/scss_project/public/index.html +0 -241
- data/test_old/fixtures/scss_project/public/robots.txt +0 -5
- data/test_old/fixtures/scss_project/script/rails +0 -6
- data/test_old/sass_rails_test.rb +0 -203
- data/test_old/support/sass_rails_test_case.rb +0 -181
- data/test_old/test_helper.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bab6450e8f0f559676574d793ebfd3907047d86f1211f7b37d7ddefef7d9d489
|
4
|
+
data.tar.gz: 319f4a01bd86c17e651e54971d7e275e1112e5edf403b2ff224bcffa4860b2e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea0d8aa788795d3fd25cb7f929728cb24bc521fada59bc41d9342ac8d91748243ea4de171c3aa06b7135d93e72d204606fd4dd364b032cc45ca7a4f0f35f5abc
|
7
|
+
data.tar.gz: 3a058c13f10d1605db0a80e326dd16e1f5a1f7bb9e6f7775ff5102dd154ceb90e03d6c100b090ebd3de4d2ccb32d81f02a47bedb0771ce2f6632305088b1d0a4
|
data/.travis.yml
CHANGED
@@ -4,17 +4,28 @@ bundler_args: "--binstubs --standalone --without documentation --path ../bundle"
|
|
4
4
|
|
5
5
|
script: "bundle exec rake test"
|
6
6
|
|
7
|
+
before_install:
|
8
|
+
- rvm @global do gem uninstall bundler -x
|
9
|
+
- gem install bundler --version '< 2'
|
10
|
+
|
7
11
|
gemfile:
|
8
|
-
- gemfiles/
|
12
|
+
- gemfiles/sprockets-rails_3_0.gemfile
|
13
|
+
- gemfiles/sprockets-rails_2_3.gemfile
|
9
14
|
- gemfiles/sprockets_3_0.gemfile
|
15
|
+
- gemfiles/sprockets_4_0.gemfile
|
10
16
|
- gemfiles/rails_4_2.gemfile
|
11
|
-
- gemfiles/
|
12
|
-
- gemfiles/rails_4_0.gemfile
|
17
|
+
- gemfiles/rails_5_2.gemfile
|
13
18
|
|
14
19
|
rvm:
|
15
|
-
- 2.
|
16
|
-
- 2.
|
17
|
-
- 2.
|
20
|
+
- 2.4.6
|
21
|
+
- 2.5.5
|
22
|
+
- 2.6.3
|
23
|
+
- jruby
|
24
|
+
|
25
|
+
matrix:
|
26
|
+
allow_failures:
|
27
|
+
- gemfile: gemfiles/rails_4_2.gemfile
|
28
|
+
rvm: jruby
|
18
29
|
|
19
30
|
notifications:
|
20
31
|
email: false
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
Sass is more than a technology; Sass is driven by the community of individuals
|
2
|
+
that power its development and use every day. As a community, we want to embrace
|
3
|
+
the very differences that have made our collaboration so powerful, and work
|
4
|
+
together to provide the best environment for learning, growing, and sharing of
|
5
|
+
ideas. It is imperative that we keep Sass a fun, welcoming, challenging, and
|
6
|
+
fair place to play.
|
7
|
+
|
8
|
+
[The full community guidelines can be found on the Sass website.][link]
|
9
|
+
|
10
|
+
[link]: https://sass-lang.com/community-guidelines
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# SassC::Rails [![Build Status](https://travis-ci.org/
|
1
|
+
# SassC::Rails [![Build Status](https://travis-ci.org/sass/sassc-rails.svg)](https://travis-ci.org/sass/sassc-rails) [![Gem Version](https://badge.fury.io/rb/sassc-rails.svg)](http://badge.fury.io/rb/sassc-rails)
|
2
2
|
|
3
3
|
We all love working with Sass, but compilation can take quite a long time for larger
|
4
4
|
codebases. This gem integrates the C implementation of Sass,
|
@@ -22,8 +22,6 @@ In one larger project, this made compilation 4x faster:
|
|
22
22
|
|
23
23
|
This should essentially be a drop in alternative to [sass-rails](https://github.com/rails/sass-rails).
|
24
24
|
|
25
|
-
__Note: This is a new project, please report any issues you come across!__
|
26
|
-
|
27
25
|
## Inline Source Maps
|
28
26
|
|
29
27
|
With SassC-Rails, it's also extremely easy to turn on inline source maps. Simply
|
@@ -35,7 +33,8 @@ config.sass.inline_source_maps = true
|
|
35
33
|
```
|
36
34
|
|
37
35
|
After adding this config line, you may need to clear your assets cache
|
38
|
-
(`rm -r tmp/cache/assets`), stop spring, and restart your rails server.
|
36
|
+
(`rm -r tmp/cache/assets`), stop spring, and restart your rails server. You may
|
37
|
+
also wish to disable line comments (`config.sass.line_comments = false`).
|
39
38
|
|
40
39
|
Note, as indicated, these source maps are *inline*. They will not generate additional
|
41
40
|
files or anything like that. Instead, they will be appended to the compiled
|
@@ -74,27 +73,52 @@ Upgrading to Cedar-14 is usually a painless process.
|
|
74
73
|
|
75
74
|
Libraries explicitly depending on Sass-Rails, such as ActiveAdmin, can cause
|
76
75
|
conflicts with installation of SassC-Rails. While we have no built-in solution
|
77
|
-
for this, please check out [this issue](https://github.com/
|
76
|
+
for this, please check out [this issue](https://github.com/sass/sassc-rails/issues/6)
|
78
77
|
for a workaround.
|
79
78
|
|
79
|
+
|
80
|
+
## Credits
|
81
|
+
|
82
|
+
This gem is based on [sass-rails](https://github.com/rails/sass-rails), and
|
83
|
+
is maintained by [Ryan Boland](https://ryanboland.com) and [awesome contributors](https://github.com/sass/sassc-rails/graphs/contributors).
|
84
|
+
|
85
|
+
|
80
86
|
## Changelog
|
81
87
|
|
88
|
+
- **2.1.2**
|
89
|
+
- [Correct reference to SassC::Script::Value::String](https://github.com/sass/sassc-rails/pull/129)
|
90
|
+
- **2.1.1**
|
91
|
+
- [Fix Scaffolding](https://github.com/sass/sassc-rails/pull/119)
|
92
|
+
- **2.1.0**
|
93
|
+
- [JRuby support](https://github.com/sass/sassc-rails/pull/113)
|
94
|
+
- [SCSS / SASS scaffolding](https://github.com/sass/sassc-rails/pull/112)
|
95
|
+
- **2.0.0**
|
96
|
+
- [Drop support for Sprockets 2](https://github.com/sass/sassc-rails/pull/109)
|
97
|
+
- [Remove dependency on Ruby Sass](https://github.com/sass/sassc-rails/pull/109)
|
98
|
+
- **1.3.0**
|
99
|
+
- [Silence Sprockets deprecation warnings](https://github.com/sass/sassc-rails/pull/76)
|
100
|
+
- [Sprockets 4 compatibility](https://github.com/sass/sassc-rails/pull/65)
|
101
|
+
- **1.2.1**
|
102
|
+
- Bump SassC (and thus LibSass) version
|
103
|
+
- **1.2.0**
|
104
|
+
- [Support sprockets-rails 3](https://github.com/sass/sassc-rails/pull/41)
|
105
|
+
- [Only depend on Railties instead of full Rails](https://github.com/sass/sassc-rails/pull/52)
|
106
|
+
- **1.1.0**
|
107
|
+
- Moved under the official sass organization!
|
108
|
+
- [Source line comments](https://github.com/sass/sassc-rails/pull/24) (`app.config.sass.line_comments`)
|
109
|
+
- [Prevent sass-rails railtie from running](https://github.com/sass/sassc-rails/pull/34)
|
110
|
+
- [CSS compression may be disabled in test mode](https://github.com/sass/sassc-rails/issues/33). Special thanks to [this Sass-Rails PR](https://github.com/rails/sass-rails/pull/338) for inspiration.
|
82
111
|
- **1.0.0**
|
83
112
|
- Initial Release
|
84
113
|
- Add support for inline source maps
|
85
114
|
- Support compression in the way that Sass-Rails handles it
|
86
115
|
|
116
|
+
|
87
117
|
## Contributing
|
88
118
|
|
89
|
-
1. Fork it ( https://github.com/
|
119
|
+
1. Fork it ( https://github.com/sass/sassc-rails/fork )
|
90
120
|
1. Create your feature branch (`git checkout -b my-new-feature`)
|
91
121
|
1. Commit your changes (`git commit -am 'Add some feature'`)
|
92
122
|
1. Add Tests
|
93
123
|
1. Push to the branch (`git push origin my-new-feature`)
|
94
124
|
1. Create a new Pull Request
|
95
|
-
|
96
|
-
|
97
|
-
## Credits
|
98
|
-
|
99
|
-
This gem is based on [sass-rails](https://github.com/rails/sass-rails), and
|
100
|
-
is maintained by [Ryan Boland](https://ryanboland.com) and [awesome contributors](https://github.com/bolandrm/sassc-rails/graphs/contributors).
|
data/Rakefile
CHANGED
@@ -4,15 +4,16 @@ task :test do
|
|
4
4
|
$LOAD_PATH.unshift('lib', 'test')
|
5
5
|
Dir.glob('./test/**/*_test.rb') { |f| require f }
|
6
6
|
end
|
7
|
+
task :default => [:test]
|
7
8
|
|
8
9
|
namespace :tests do
|
9
10
|
gemfiles = %w[
|
10
|
-
|
11
|
+
sprockets-rails_3_0
|
12
|
+
sprockets-rails_2_3
|
11
13
|
sprockets_3_0
|
14
|
+
sprockets_4_0
|
12
15
|
rails_4_2
|
13
|
-
|
14
|
-
rails_4_0
|
15
|
-
with_sass_rails
|
16
|
+
rails_5_2
|
16
17
|
]
|
17
18
|
|
18
19
|
gemfiles.each do |gemfile|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require "rails/generators/named_base"
|
2
|
+
|
3
|
+
module Sass
|
4
|
+
module Generators
|
5
|
+
class AssetsGenerator < ::Rails::Generators::NamedBase
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
|
8
|
+
def copy_sass
|
9
|
+
template "stylesheet.sass", File.join('app/assets/stylesheets', class_path, "#{file_name}.sass")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "sassc/engine"
|
2
|
+
require "rails/generators/named_base"
|
3
|
+
|
4
|
+
module Sass
|
5
|
+
module Generators
|
6
|
+
class ScaffoldBase < ::Rails::Generators::NamedBase
|
7
|
+
def copy_stylesheet
|
8
|
+
dir = ::Rails::Generators::ScaffoldGenerator.source_root
|
9
|
+
file = File.join(dir, "scaffold.css")
|
10
|
+
converted_contents = ::SassC::Engine.new(File.read(file)).render
|
11
|
+
create_file "app/assets/stylesheets/scaffolds.#{syntax}", converted_contents
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require "rails/generators/named_base"
|
2
|
+
|
3
|
+
module Scss
|
4
|
+
module Generators
|
5
|
+
class AssetsGenerator < ::Rails::Generators::NamedBase
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
|
8
|
+
def copy_scss
|
9
|
+
template "stylesheet.scss", File.join('app/assets/stylesheets', class_path, "#{file_name}.scss")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,6 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'sprockets/sass_compressor'
|
4
|
+
require 'securerandom'
|
2
5
|
|
3
6
|
class Sprockets::SassCompressor
|
7
|
+
def initialize(options = {})
|
8
|
+
@options = {
|
9
|
+
syntax: :scss,
|
10
|
+
cache: false,
|
11
|
+
read_cache: false,
|
12
|
+
style: :compressed
|
13
|
+
}.merge(options).freeze
|
14
|
+
@cache_key = SecureRandom.uuid
|
15
|
+
end
|
16
|
+
|
4
17
|
def call(*args)
|
5
18
|
input = if defined?(data)
|
6
19
|
data # sprockets 2.x
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'sprockets/sass_functions'
|
2
4
|
|
3
5
|
module Sprockets
|
4
6
|
module SassFunctions
|
5
7
|
def asset_data_url(path)
|
6
|
-
SassC::Script::String.new("url(" + sprockets_context.asset_data_uri(path.value) + ")")
|
8
|
+
::SassC::Script::Value::String.new("url(" + sprockets_context.asset_data_uri(path.value) + ")")
|
7
9
|
end
|
8
10
|
end
|
9
11
|
end
|
data/lib/sassc/rails/importer.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'tilt'
|
2
4
|
|
3
5
|
module SassC
|
@@ -73,13 +75,13 @@ module SassC
|
|
73
75
|
EXTENSIONS = [
|
74
76
|
CssScssExtension.new,
|
75
77
|
CssSassExtension.new,
|
76
|
-
|
77
|
-
Extension.new(".sass"),
|
78
|
-
CSSExtension.new,
|
78
|
+
SassERBExtension.new,
|
79
79
|
ERBExtension.new(".scss.erb"),
|
80
80
|
ERBExtension.new(".css.erb"),
|
81
|
-
|
82
|
-
|
81
|
+
Extension.new(".scss"),
|
82
|
+
Extension.new(".sass"),
|
83
|
+
CSSExtension.new
|
84
|
+
].freeze
|
83
85
|
|
84
86
|
PREFIXS = [ "", "_" ]
|
85
87
|
GLOB = /(\A|\/)(\*|\*\*\/\*)\z/
|
@@ -100,6 +102,9 @@ module SassC
|
|
100
102
|
search_paths.map! do |path|
|
101
103
|
File.join(path, specified_dir)
|
102
104
|
end
|
105
|
+
search_paths.select! do |path|
|
106
|
+
File.directory?(path)
|
107
|
+
end
|
103
108
|
end
|
104
109
|
|
105
110
|
search_paths.each do |search_path|
|
@@ -108,7 +113,7 @@ module SassC
|
|
108
113
|
|
109
114
|
EXTENSIONS.each do |extension|
|
110
115
|
try_path = File.join(search_path, file_name + extension.postfix)
|
111
|
-
if File.
|
116
|
+
if File.exist?(try_path)
|
112
117
|
record_import_as_dependency try_path
|
113
118
|
return extension.import_for(try_path, parent_dir, options)
|
114
119
|
end
|
data/lib/sassc/rails/railtie.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'active_support/core_ext/class/attribute'
|
2
4
|
require 'sprockets/railtie'
|
3
5
|
|
@@ -11,6 +13,9 @@ module SassC::Rails
|
|
11
13
|
# Initialize the load paths to an empty array
|
12
14
|
config.sass.load_paths = []
|
13
15
|
|
16
|
+
# Display line comments above each selector as a debugging aid
|
17
|
+
config.sass.line_comments = true
|
18
|
+
|
14
19
|
# Set the default stylesheet engine
|
15
20
|
# It can be overridden by passing:
|
16
21
|
# --stylesheet_engine=sass
|
@@ -35,28 +40,38 @@ module SassC::Rails
|
|
35
40
|
# Override stylesheet engine to the preferred syntax
|
36
41
|
config.app_generators.stylesheet_engine syntax
|
37
42
|
|
38
|
-
# Establish configuration defaults that are
|
43
|
+
# Establish configuration defaults that are environmental in nature
|
39
44
|
# if config.sass.full_exception.nil?
|
40
45
|
# # Display a stack trace in the css output when in development-like environments.
|
41
46
|
# config.sass.full_exception = app.config.consider_all_requests_local
|
42
47
|
# end
|
43
48
|
|
44
|
-
|
45
|
-
|
49
|
+
app.config.assets.configure do |env|
|
50
|
+
env.context_class.class_eval do
|
46
51
|
class_attribute :sass_config
|
47
52
|
self.sass_config = app.config.sass
|
48
53
|
end
|
49
54
|
|
50
|
-
|
51
|
-
|
55
|
+
if env.respond_to?(:register_transformer)
|
56
|
+
env.register_transformer 'text/sass', 'text/css', SassC::Rails::SassTemplate.new
|
57
|
+
env.register_transformer 'text/scss', 'text/css', SassC::Rails::ScssTemplate.new
|
58
|
+
end
|
59
|
+
|
60
|
+
if env.respond_to?(:register_engine)
|
61
|
+
[
|
62
|
+
['.sass', SassC::Rails::SassTemplate],
|
63
|
+
['.scss', SassC::Rails::ScssTemplate]
|
64
|
+
].each do |engine|
|
65
|
+
engine << { silence_deprecation: true } if Sprockets::VERSION.start_with?("3")
|
66
|
+
env.register_engine(*engine)
|
67
|
+
end
|
68
|
+
end
|
52
69
|
end
|
53
70
|
end
|
54
71
|
|
55
72
|
initializer :setup_compression, group: :all do |app|
|
56
|
-
app.config.assets.css_compressor = nil
|
57
|
-
|
58
73
|
if !Rails.env.development?
|
59
|
-
app.config.assets.css_compressor
|
74
|
+
app.config.assets.css_compressor = :sass unless app.config.assets.has_key?(:css_compressor)
|
60
75
|
else
|
61
76
|
# Use expanded output instead of the sass default of :nested unless specified
|
62
77
|
app.config.sass.style ||= :expanded
|
data/lib/sassc/rails/template.rb
CHANGED
@@ -1,66 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "sprockets/version"
|
2
|
-
require
|
4
|
+
require 'sprockets/sass_processor'
|
3
5
|
require "sprockets/utils"
|
4
6
|
|
5
7
|
module SassC::Rails
|
6
|
-
class SassTemplate < Sprockets::
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
sprockets: {
|
17
|
-
context: context,
|
18
|
-
environment: input[:environment],
|
19
|
-
dependencies: context.metadata[:dependency_paths]
|
20
|
-
}
|
21
|
-
}.merge(config_options)
|
22
|
-
|
23
|
-
engine = ::SassC::Engine.new(input[:data], options)
|
24
|
-
|
25
|
-
css = Sprockets::Utils.module_include(::SassC::Script::Functions, @functions) do
|
26
|
-
engine.render
|
27
|
-
end
|
28
|
-
|
29
|
-
context.metadata.merge(data: css)
|
8
|
+
class SassTemplate < Sprockets::SassProcessor
|
9
|
+
def initialize(options = {}, &block)
|
10
|
+
@cache_version = options[:cache_version]
|
11
|
+
@cache_key = "#{self.class.name}:#{VERSION}:#{SassC::VERSION}:#{@cache_version}".freeze
|
12
|
+
#@importer_class = options[:importer] || Sass::Importers::Filesystem
|
13
|
+
@sass_config = options[:sass_config] || {}
|
14
|
+
@functions = Module.new do
|
15
|
+
include Functions
|
16
|
+
include options[:functions] if options[:functions]
|
17
|
+
class_eval(&block) if block_given?
|
30
18
|
end
|
31
19
|
end
|
32
20
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
21
|
+
def call(input)
|
22
|
+
context = input[:environment].context_class.new(input)
|
23
|
+
|
24
|
+
options = {
|
25
|
+
filename: input[:filename],
|
26
|
+
line_comments: line_comments?,
|
27
|
+
syntax: self.class.syntax,
|
28
|
+
load_paths: input[:environment].paths,
|
29
|
+
importer: SassC::Rails::Importer,
|
30
|
+
sprockets: {
|
31
|
+
context: context,
|
32
|
+
environment: input[:environment],
|
33
|
+
dependencies: context.metadata[:dependency_paths]
|
34
|
+
}
|
35
|
+
}.merge!(config_options) { |key, left, right| safe_merge(key, left, right) }
|
36
|
+
|
37
|
+
engine = ::SassC::Engine.new(input[:data], options)
|
38
|
+
|
39
|
+
css = Sprockets::Utils.module_include(::SassC::Script::Functions, @functions) do
|
40
|
+
engine.render
|
53
41
|
end
|
54
|
-
end
|
55
42
|
|
56
|
-
|
57
|
-
include Sprockets3
|
58
|
-
else
|
59
|
-
include Sprockets2
|
43
|
+
context.metadata.merge(data: css)
|
60
44
|
end
|
61
45
|
|
62
46
|
def config_options
|
63
|
-
opts = { style: sass_style }
|
47
|
+
opts = { style: sass_style, load_paths: load_paths }
|
64
48
|
|
65
49
|
|
66
50
|
if Rails.application.config.sass.inline_source_maps
|
@@ -77,20 +61,52 @@ module SassC::Rails
|
|
77
61
|
def sass_style
|
78
62
|
(Rails.application.config.sass.style || :expanded).to_sym
|
79
63
|
end
|
80
|
-
end
|
81
64
|
|
82
|
-
|
83
|
-
|
84
|
-
self.default_mime_type = 'text/css'
|
65
|
+
def load_paths
|
66
|
+
Rails.application.config.sass.load_paths || []
|
85
67
|
end
|
86
68
|
|
87
|
-
|
88
|
-
|
89
|
-
|
69
|
+
def line_comments?
|
70
|
+
Rails.application.config.sass.line_comments
|
71
|
+
end
|
72
|
+
|
73
|
+
def safe_merge(_key, left, right)
|
74
|
+
if [left, right].all? { |v| v.is_a? Hash }
|
75
|
+
left.merge(right) { |k, l, r| safe_merge(k, l, r) }
|
76
|
+
elsif [left, right].all? { |v| v.is_a? Array }
|
77
|
+
(left + right).uniq
|
78
|
+
else
|
79
|
+
right
|
80
|
+
end
|
90
81
|
end
|
91
82
|
|
92
|
-
#
|
93
|
-
|
83
|
+
# The methods in the Functions module were copied here from sprockets in order to
|
84
|
+
# override the Value class names (e.g. ::SassC::Script::Value::String)
|
85
|
+
module Functions
|
86
|
+
def asset_path(path, options = {})
|
87
|
+
path = path.value
|
88
|
+
|
89
|
+
path, _, query, fragment = URI.split(path)[5..8]
|
90
|
+
path = sprockets_context.asset_path(path, options)
|
91
|
+
query = "?#{query}" if query
|
92
|
+
fragment = "##{fragment}" if fragment
|
93
|
+
|
94
|
+
::SassC::Script::Value::String.new("#{path}#{query}#{fragment}", :string)
|
95
|
+
end
|
96
|
+
|
97
|
+
def asset_url(path, options = {})
|
98
|
+
::SassC::Script::Value::String.new("url(#{asset_path(path, options).value})")
|
99
|
+
end
|
100
|
+
|
101
|
+
def asset_data_url(path)
|
102
|
+
url = sprockets_context.asset_data_uri(path.value)
|
103
|
+
::SassC::Script::Value::String.new("url(" + url + ")")
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
class ScssTemplate < SassTemplate
|
109
|
+
def self.syntax
|
94
110
|
:scss
|
95
111
|
end
|
96
112
|
end
|
data/lib/sassc/rails/version.rb
CHANGED
data/lib/sassc/rails.rb
CHANGED
data/lib/sassc-rails.rb
CHANGED
data/sassc-rails.gemspec
CHANGED
@@ -7,10 +7,10 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "sassc-rails"
|
8
8
|
spec.version = SassC::Rails::VERSION
|
9
9
|
spec.authors = ["Ryan Boland"]
|
10
|
-
spec.email = ["
|
10
|
+
spec.email = ["ryan@tanookilabs.com"]
|
11
11
|
spec.summary = %q{Integrate SassC-Ruby into Rails.}
|
12
12
|
spec.description = %q{Integrate SassC-Ruby into Rails.}
|
13
|
-
spec.homepage = "https://github.com/
|
13
|
+
spec.homepage = "https://github.com/sass/sassc-rails"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -19,17 +19,14 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency 'pry'
|
22
|
-
spec.add_development_dependency "bundler"
|
22
|
+
spec.add_development_dependency "bundler"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
24
|
spec.add_development_dependency 'mocha'
|
25
25
|
|
26
|
-
|
27
|
-
# reuse portions of the sprockets template
|
28
|
-
spec.add_dependency 'sass'
|
29
|
-
spec.add_dependency "sassc", "~> 1.5"
|
30
|
-
|
26
|
+
spec.add_dependency "sassc", ">= 2.0"
|
31
27
|
spec.add_dependency "tilt"
|
32
28
|
|
33
|
-
spec.add_dependency '
|
34
|
-
spec.add_dependency 'sprockets', '>
|
29
|
+
spec.add_dependency 'railties', '>= 4.0.0'
|
30
|
+
spec.add_dependency 'sprockets', '> 3.0'
|
31
|
+
spec.add_dependency 'sprockets-rails'
|
35
32
|
end
|