sassc-rails 0.0.1
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 +7 -0
- data/.gitignore +16 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +28 -0
- data/Rakefile +6 -0
- data/lib/sassc-rails.rb +8 -0
- data/lib/sassc/rails.rb +5 -0
- data/lib/sassc/rails/functions.rb +12 -0
- data/lib/sassc/rails/importer.rb +147 -0
- data/lib/sassc/rails/logger.rb +21 -0
- data/lib/sassc/rails/railtie.rb +64 -0
- data/lib/sassc/rails/template.rb +42 -0
- data/lib/sassc/rails/version.rb +5 -0
- data/sassc-rails.gemspec +34 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/images/1x1.png +0 -0
- data/test/dummy/app/assets/images/rails.png +0 -0
- data/test/dummy/app/assets/stylesheets/application.scss +5 -0
- data/test/dummy/app/assets/stylesheets/helpers_test.scss +18 -0
- data/test/dummy/app/assets/stylesheets/syntax_error.scss +3 -0
- data/test/dummy/rails_app.rb +16 -0
- data/test/sassc_rails_test.rb +77 -0
- data/test/smoke_test.rb +20 -0
- data/test/test_helper.rb +12 -0
- data/test_old/fixtures/alternate_config_project/.gitignore +5 -0
- data/test_old/fixtures/alternate_config_project/Gemfile +7 -0
- data/test_old/fixtures/alternate_config_project/README +261 -0
- data/test_old/fixtures/alternate_config_project/Rakefile +7 -0
- 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 +9 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/_top_level_partial.scss +3 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/application.scss +32 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/css_application.css +11 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/globbed/globbed.scss +3 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/globbed/nested/nested_glob.scss +3 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_sass_import.sass +5 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_scss_import.scss +9 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/_without_css_ext.scss +3 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/_relative_sass.sass +2 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/_relative_scss.scss +3 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.scss +3 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/another_plain.css +3 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/plain.css +3 -0
- data/test_old/fixtures/alternate_config_project/app/assets/stylesheets/subfolder/second_level.scss +1 -0
- data/test_old/fixtures/alternate_config_project/app/controllers/application_controller.rb +3 -0
- data/test_old/fixtures/alternate_config_project/app/helpers/application_helper.rb +2 -0
- 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 +14 -0
- data/test_old/fixtures/alternate_config_project/config.ru +4 -0
- data/test_old/fixtures/alternate_config_project/config/application.rb +49 -0
- data/test_old/fixtures/alternate_config_project/config/boot.rb +6 -0
- data/test_old/fixtures/alternate_config_project/config/database.yml +25 -0
- data/test_old/fixtures/alternate_config_project/config/environment.rb +5 -0
- data/test_old/fixtures/alternate_config_project/config/environments/development.rb +27 -0
- data/test_old/fixtures/alternate_config_project/config/environments/production.rb +60 -0
- data/test_old/fixtures/alternate_config_project/config/environments/test.rb +42 -0
- data/test_old/fixtures/alternate_config_project/config/initializers/backtrace_silencers.rb +7 -0
- data/test_old/fixtures/alternate_config_project/config/initializers/inflections.rb +10 -0
- data/test_old/fixtures/alternate_config_project/config/initializers/mime_types.rb +5 -0
- data/test_old/fixtures/alternate_config_project/config/initializers/secret_token.rb +7 -0
- data/test_old/fixtures/alternate_config_project/config/initializers/session_store.rb +8 -0
- data/test_old/fixtures/alternate_config_project/config/initializers/wrap_parameters.rb +12 -0
- data/test_old/fixtures/alternate_config_project/config/locales/en.yml +5 -0
- data/test_old/fixtures/alternate_config_project/config/routes.rb +58 -0
- data/test_old/fixtures/alternate_config_project/db/seeds.rb +7 -0
- data/test_old/fixtures/alternate_config_project/doc/README_FOR_APP +2 -0
- 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 +26 -0
- data/test_old/fixtures/alternate_config_project/public/422.html +26 -0
- data/test_old/fixtures/alternate_config_project/public/500.html +26 -0
- data/test_old/fixtures/alternate_config_project/public/favicon.ico +0 -0
- data/test_old/fixtures/alternate_config_project/public/index.html +241 -0
- data/test_old/fixtures/alternate_config_project/public/robots.txt +5 -0
- data/test_old/fixtures/alternate_config_project/script/rails +6 -0
- data/test_old/fixtures/engine_project/.gitignore +8 -0
- data/test_old/fixtures/engine_project/Gemfile +14 -0
- data/test_old/fixtures/engine_project/MIT-LICENSE +20 -0
- data/test_old/fixtures/engine_project/README.rdoc +3 -0
- data/test_old/fixtures/engine_project/Rakefile +34 -0
- 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 +16 -0
- data/test_old/fixtures/engine_project/app/assets/stylesheets/engine_project/application.css +13 -0
- data/test_old/fixtures/engine_project/app/controllers/engine_project/application_controller.rb +4 -0
- data/test_old/fixtures/engine_project/app/helpers/engine_project/application_helper.rb +4 -0
- data/test_old/fixtures/engine_project/app/views/layouts/engine_project/application.html.erb +14 -0
- data/test_old/fixtures/engine_project/config/routes.rb +2 -0
- data/test_old/fixtures/engine_project/engine_project.gemspec +23 -0
- data/test_old/fixtures/engine_project/lib/engine_project.rb +4 -0
- data/test_old/fixtures/engine_project/lib/engine_project/engine.rb +5 -0
- data/test_old/fixtures/engine_project/lib/engine_project/version.rb +3 -0
- data/test_old/fixtures/engine_project/lib/tasks/engine_project_tasks.rake +4 -0
- data/test_old/fixtures/engine_project/script/rails +8 -0
- data/test_old/fixtures/engine_project/test/dummy/README.rdoc +28 -0
- data/test_old/fixtures/engine_project/test/dummy/Rakefile +6 -0
- data/test_old/fixtures/engine_project/test/dummy/app/assets/javascripts/application.js +16 -0
- data/test_old/fixtures/engine_project/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test_old/fixtures/engine_project/test/dummy/app/controllers/application_controller.rb +5 -0
- 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 +2 -0
- 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 +14 -0
- data/test_old/fixtures/engine_project/test/dummy/bin/bundle +3 -0
- data/test_old/fixtures/engine_project/test/dummy/bin/rails +4 -0
- data/test_old/fixtures/engine_project/test/dummy/bin/rake +4 -0
- data/test_old/fixtures/engine_project/test/dummy/config.ru +4 -0
- data/test_old/fixtures/engine_project/test/dummy/config/application.rb +23 -0
- data/test_old/fixtures/engine_project/test/dummy/config/boot.rb +9 -0
- data/test_old/fixtures/engine_project/test/dummy/config/database.yml +25 -0
- data/test_old/fixtures/engine_project/test/dummy/config/environment.rb +5 -0
- data/test_old/fixtures/engine_project/test/dummy/config/environments/development.rb +27 -0
- data/test_old/fixtures/engine_project/test/dummy/config/environments/production.rb +84 -0
- data/test_old/fixtures/engine_project/test/dummy/config/environments/test.rb +40 -0
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/inflections.rb +16 -0
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/secret_token.rb +12 -0
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/session_store.rb +3 -0
- data/test_old/fixtures/engine_project/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test_old/fixtures/engine_project/test/dummy/config/locales/en.yml +23 -0
- data/test_old/fixtures/engine_project/test/dummy/config/routes.rb +4 -0
- 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 +27 -0
- data/test_old/fixtures/engine_project/test/dummy/public/422.html +26 -0
- data/test_old/fixtures/engine_project/test/dummy/public/500.html +26 -0
- data/test_old/fixtures/engine_project/test/dummy/public/favicon.ico +0 -0
- data/test_old/fixtures/sass_project/.gitignore +5 -0
- data/test_old/fixtures/sass_project/Gemfile +7 -0
- data/test_old/fixtures/sass_project/README +261 -0
- data/test_old/fixtures/sass_project/Rakefile +7 -0
- data/test_old/fixtures/sass_project/app/assets/images/rails.png +0 -0
- data/test_old/fixtures/sass_project/app/assets/javascripts/application.js +9 -0
- data/test_old/fixtures/sass_project/app/assets/stylesheets/application.css +7 -0
- data/test_old/fixtures/sass_project/app/controllers/application_controller.rb +3 -0
- data/test_old/fixtures/sass_project/app/helpers/application_helper.rb +2 -0
- 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 +14 -0
- data/test_old/fixtures/sass_project/config.ru +4 -0
- data/test_old/fixtures/sass_project/config/application.rb +52 -0
- data/test_old/fixtures/sass_project/config/boot.rb +6 -0
- data/test_old/fixtures/sass_project/config/database.yml +25 -0
- data/test_old/fixtures/sass_project/config/environment.rb +5 -0
- data/test_old/fixtures/sass_project/config/environments/development.rb +24 -0
- data/test_old/fixtures/sass_project/config/environments/production.rb +58 -0
- data/test_old/fixtures/sass_project/config/environments/test.rb +43 -0
- data/test_old/fixtures/sass_project/config/initializers/backtrace_silencers.rb +7 -0
- data/test_old/fixtures/sass_project/config/initializers/inflections.rb +10 -0
- data/test_old/fixtures/sass_project/config/initializers/mime_types.rb +5 -0
- data/test_old/fixtures/sass_project/config/initializers/secret_token.rb +7 -0
- data/test_old/fixtures/sass_project/config/initializers/session_store.rb +8 -0
- data/test_old/fixtures/sass_project/config/initializers/wrap_parameters.rb +12 -0
- data/test_old/fixtures/sass_project/config/locales/en.yml +5 -0
- data/test_old/fixtures/sass_project/config/routes.rb +58 -0
- data/test_old/fixtures/sass_project/db/seeds.rb +7 -0
- data/test_old/fixtures/sass_project/doc/README_FOR_APP +2 -0
- 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 +26 -0
- data/test_old/fixtures/sass_project/public/422.html +26 -0
- data/test_old/fixtures/sass_project/public/500.html +26 -0
- data/test_old/fixtures/sass_project/public/favicon.ico +0 -0
- data/test_old/fixtures/sass_project/public/index.html +241 -0
- data/test_old/fixtures/sass_project/public/robots.txt +5 -0
- data/test_old/fixtures/sass_project/script/rails +6 -0
- data/test_old/fixtures/scss_project/.gitignore +5 -0
- data/test_old/fixtures/scss_project/Gemfile +7 -0
- data/test_old/fixtures/scss_project/README +261 -0
- data/test_old/fixtures/scss_project/Rakefile +7 -0
- 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 +9 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/_top_level_partial.scss +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/application.scss +38 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/css_application.css +11 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/css_erb_handler.css.erb +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/css_sass_erb_handler.sass.erb +2 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/css_scss_erb_handler.scss.erb +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/globbed/globbed.scss +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/globbed/nested/nested_glob.scss +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/import_css_application.scss +5 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_css_sass_import.sass +5 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_sass_import.sass +2 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_scss_import.scss +9 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/_without_css_ext.scss +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_sass.sass +2 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/_relative_scss.scss +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.scss +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/sass_erb_handler.sass.erb +2 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/scss_erb_handler.scss.erb +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/_defaults.scss +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/another_plain.css +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/plain.css +3 -0
- data/test_old/fixtures/scss_project/app/assets/stylesheets/subfolder/second_level.scss +2 -0
- data/test_old/fixtures/scss_project/app/controllers/application_controller.rb +3 -0
- data/test_old/fixtures/scss_project/app/helpers/application_helper.rb +2 -0
- 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 +14 -0
- data/test_old/fixtures/scss_project/config.ru +4 -0
- data/test_old/fixtures/scss_project/config/application.rb +49 -0
- data/test_old/fixtures/scss_project/config/boot.rb +6 -0
- data/test_old/fixtures/scss_project/config/database.yml +25 -0
- data/test_old/fixtures/scss_project/config/environment.rb +5 -0
- data/test_old/fixtures/scss_project/config/environments/development.rb +23 -0
- data/test_old/fixtures/scss_project/config/environments/production.rb +57 -0
- data/test_old/fixtures/scss_project/config/environments/test.rb +42 -0
- data/test_old/fixtures/scss_project/config/initializers/backtrace_silencers.rb +7 -0
- data/test_old/fixtures/scss_project/config/initializers/inflections.rb +10 -0
- data/test_old/fixtures/scss_project/config/initializers/mime_types.rb +5 -0
- data/test_old/fixtures/scss_project/config/initializers/postprocessor.rb +3 -0
- data/test_old/fixtures/scss_project/config/initializers/secret_token.rb +7 -0
- data/test_old/fixtures/scss_project/config/initializers/session_store.rb +8 -0
- data/test_old/fixtures/scss_project/config/initializers/wrap_parameters.rb +12 -0
- data/test_old/fixtures/scss_project/config/locales/en.yml +5 -0
- data/test_old/fixtures/scss_project/config/routes.rb +58 -0
- data/test_old/fixtures/scss_project/db/seeds.rb +7 -0
- data/test_old/fixtures/scss_project/doc/README_FOR_APP +2 -0
- 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 +26 -0
- data/test_old/fixtures/scss_project/public/422.html +26 -0
- data/test_old/fixtures/scss_project/public/500.html +26 -0
- data/test_old/fixtures/scss_project/public/favicon.ico +0 -0
- data/test_old/fixtures/scss_project/public/index.html +241 -0
- data/test_old/fixtures/scss_project/public/robots.txt +5 -0
- data/test_old/fixtures/scss_project/script/rails +6 -0
- data/test_old/sass_rails_test.rb +203 -0
- data/test_old/support/sass_rails_test_case.rb +181 -0
- data/test_old/test_helper.rb +27 -0
- metadata +416 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 523c8a396ba041547d8802a7a0803a8f9d101d15
|
|
4
|
+
data.tar.gz: e06a714560f3d93aca54ad05847a2d98e45761e2
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 2bac2ce68c73bfa143fa97e0e8c929630b36bfd16607133439d56d716bedc51cd5a85adf82273700d1e5a8791cafe2f5c5b38bea68a87ed87f314f086cafdcc4
|
|
7
|
+
data.tar.gz: 03edfdc187118fb73f5d00246476a62a556a75c9bb9d86f44df76994d1b25c546aca2954fa05afe666903d0302a373e650f80aca9936049190078ed9d1bbad93
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2015 Ryan Boland
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# SassC::Rails
|
|
2
|
+
|
|
3
|
+
## WIP.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'sassc-rails'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
|
|
15
|
+
$ bundle
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
TODO: Write usage instructions here
|
|
21
|
+
|
|
22
|
+
## Contributing
|
|
23
|
+
|
|
24
|
+
1. Fork it ( https://github.com/[my-github-username]/sassc-rails/fork )
|
|
25
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
26
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
27
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
28
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/lib/sassc-rails.rb
ADDED
data/lib/sassc/rails.rb
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
require 'active_support/deprecation/reporting'
|
|
2
|
+
require 'sass'
|
|
3
|
+
require 'sprockets/sass_importer'
|
|
4
|
+
require 'tilt'
|
|
5
|
+
|
|
6
|
+
module Sass
|
|
7
|
+
module Rails
|
|
8
|
+
class SassImporter < Sass::Importers::Filesystem
|
|
9
|
+
module Globbing
|
|
10
|
+
GLOB = /(\A|\/)(\*|\*\*\/\*)\z/
|
|
11
|
+
|
|
12
|
+
def find_relative(name, base, options)
|
|
13
|
+
if options[:sprockets] && m = name.match(GLOB)
|
|
14
|
+
path = name.sub(m[0], "")
|
|
15
|
+
base = File.expand_path(path, File.dirname(base))
|
|
16
|
+
glob_imports(base, m[2], options)
|
|
17
|
+
else
|
|
18
|
+
super
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def find(name, options)
|
|
23
|
+
# globs must be relative
|
|
24
|
+
return if name =~ GLOB
|
|
25
|
+
super
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
def glob_imports(base, glob, options)
|
|
30
|
+
contents = ""
|
|
31
|
+
context = options[:sprockets][:context]
|
|
32
|
+
each_globbed_file(base, glob, context) do |filename|
|
|
33
|
+
next if filename == options[:filename]
|
|
34
|
+
contents << "@import #{filename.inspect};\n"
|
|
35
|
+
end
|
|
36
|
+
return nil if contents == ""
|
|
37
|
+
Sass::Engine.new(contents, options.merge(
|
|
38
|
+
:filename => base,
|
|
39
|
+
:importer => self,
|
|
40
|
+
:syntax => :scss
|
|
41
|
+
))
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def each_globbed_file(base, glob, context)
|
|
45
|
+
raise ArgumentError unless glob == "*" || glob == "**/*"
|
|
46
|
+
|
|
47
|
+
exts = extensions.keys.map { |ext| Regexp.escape(".#{ext}") }.join("|")
|
|
48
|
+
sass_re = Regexp.compile("(#{exts})$")
|
|
49
|
+
|
|
50
|
+
context.depend_on(base)
|
|
51
|
+
|
|
52
|
+
Dir["#{base}/#{glob}"].sort.each do |path|
|
|
53
|
+
if File.directory?(path)
|
|
54
|
+
context.depend_on(path)
|
|
55
|
+
elsif sass_re =~ path
|
|
56
|
+
yield path
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
module ERB
|
|
63
|
+
def extensions
|
|
64
|
+
{
|
|
65
|
+
'css.erb' => :scss_erb,
|
|
66
|
+
'scss.erb' => :scss_erb,
|
|
67
|
+
'sass.erb' => :sass_erb
|
|
68
|
+
}.merge(super)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def erb_extensions
|
|
72
|
+
{
|
|
73
|
+
:scss_erb => :scss,
|
|
74
|
+
:sass_erb => :sass
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def find_relative(*args)
|
|
79
|
+
process_erb_engine(super)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def find(*args)
|
|
83
|
+
process_erb_engine(super)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
private
|
|
87
|
+
def process_erb_engine(engine)
|
|
88
|
+
if engine && engine.options[:sprockets] && syntax = erb_extensions[engine.options[:syntax]]
|
|
89
|
+
template = Tilt::ERBTemplate.new(engine.options[:filename])
|
|
90
|
+
contents = template.render(engine.options[:sprockets][:context], {})
|
|
91
|
+
|
|
92
|
+
Sass::Engine.new(contents, engine.options.merge(:syntax => syntax))
|
|
93
|
+
else
|
|
94
|
+
engine
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
module Deprecated
|
|
100
|
+
def extensions
|
|
101
|
+
{
|
|
102
|
+
'css.scss' => :scss,
|
|
103
|
+
'css.sass' => :sass,
|
|
104
|
+
'css.scss.erb' => :scss_erb,
|
|
105
|
+
'css.sass.erb' => :sass_erb
|
|
106
|
+
}.merge(super)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def find_relative(*args)
|
|
110
|
+
deprecate_extra_css_extension(super)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def find(*args)
|
|
114
|
+
deprecate_extra_css_extension(super)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
private
|
|
118
|
+
def deprecate_extra_css_extension(engine)
|
|
119
|
+
if engine && filename = engine.options[:filename]
|
|
120
|
+
if filename.end_with?('.css.scss')
|
|
121
|
+
msg = "Extra .css in SCSS file is unnecessary. Rename #{filename} to #{filename.sub('.css.scss', '.scss')}."
|
|
122
|
+
elsif filename.end_with?('.css.sass')
|
|
123
|
+
msg = "Extra .css in SASS file is unnecessary. Rename #{filename} to #{filename.sub('.css.sass', '.sass')}."
|
|
124
|
+
elsif filename.end_with?('.css.scss.erb')
|
|
125
|
+
msg = "Extra .css in SCSS/ERB file is unnecessary. Rename #{filename} to #{filename.sub('.css.scss.erb', '.scss.erb')}."
|
|
126
|
+
elsif filename.end_with?('.css.sass.erb')
|
|
127
|
+
msg = "Extra .css in SASS/ERB file is unnecessary. Rename #{filename} to #{filename.sub('.css.sass.erb', '.sass.erb')}."
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
ActiveSupport::Deprecation.warn(msg) if msg
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
engine
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
include Deprecated
|
|
138
|
+
include ERB
|
|
139
|
+
include Globbing
|
|
140
|
+
|
|
141
|
+
# Allow .css files to be @import'd
|
|
142
|
+
def extensions
|
|
143
|
+
{ 'css' => :scss }.merge(super)
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'sass/logger'
|
|
2
|
+
|
|
3
|
+
module Sass
|
|
4
|
+
module Rails
|
|
5
|
+
class Logger < Sass::Logger::Base
|
|
6
|
+
def _log(level, message)
|
|
7
|
+
|
|
8
|
+
case level
|
|
9
|
+
when :trace, :debug
|
|
10
|
+
::Rails.logger.debug message
|
|
11
|
+
when :warn
|
|
12
|
+
::Rails.logger.warn message
|
|
13
|
+
when :error
|
|
14
|
+
::Rails.logger.error message
|
|
15
|
+
when :info
|
|
16
|
+
::Rails.logger.info message
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
require 'active_support/core_ext/class/attribute'
|
|
2
|
+
require 'sprockets/railtie'
|
|
3
|
+
|
|
4
|
+
module SassC::Rails
|
|
5
|
+
class Railtie < ::Rails::Railtie
|
|
6
|
+
config.sass = ActiveSupport::OrderedOptions.new
|
|
7
|
+
|
|
8
|
+
# Establish static configuration defaults
|
|
9
|
+
# Emit scss files during stylesheet generation of scaffold
|
|
10
|
+
config.sass.preferred_syntax = :scss
|
|
11
|
+
# Initialize the load paths to an empty array
|
|
12
|
+
config.sass.load_paths = []
|
|
13
|
+
|
|
14
|
+
# Set the default stylesheet engine
|
|
15
|
+
# It can be overridden by passing:
|
|
16
|
+
# --stylesheet_engine=sass
|
|
17
|
+
# to the rails generate command
|
|
18
|
+
config.app_generators.stylesheet_engine config.sass.preferred_syntax
|
|
19
|
+
|
|
20
|
+
if config.respond_to?(:annotations)
|
|
21
|
+
config.annotations.register_extensions("scss", "sass") { |annotation| /\/\/\s*(#{annotation}):?\s*(.*)$/ }
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Remove the sass middleware if it gets inadvertently enabled by applications.
|
|
25
|
+
config.after_initialize do |app|
|
|
26
|
+
app.config.middleware.delete(Sass::Plugin::Rack) if defined?(Sass::Plugin::Rack)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
initializer :setup_sass, group: :all do |app|
|
|
30
|
+
# Only emit one kind of syntax because though we have registered two kinds of generators
|
|
31
|
+
syntax = app.config.sass.preferred_syntax.to_sym
|
|
32
|
+
alt_syntax = syntax == :sass ? "scss" : "sass"
|
|
33
|
+
app.config.generators.hide_namespace alt_syntax
|
|
34
|
+
|
|
35
|
+
# Override stylesheet engine to the preferred syntax
|
|
36
|
+
config.app_generators.stylesheet_engine syntax
|
|
37
|
+
|
|
38
|
+
# Establish configuration defaults that are evironmental in nature
|
|
39
|
+
# if config.sass.full_exception.nil?
|
|
40
|
+
# # Display a stack trace in the css output when in development-like environments.
|
|
41
|
+
# config.sass.full_exception = app.config.consider_all_requests_local
|
|
42
|
+
# end
|
|
43
|
+
|
|
44
|
+
if app.assets
|
|
45
|
+
app.assets.register_engine '.sass', SassC::Rails::SassTemplate
|
|
46
|
+
app.assets.register_engine '.scss', SassC::Rails::ScssTemplate
|
|
47
|
+
|
|
48
|
+
app.assets.context_class.class_eval do
|
|
49
|
+
class_attribute :sass_config
|
|
50
|
+
self.sass_config = app.config.sass
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
initializer :setup_compression, group: :all do |app|
|
|
56
|
+
if !Rails.env.development?
|
|
57
|
+
app.config.assets.css_compressor ||= :sass
|
|
58
|
+
else
|
|
59
|
+
# Use expanded output instead of the sass default of :nested unless specified
|
|
60
|
+
app.config.sass.style ||= :expanded
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require 'sassc'
|
|
2
|
+
require "sprockets/sass_template"
|
|
3
|
+
require "sprockets/utils"
|
|
4
|
+
|
|
5
|
+
module SassC::Rails
|
|
6
|
+
class SassTemplate < Sprockets::SassTemplate
|
|
7
|
+
def call(input)
|
|
8
|
+
context = input[:environment].context_class.new(input)
|
|
9
|
+
|
|
10
|
+
options = {
|
|
11
|
+
filename: input[:filename],
|
|
12
|
+
syntax: self.class.syntax,
|
|
13
|
+
load_paths: input[:environment].paths,
|
|
14
|
+
sprockets: {
|
|
15
|
+
context: context,
|
|
16
|
+
environment: input[:environment],
|
|
17
|
+
dependencies: context.metadata[:dependency_paths]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
engine = ::SassC::Engine.new(input[:data], options)
|
|
22
|
+
|
|
23
|
+
css = Sprockets::Utils.module_include(::SassC::Script::Functions, @functions) do
|
|
24
|
+
engine.render
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Track all imported files
|
|
28
|
+
engine.dependencies.map do |dependency|
|
|
29
|
+
context.metadata[:dependency_paths] << dependency.options[:filename]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
context.metadata.merge(data: css)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class ScssTemplate < SassTemplate
|
|
38
|
+
def self.syntax
|
|
39
|
+
:scss
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
data/sassc-rails.gemspec
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'sassc/rails/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "sassc-rails"
|
|
8
|
+
spec.version = SassC::Rails::VERSION
|
|
9
|
+
spec.authors = ["Ryan Boland"]
|
|
10
|
+
spec.email = ["bolandryanm@gmail.com"]
|
|
11
|
+
spec.summary = %q{Integrate SassC-Ruby into Rails.}
|
|
12
|
+
spec.description = %q{Integrate SassC-Ruby into Rails.}
|
|
13
|
+
spec.homepage = "https://github.com/bolandrm/sassc-rails"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ["lib"]
|
|
20
|
+
|
|
21
|
+
spec.add_development_dependency 'pry'
|
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
24
|
+
spec.add_development_dependency "minitest", "~> 5.5.1"
|
|
25
|
+
spec.add_development_dependency 'rails'
|
|
26
|
+
|
|
27
|
+
# unfortunately we require sass for now, so that we can
|
|
28
|
+
# reuse portions of the sprockets template
|
|
29
|
+
spec.add_dependency 'sass'
|
|
30
|
+
|
|
31
|
+
spec.add_dependency "sassc", "0.0.7"
|
|
32
|
+
spec.add_dependency 'railties'
|
|
33
|
+
spec.add_dependency 'sprockets', '3.0.0.beta.6'
|
|
34
|
+
end
|
|
File without changes
|