sassc-rails-2.1.2/0000755000175000017500000000000013525004651012455 5ustar srudsrudsassc-rails-2.1.2/Rakefile0000644000175000017500000000134013525004651014120 0ustar srudsrudrequire "bundler/gem_tasks" task :test do $LOAD_PATH.unshift('lib', 'test') Dir.glob('./test/**/*_test.rb') { |f| require f } end task :default => [:test] namespace :tests do gemfiles = %w[ sprockets-rails_3_0 sprockets-rails_2_3 sprockets_3_0 sprockets_4_0 rails_4_2 rails_5_2 ] gemfiles.each do |gemfile| desc "Run tests against #{gemfile}" task gemfile do sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle install" sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle exec rake test" end end desc "Run tests against all common asset pipeline setups" task :all do gemfiles.each do |gemfile| Rake::Task["tests:#{gemfile}"].invoke end end end sassc-rails-2.1.2/README.md0000644000175000017500000001111613525004651013734 0ustar srudsrud# 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) We all love working with Sass, but compilation can take quite a long time for larger codebases. This gem integrates the C implementation of Sass, [LibSass](https://github.com/sass/libsass), into the asset pipeline. In one larger project, this made compilation 4x faster: ``` # Using sassc-rails [1] pry(main)> Benchmark.bm { |bm| bm.report { Rails.application.assets["application.css"] } } user system total real 1.720000 0.170000 1.890000 ( 1.936867) # Using sass-rails [1] pry(main)> Benchmark.bm { |bm| bm.report { Rails.application.assets["application.css"] } } user system total real 7.820000 0.250000 8.070000 ( 8.106347) ``` This should essentially be a drop in alternative to [sass-rails](https://github.com/rails/sass-rails). ## Inline Source Maps With SassC-Rails, it's also extremely easy to turn on inline source maps. Simply add the following configuration to your development.rb file: ```ruby # config/environments/development.rb config.sass.inline_source_maps = true ``` After adding this config line, you may need to clear your assets cache (`rm -r tmp/cache/assets`), stop spring, and restart your rails server. You may also wish to disable line comments (`config.sass.line_comments = false`). Note, as indicated, these source maps are *inline*. They will not generate additional files or anything like that. Instead, they will be appended to the compiled application.css file. ## LibSass Compatibility With Ruby Sass For a look at the compatibility between Ruby Sass and LibSass, check this [compatibility chart](http://sass-compatibility.github.io/) out. ## Installation Add this line to your application's Gemfile: ```ruby gem 'sassc-rails' ``` And then execute: $ bundle ## Common Issues ### Deployment to Heroku Due to LibSass compilation requirements, you must upgrade to the [Heroku Cedar-14 Stack](https://devcenter.heroku.com/articles/cedar-14-migration) in order to successfully install this gem. Upgrading to Cedar-14 is usually a painless process. ### Installing alongside a gem that depends on Sass-Rails Libraries explicitly depending on Sass-Rails, such as ActiveAdmin, can cause conflicts with installation of SassC-Rails. While we have no built-in solution for this, please check out [this issue](https://github.com/sass/sassc-rails/issues/6) for a workaround. ## Credits This gem is based on [sass-rails](https://github.com/rails/sass-rails), and is maintained by [Ryan Boland](https://ryanboland.com) and [awesome contributors](https://github.com/sass/sassc-rails/graphs/contributors). ## Changelog - **2.1.2** - [Correct reference to SassC::Script::Value::String](https://github.com/sass/sassc-rails/pull/129) - **2.1.1** - [Fix Scaffolding](https://github.com/sass/sassc-rails/pull/119) - **2.1.0** - [JRuby support](https://github.com/sass/sassc-rails/pull/113) - [SCSS / SASS scaffolding](https://github.com/sass/sassc-rails/pull/112) - **2.0.0** - [Drop support for Sprockets 2](https://github.com/sass/sassc-rails/pull/109) - [Remove dependency on Ruby Sass](https://github.com/sass/sassc-rails/pull/109) - **1.3.0** - [Silence Sprockets deprecation warnings](https://github.com/sass/sassc-rails/pull/76) - [Sprockets 4 compatibility](https://github.com/sass/sassc-rails/pull/65) - **1.2.1** - Bump SassC (and thus LibSass) version - **1.2.0** - [Support sprockets-rails 3](https://github.com/sass/sassc-rails/pull/41) - [Only depend on Railties instead of full Rails](https://github.com/sass/sassc-rails/pull/52) - **1.1.0** - Moved under the official sass organization! - [Source line comments](https://github.com/sass/sassc-rails/pull/24) (`app.config.sass.line_comments`) - [Prevent sass-rails railtie from running](https://github.com/sass/sassc-rails/pull/34) - [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. - **1.0.0** - Initial Release - Add support for inline source maps - Support compression in the way that Sass-Rails handles it ## Contributing 1. Fork it ( https://github.com/sass/sassc-rails/fork ) 1. Create your feature branch (`git checkout -b my-new-feature`) 1. Commit your changes (`git commit -am 'Add some feature'`) 1. Add Tests 1. Push to the branch (`git push origin my-new-feature`) 1. Create a new Pull Request sassc-rails-2.1.2/.gitignore0000644000175000017500000000022313525004651014442 0ustar srudsrud/.bundle/ /.yardoc /Gemfile.lock /gemfiles/*.lock /_yardoc/ /coverage/ /doc/ /pkg/ /spec/reports/ tmp/ *.bundle *.so *.o *.a mkmf.log vendor *.log sassc-rails-2.1.2/.travis.yml0000644000175000017500000000115213525004651014565 0ustar srudsrudlanguage: ruby bundler_args: "--binstubs --standalone --without documentation --path ../bundle" script: "bundle exec rake test" before_install: - rvm @global do gem uninstall bundler -x - gem install bundler --version '< 2' gemfile: - gemfiles/sprockets-rails_3_0.gemfile - gemfiles/sprockets-rails_2_3.gemfile - gemfiles/sprockets_3_0.gemfile - gemfiles/sprockets_4_0.gemfile - gemfiles/rails_4_2.gemfile - gemfiles/rails_5_2.gemfile rvm: - 2.4.6 - 2.5.5 - 2.6.3 - jruby matrix: allow_failures: - gemfile: gemfiles/rails_4_2.gemfile rvm: jruby notifications: email: false sassc-rails-2.1.2/test/0000755000175000017500000000000013525004651013434 5ustar srudsrudsassc-rails-2.1.2/test/sassc_rails_test.rb0000644000175000017500000002743313525004651017337 0ustar srudsrud# frozen_string_literal: true require "test_helper" class SassRailsTest < MiniTest::Test attr_reader :app def setup Rails.application = nil @app = Class.new(Rails::Application) @app.config.active_support.deprecation = :log @app.config.eager_load = false @app.config.root = File.join(File.dirname(__FILE__), "dummy") @app.config.log_level = :debug # reset config back to default @app.config.assets.delete(:css_compressor) @app.config.sass = ActiveSupport::OrderedOptions.new @app.config.sass.preferred_syntax = :scss @app.config.sass.load_paths = [] # Not actually a default, but it makes assertions more complicated @app.config.sass.line_comments = false # Add a fake compressor for testing purposes Sprockets.register_compressor "text/css", :test, TestCompressor Rails.backtrace_cleaner.remove_silencers! end def teardown directory = "#{Rails.root}/tmp" FileUtils.remove_dir(directory) if File.directory?(directory) end def render_asset(asset) app.assets[asset].to_s end def initialize! Rails.env = "test" @app.initialize! end def initialize_dev! Rails.env = "development" @app.initialize! end def initialize_prod! Rails.env = "production" @app.initialize! end def test_setup_works initialize_dev! asset = render_asset("application.css") assert_equal <<-CSS, asset .hello { color: #FFF; } CSS end def test_raises_sassc_syntax_error initialize! assert_raises(SassC::SyntaxError) do render_asset("syntax_error.css") end end def test_all_sass_asset_paths_work skip initialize! css_output = render_asset("helpers_test.css") assert_match %r{asset-path:\s*"/assets/rails.png"}, css_output, 'asset-path:\s*"/assets/rails.png"' assert_match %r{asset-url:\s*url\(/assets/rails.png\)}, css_output, 'asset-url:\s*url\(/assets/rails.png\)' assert_match %r{image-path:\s*"/assets/rails.png"}, css_output, 'image-path:\s*"/assets/rails.png"' assert_match %r{image-url:\s*url\(/assets/rails.png\)}, css_output, 'image-url:\s*url\(/assets/rails.png\)' end def test_sass_asset_paths_work initialize! css_output = render_asset("helpers_test.css") assert_match %r{video-path:\s*"/videos/rails.mp4"}, css_output, 'video-path:\s*"/videos/rails.mp4"' assert_match %r{video-url:\s*url\(/videos/rails.mp4\)}, css_output, 'video-url:\s*url\(/videos/rails.mp4\)' assert_match %r{audio-path:\s*"/audios/rails.mp3"}, css_output, 'audio-path:\s*"/audios/rails.mp3"' assert_match %r{audio-url:\s*url\(/audios/rails.mp3\)}, css_output, 'audio-url:\s*url\(/audios/rails.mp3\)' assert_match %r{font-path:\s*"/fonts/rails.ttf"}, css_output, 'font-path:\s*"/fonts/rails.ttf"' assert_match %r{font-url:\s*url\(/fonts/rails.ttf\)}, css_output, 'font-url:\s*url\(/fonts/rails.ttf\)' assert_match %r{font-url-with-query-hash:\s*url\(/fonts/rails.ttf\?#iefix\)}, css_output, 'font-url:\s*url\(/fonts/rails.ttf?#iefix\)' assert_match %r{javascript-path:\s*"/javascripts/rails.js"}, css_output, 'javascript-path:\s*"/javascripts/rails.js"' assert_match %r{javascript-url:\s*url\(/javascripts/rails.js\)}, css_output, 'javascript-url:\s*url\(/javascripts/rails.js\)' assert_match %r{stylesheet-path:\s*"/stylesheets/rails.css"}, css_output, 'stylesheet-path:\s*"/stylesheets/rails.css"' assert_match %r{stylesheet-url:\s*url\(/stylesheets/rails.css\)}, css_output, 'stylesheet-url:\s*url\(/stylesheets/rails.css\)' asset_data_url_regexp = %r{asset-data-url:\s*url\((.*?)\)} assert_match asset_data_url_regexp, css_output, 'asset-data-url:\s*url\((.*?)\)' asset_data_url_match = css_output.match(asset_data_url_regexp)[1] asset_data_url_expected = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%" + "2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjA" + "xMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRw" + "Oi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDc" + "mVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCNzY5NDE1QkQ2NkMxMUUwOUUzM0E5Q0E2RTgyQUExQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpCNzY5NDE1Q0" + "Q2NkMxMUUwOUUzM0E5Q0E2RTgyQUExQiI%2BIDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE3MzcyNTQ2RDY2QjExRTA5RTMzQTlDQTZFODJBQTFCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkI3Njk0M" + "TVBRDY2QzExRTA5RTMzQTlDQTZFODJBQTFCIi8%2BIDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY%2BIDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8%2B0HhJ9AAAABBJREFUeNpi%2BP%2F%2FPwNAgAEACPwC%2FtuiTRYAAAAA" + "SUVORK5CYII%3D" assert_equal asset_data_url_expected, asset_data_url_match end def test_sass_imports_work_correctly app.config.sass.load_paths << Rails.root.join('app/assets/stylesheets/in_load_paths') initialize! css_output = render_asset("imports_test.css") assert_match /main/, css_output assert_match /top-level/, css_output assert_match /partial-sass/, css_output assert_match /partial-scss/, css_output assert_match /partial-foo/, css_output assert_match /sub-folder-relative-sass/, css_output assert_match /sub-folder-relative-scss/, css_output assert_match /not-a-partial/, css_output assert_match /plain-old-css/, css_output assert_match /another-plain-old-css/, css_output assert_match /without-css-ext/, css_output assert_match /css-scss-handler/, css_output assert_match /css-sass-handler/, css_output assert_match /css-erb-handler/, css_output assert_match /scss-erb-handler/, css_output assert_match /sass-erb-handler/, css_output # do these two actually test anything? # should the extension be changed? assert_match /css-sass-erb-handler/, css_output assert_match /css-scss-erb-handler/, css_output assert_match /default-old-css/, css_output assert_match /globbed/, css_output assert_match /nested-glob/, css_output assert_match /partial_in_load_paths/, css_output end def test_style_config_item_is_defaulted_to_expanded_in_development_mode initialize_dev! assert_equal :expanded, Rails.application.config.sass.style end def test_style_config_item_is_honored @app.config.sass.style = :nested initialize! assert_equal :nested, Rails.application.config.sass.style end def test_line_comments_active_in_dev @app.config.sass.line_comments = true initialize_dev! css_output = render_asset("css_scss_handler.css") assert_match %r{/* line 1}, css_output assert_match %r{.+test/dummy/app/assets/stylesheets/css_scss_handler.css.scss}, css_output end def test_context_is_being_passed_to_erb_render initialize! css_output = render_asset("erb_render_with_context.css.erb") assert_match /@font-face/, css_output end def test_special_characters_compile initialize! css_output = render_asset("special_characters.css") end def test_css_compressor_config_item_is_honored_if_not_development_mode @app.config.assets.css_compressor = :test initialize_prod! assert_equal :test, Rails.application.config.assets.css_compressor end def test_css_compressor_config_item_may_be_nil_in_test_mode @app.config.assets.css_compressor = nil initialize! assert_nil Rails.application.config.assets.css_compressor end def test_css_compressor_is_defined_in_test_mode initialize! assert_equal :sass, Rails.application.config.assets.css_compressor end def test_css_compressor_is_defined_in_prod_mode initialize_prod! assert_equal :sass, Rails.application.config.assets.css_compressor end def test_compression_works initialize_prod! asset = render_asset("application.css") assert_equal <<-CSS, asset .hello{color:#FFF} CSS end def test_compression_works initialize_prod! asset = render_asset("application.css") assert_equal <<-CSS, asset .hello{color:#FFF} CSS end def test_sassc_compression_is_used engine = stub(render: "") SassC::Engine.expects(:new).returns(engine) SassC::Engine.expects(:new).with("", {style: :compressed}).returns(engine) initialize_prod! render_asset("application.css") end def test_allows_for_inclusion_of_inline_source_maps @app.config.sass.inline_source_maps = true initialize_dev! asset = render_asset("application.css") assert_match /.hello/, asset assert_match /sourceMappingURL/, asset end #test 'sprockets require works correctly' do # skip # within_rails_app('scss_project') do |app_root| # css_output = asset_output('css_application.css') # assert_match /globbed/, css_output # if File.exist?("#{app_root}/log/development.log") # log_file = "#{app_root}/log/development.log" # elsif File.exist?("#{app_root}/log/test.log") # log_file = "#{app_root}/log/test.log" # else # flunk "log file was not created" # end # log_output = File.open(log_file).read # refute_match /Warning/, log_output # end #end #test 'sprockets directives are ignored within an import' do # skip # css_output = sprockets_render('scss_project', 'import_css_application.css') # assert_match /\.css-application/, css_output # assert_match /\.import-css-application/, css_output #end def test_globbed_imports_work_with_multiple_extensions initialize! asset = render_asset("glob_multiple_extensions_test.css") assert_equal <<-CSS, asset .glob{margin:0} CSS end def test_globbed_imports_work_when_globbed_file_is_changed skip "This seems to work in practice, possible test setup problem" begin initialize! new_file = File.join(File.dirname(__FILE__), 'dummy', 'app', 'assets', 'stylesheets', 'globbed', 'new_glob.scss') File.open(new_file, 'w') do |file| file.puts '.new-file-test { color: #000; }' end css_output = render_asset("glob_test.css") assert_match /new-file-test/, css_output File.open(new_file, 'w') do |file| file.puts '.changed-file-test { color: #000; }' end new_css_output = render_asset("glob_test.css") assert_match /changed-file-test/, new_css_output refute_equal css_output, new_css_output ensure File.delete(new_file) end end def test_globbed_imports_work_when_globbed_file_is_added begin initialize! css_output = render_asset("glob_test.css") refute_match /changed-file-test/, css_output new_file = File.join(File.dirname(__FILE__), 'dummy', 'app', 'assets', 'stylesheets', 'globbed', 'new_glob.scss') File.open(new_file, 'w') do |file| file.puts '.changed-file-test { color: #000; }' end new_css_output = render_asset("glob_test.css") assert_match /changed-file-test/, new_css_output refute_equal css_output, new_css_output ensure File.delete(new_file) end end class TestCompressor def self.call(*); end end end sassc-rails-2.1.2/test/dummy/0000755000175000017500000000000013525004651014567 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/0000755000175000017500000000000013525004651015347 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/0000755000175000017500000000000013525004651016651 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/fonts/0000755000175000017500000000000013525004651020002 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/fonts/fake-font.ttf0000644000175000017500000000000013525004651022361 0ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/stylesheets/0000755000175000017500000000000013525004651021225 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/stylesheets/sass_erb_handler.sass.erb0000644000175000017500000000004513525004651026164 0ustar srudsrud.sass-erb-handler margin: <%= 0 %> sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/special_characters.scss0000644000175000017500000000010213525004651025732 0ustar srudsrud$sißßßßßße: 30px; .hßß©i { width: $sißßßßßße; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/css_application.css0000644000175000017500000000032213525004651025107 0ustar srudsrud/* *= require partials/_sass_import *= require partials/_scss_import *= require_tree ./globbed *= require subfolder/plain *= require subfolder/second_level */ .css-application { background: #fff; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/application.scss0000644000175000017500000000005713525004651024427 0ustar srudsrud$b-color: #FFF; .hello { color: $b-color; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/syntax_error.scss0000644000175000017500000000003513525004651024657 0ustar srudsrud.hello { color $b-color; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/subfolder/0000755000175000017500000000000013525004651023212 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/stylesheets/subfolder/_defaults.scss0000644000175000017500000000004413525004651026053 0ustar srudsrud.default-old-css { margin: 0px; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/subfolder/plain.css0000644000175000017500000000005013525004651025022 0ustar srudsrud.plain-old-css { font-style: italic; }sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/subfolder/another_plain.css0000644000175000017500000000006113525004651026544 0ustar srudsrud.another-plain-old-css { font-style: italic; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/subfolder/second_level.scss0000644000175000017500000000025713525004651026555 0ustar srudsrud@import "another_plain"; /* tests whether relative lookups of non-sass files works. */ @import "defaults"; /* tests wheter relative lookups partials in the same directory. */ sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/globbed_multiple_extensions/0000755000175000017500000000000013525004651027015 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/stylesheets/globbed_multiple_extensions/glob.scss.erb0000644000175000017500000000003613525004651031403 0ustar srudsrud.glob { margin: <%= 0 %>; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/scss_erb_handler.scss.erb0000644000175000017500000000005213525004651026166 0ustar srudsrud.scss-erb-handler { margin: <%= 0 %>; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/glob_test.scss0000644000175000017500000000003013525004651024075 0ustar srudsrud@import "globbed/**/*"; sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/_top_level_partial.scss0000644000175000017500000000004213525004651025762 0ustar srudsrud.top-level { font-color: bold; }sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/glob_multiple_extensions_test.scss0000644000175000017500000000005413525004651030275 0ustar srudsrud@import "globbed_multiple_extensions/**/*"; sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/css_erb_handler.css.erb0000644000175000017500000000005113525004651025617 0ustar srudsrud.css-erb-handler { margin: <%= 0 %>; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/helpers_test.scss0000644000175000017500000000125013525004651024621 0ustar srudsrud.rails { asset-path: asset-path("rails.png"); asset-url: asset-url("rails.png"); image-path: image-path("rails.png"); image-url: image-url("rails.png"); video-path: video-path("rails.mp4"); video-url: video-url("rails.mp4"); audio-path: audio-path("rails.mp3"); audio-url: audio-url("rails.mp3"); font-path: font-path("rails.ttf"); font-url: font-url("rails.ttf"); font-url-with-query-hash: font-url("rails.ttf?#iefix"); javascript-path: javascript-path("rails.js"); javascript-url: javascript-url("rails.js"); stylesheet-path: stylesheet-path("rails.css"); stylesheet-url: stylesheet-url("rails.css"); asset-data-url: asset-data-url("1x1.png"); } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/css_sass_erb_handler.sass.erb0000644000175000017500000000005113525004651027031 0ustar srudsrud.css-sass-erb-handler margin: <%= 0 %> sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/in_load_paths/0000755000175000017500000000000013525004651024031 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/stylesheets/in_load_paths/partial_in_load_paths.scss0000644000175000017500000000005413525004651031245 0ustar srudsrud.partial_in_load_paths { color: #BADA55 } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/imports_test.scss0000644000175000017500000000113313525004651024654 0ustar srudsrud@import "partials/css_sass_import"; @import "partials/sass_import"; @import "partials/scss_import"; @import "partials/explicit_extension_import.foo"; @import "globbed/**/*"; @import "subfolder/plain"; @import "subfolder/second_level"; @import "partials/without_css_ext"; @import "css_erb_handler"; @import "scss_erb_handler"; @import "sass_erb_handler"; @import "css_scss_handler"; @import "css_sass_handler"; @import "css_scss_erb_handler"; @import "css_sass_erb_handler"; @import 'partial_in_load_paths'; .main { color: yellow; @include background-from-partial(red); } @include without-css-ext; sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/partials/0000755000175000017500000000000013525004651023044 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/stylesheets/partials/_scss_import.scss0000644000175000017500000000026713525004651026452 0ustar srudsrud.partial-scss { color: blue; } @mixin background-from-partial($color) { background-color: $color } @import "subfolder/relative_sass"; @import "subfolder/relative_not_a_partial";sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/partials/subfolder/0000755000175000017500000000000013525004651025031 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.scss0000644000175000017500000000005413525004651032434 0ustar srudsrud.not-a-partial { border: 1px solid blue; }sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/partials/subfolder/_relative_sass.sass0000644000175000017500000000004713525004651030730 0ustar srudsrud.sub-folder-relative-sass width: 50pxsassc-rails-2.1.2/test/dummy/app/assets/stylesheets/partials/subfolder/_relative_scss.scss0000644000175000017500000000006113525004651030730 0ustar srudsrud.sub-folder-relative-scss { width: 50px * 5; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/partials/_sass_import.sass0000644000175000017500000000003513525004651026437 0ustar srudsrud.partial-sass color: green sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/partials/_css_sass_import.sass0000644000175000017500000000014013525004651027304 0ustar srudsrud.partial-css-sass color: green @import "top_level_partial" @import "subfolder/relative_scss" sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/partials/_explicit_extension_import.foo0000644000175000017500000000004013525004651031211 0ustar srudsrud.partial-foo { color: green } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/partials/_without_css_ext.scss0000644000175000017500000000007713525004651027337 0ustar srudsrud@mixin without-css-ext { .without-css-ext { should: work; } }sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/erb_render_with_context.css.erb0000644000175000017500000007032013525004651027416 0ustar srudsrud/*! * Font Awesome 4.3.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) */ /* FONT PATH * -------------------------- */ //= depend_on_asset "fake-font.ttf" <% v = 1 %> @font-face { font-family: 'FontAwesome'; src: url('<%= font_path('fontawesome-webfont.eot') %>?v=<%= v %>'); src: url('<%= font_path('fontawesome-webfont.eot') %>?#iefix&v=<%= v %>') format('embedded-opentype'), url('<%= font_path('fontawesome-webfont.woff2') %>?v=<%= v %>') format('woff2'), url('<%= font_path('fontawesome-webfont.woff') %>?v=<%= v %>') format('woff'), url('<%= font_path('fontawesome-webfont.ttf') %>?v=<%= v %>') format('truetype'), url('<%= font_path('fontawesome-webfont.svg') %>?v=<%= v %>#fontawesomeregular') format('svg'); font-weight: normal; font-style: normal; } .fa { display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; transform: translate(0, 0); } /* makes the font 33% larger relative to the icon container */ .fa-lg { font-size: 1.33333333em; line-height: 0.75em; vertical-align: -15%; } .fa-2x { font-size: 2em; } .fa-3x { font-size: 3em; } .fa-4x { font-size: 4em; } .fa-5x { font-size: 5em; } .fa-fw { width: 1.28571429em; text-align: center; } .fa-ul { padding-left: 0; margin-left: 2.14285714em; list-style-type: none; } .fa-ul > li { position: relative; } .fa-li { position: absolute; left: -2.14285714em; width: 2.14285714em; top: 0.14285714em; text-align: center; } .fa-li.fa-lg { left: -1.85714286em; } .fa-border { padding: .2em .25em .15em; border: solid 0.08em #eeeeee; border-radius: .1em; } .pull-right { float: right; } .pull-left { float: left; } .fa.pull-left { margin-right: .3em; } .fa.pull-right { margin-left: .3em; } .fa-spin { -webkit-animation: fa-spin 2s infinite linear; animation: fa-spin 2s infinite linear; } .fa-pulse { -webkit-animation: fa-spin 1s infinite steps(8); animation: fa-spin 1s infinite steps(8); } @-webkit-keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } @keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } .fa-rotate-90 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } .fa-rotate-180 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); } .fa-rotate-270 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); -webkit-transform: rotate(270deg); -ms-transform: rotate(270deg); transform: rotate(270deg); } .fa-flip-horizontal { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); -webkit-transform: scale(-1, 1); -ms-transform: scale(-1, 1); transform: scale(-1, 1); } .fa-flip-vertical { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); -webkit-transform: scale(1, -1); -ms-transform: scale(1, -1); transform: scale(1, -1); } :root .fa-rotate-90, :root .fa-rotate-180, :root .fa-rotate-270, :root .fa-flip-horizontal, :root .fa-flip-vertical { filter: none; } .fa-stack { position: relative; display: inline-block; width: 2em; height: 2em; line-height: 2em; vertical-align: middle; } .fa-stack-1x, .fa-stack-2x { position: absolute; left: 0; width: 100%; text-align: center; } .fa-stack-1x { line-height: inherit; } .fa-stack-2x { font-size: 2em; } .fa-inverse { color: #ffffff; } /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen readers do not read off random characters that represent icons */ .fa-glass:before { content: "\f000"; } .fa-music:before { content: "\f001"; } .fa-search:before { content: "\f002"; } .fa-envelope-o:before { content: "\f003"; } .fa-heart:before { content: "\f004"; } .fa-star:before { content: "\f005"; } .fa-star-o:before { content: "\f006"; } .fa-user:before { content: "\f007"; } .fa-film:before { content: "\f008"; } .fa-th-large:before { content: "\f009"; } .fa-th:before { content: "\f00a"; } .fa-th-list:before { content: "\f00b"; } .fa-check:before { content: "\f00c"; } .fa-remove:before, .fa-close:before, .fa-times:before { content: "\f00d"; } .fa-search-plus:before { content: "\f00e"; } .fa-search-minus:before { content: "\f010"; } .fa-power-off:before { content: "\f011"; } .fa-signal:before { content: "\f012"; } .fa-gear:before, .fa-cog:before { content: "\f013"; } .fa-trash-o:before { content: "\f014"; } .fa-home:before { content: "\f015"; } .fa-file-o:before { content: "\f016"; } .fa-clock-o:before { content: "\f017"; } .fa-road:before { content: "\f018"; } .fa-download:before { content: "\f019"; } .fa-arrow-circle-o-down:before { content: "\f01a"; } .fa-arrow-circle-o-up:before { content: "\f01b"; } .fa-inbox:before { content: "\f01c"; } .fa-play-circle-o:before { content: "\f01d"; } .fa-rotate-right:before, .fa-repeat:before { content: "\f01e"; } .fa-refresh:before { content: "\f021"; } .fa-list-alt:before { content: "\f022"; } .fa-lock:before { content: "\f023"; } .fa-flag:before { content: "\f024"; } .fa-headphones:before { content: "\f025"; } .fa-volume-off:before { content: "\f026"; } .fa-volume-down:before { content: "\f027"; } .fa-volume-up:before { content: "\f028"; } .fa-qrcode:before { content: "\f029"; } .fa-barcode:before { content: "\f02a"; } .fa-tag:before { content: "\f02b"; } .fa-tags:before { content: "\f02c"; } .fa-book:before { content: "\f02d"; } .fa-bookmark:before { content: "\f02e"; } .fa-print:before { content: "\f02f"; } .fa-camera:before { content: "\f030"; } .fa-font:before { content: "\f031"; } .fa-bold:before { content: "\f032"; } .fa-italic:before { content: "\f033"; } .fa-text-height:before { content: "\f034"; } .fa-text-width:before { content: "\f035"; } .fa-align-left:before { content: "\f036"; } .fa-align-center:before { content: "\f037"; } .fa-align-right:before { content: "\f038"; } .fa-align-justify:before { content: "\f039"; } .fa-list:before { content: "\f03a"; } .fa-dedent:before, .fa-outdent:before { content: "\f03b"; } .fa-indent:before { content: "\f03c"; } .fa-video-camera:before { content: "\f03d"; } .fa-photo:before, .fa-image:before, .fa-picture-o:before { content: "\f03e"; } .fa-pencil:before { content: "\f040"; } .fa-map-marker:before { content: "\f041"; } .fa-adjust:before { content: "\f042"; } .fa-tint:before { content: "\f043"; } .fa-edit:before, .fa-pencil-square-o:before { content: "\f044"; } .fa-share-square-o:before { content: "\f045"; } .fa-check-square-o:before { content: "\f046"; } .fa-arrows:before { content: "\f047"; } .fa-step-backward:before { content: "\f048"; } .fa-fast-backward:before { content: "\f049"; } .fa-backward:before { content: "\f04a"; } .fa-play:before { content: "\f04b"; } .fa-pause:before { content: "\f04c"; } .fa-stop:before { content: "\f04d"; } .fa-forward:before { content: "\f04e"; } .fa-fast-forward:before { content: "\f050"; } .fa-step-forward:before { content: "\f051"; } .fa-eject:before { content: "\f052"; } .fa-chevron-left:before { content: "\f053"; } .fa-chevron-right:before { content: "\f054"; } .fa-plus-circle:before { content: "\f055"; } .fa-minus-circle:before { content: "\f056"; } .fa-times-circle:before { content: "\f057"; } .fa-check-circle:before { content: "\f058"; } .fa-question-circle:before { content: "\f059"; } .fa-info-circle:before { content: "\f05a"; } .fa-crosshairs:before { content: "\f05b"; } .fa-times-circle-o:before { content: "\f05c"; } .fa-check-circle-o:before { content: "\f05d"; } .fa-ban:before { content: "\f05e"; } .fa-arrow-left:before { content: "\f060"; } .fa-arrow-right:before { content: "\f061"; } .fa-arrow-up:before { content: "\f062"; } .fa-arrow-down:before { content: "\f063"; } .fa-mail-forward:before, .fa-share:before { content: "\f064"; } .fa-expand:before { content: "\f065"; } .fa-compress:before { content: "\f066"; } .fa-plus:before { content: "\f067"; } .fa-minus:before { content: "\f068"; } .fa-asterisk:before { content: "\f069"; } .fa-exclamation-circle:before { content: "\f06a"; } .fa-gift:before { content: "\f06b"; } .fa-leaf:before { content: "\f06c"; } .fa-fire:before { content: "\f06d"; } .fa-eye:before { content: "\f06e"; } .fa-eye-slash:before { content: "\f070"; } .fa-warning:before, .fa-exclamation-triangle:before { content: "\f071"; } .fa-plane:before { content: "\f072"; } .fa-calendar:before { content: "\f073"; } .fa-random:before { content: "\f074"; } .fa-comment:before { content: "\f075"; } .fa-magnet:before { content: "\f076"; } .fa-chevron-up:before { content: "\f077"; } .fa-chevron-down:before { content: "\f078"; } .fa-retweet:before { content: "\f079"; } .fa-shopping-cart:before { content: "\f07a"; } .fa-folder:before { content: "\f07b"; } .fa-folder-open:before { content: "\f07c"; } .fa-arrows-v:before { content: "\f07d"; } .fa-arrows-h:before { content: "\f07e"; } .fa-bar-chart-o:before, .fa-bar-chart:before { content: "\f080"; } .fa-twitter-square:before { content: "\f081"; } .fa-facebook-square:before { content: "\f082"; } .fa-camera-retro:before { content: "\f083"; } .fa-key:before { content: "\f084"; } .fa-gears:before, .fa-cogs:before { content: "\f085"; } .fa-comments:before { content: "\f086"; } .fa-thumbs-o-up:before { content: "\f087"; } .fa-thumbs-o-down:before { content: "\f088"; } .fa-star-half:before { content: "\f089"; } .fa-heart-o:before { content: "\f08a"; } .fa-sign-out:before { content: "\f08b"; } .fa-linkedin-square:before { content: "\f08c"; } .fa-thumb-tack:before { content: "\f08d"; } .fa-external-link:before { content: "\f08e"; } .fa-sign-in:before { content: "\f090"; } .fa-trophy:before { content: "\f091"; } .fa-github-square:before { content: "\f092"; } .fa-upload:before { content: "\f093"; } .fa-lemon-o:before { content: "\f094"; } .fa-phone:before { content: "\f095"; } .fa-square-o:before { content: "\f096"; } .fa-bookmark-o:before { content: "\f097"; } .fa-phone-square:before { content: "\f098"; } .fa-twitter:before { content: "\f099"; } .fa-facebook-f:before, .fa-facebook:before { content: "\f09a"; } .fa-github:before { content: "\f09b"; } .fa-unlock:before { content: "\f09c"; } .fa-credit-card:before { content: "\f09d"; } .fa-rss:before { content: "\f09e"; } .fa-hdd-o:before { content: "\f0a0"; } .fa-bullhorn:before { content: "\f0a1"; } .fa-bell:before { content: "\f0f3"; } .fa-certificate:before { content: "\f0a3"; } .fa-hand-o-right:before { content: "\f0a4"; } .fa-hand-o-left:before { content: "\f0a5"; } .fa-hand-o-up:before { content: "\f0a6"; } .fa-hand-o-down:before { content: "\f0a7"; } .fa-arrow-circle-left:before { content: "\f0a8"; } .fa-arrow-circle-right:before { content: "\f0a9"; } .fa-arrow-circle-up:before { content: "\f0aa"; } .fa-arrow-circle-down:before { content: "\f0ab"; } .fa-globe:before { content: "\f0ac"; } .fa-wrench:before { content: "\f0ad"; } .fa-tasks:before { content: "\f0ae"; } .fa-filter:before { content: "\f0b0"; } .fa-briefcase:before { content: "\f0b1"; } .fa-arrows-alt:before { content: "\f0b2"; } .fa-group:before, .fa-users:before { content: "\f0c0"; } .fa-chain:before, .fa-link:before { content: "\f0c1"; } .fa-cloud:before { content: "\f0c2"; } .fa-flask:before { content: "\f0c3"; } .fa-cut:before, .fa-scissors:before { content: "\f0c4"; } .fa-copy:before, .fa-files-o:before { content: "\f0c5"; } .fa-paperclip:before { content: "\f0c6"; } .fa-save:before, .fa-floppy-o:before { content: "\f0c7"; } .fa-square:before { content: "\f0c8"; } .fa-navicon:before, .fa-reorder:before, .fa-bars:before { content: "\f0c9"; } .fa-list-ul:before { content: "\f0ca"; } .fa-list-ol:before { content: "\f0cb"; } .fa-strikethrough:before { content: "\f0cc"; } .fa-underline:before { content: "\f0cd"; } .fa-table:before { content: "\f0ce"; } .fa-magic:before { content: "\f0d0"; } .fa-truck:before { content: "\f0d1"; } .fa-pinterest:before { content: "\f0d2"; } .fa-pinterest-square:before { content: "\f0d3"; } .fa-google-plus-square:before { content: "\f0d4"; } .fa-google-plus:before { content: "\f0d5"; } .fa-money:before { content: "\f0d6"; } .fa-caret-down:before { content: "\f0d7"; } .fa-caret-up:before { content: "\f0d8"; } .fa-caret-left:before { content: "\f0d9"; } .fa-caret-right:before { content: "\f0da"; } .fa-columns:before { content: "\f0db"; } .fa-unsorted:before, .fa-sort:before { content: "\f0dc"; } .fa-sort-down:before, .fa-sort-desc:before { content: "\f0dd"; } .fa-sort-up:before, .fa-sort-asc:before { content: "\f0de"; } .fa-envelope:before { content: "\f0e0"; } .fa-linkedin:before { content: "\f0e1"; } .fa-rotate-left:before, .fa-undo:before { content: "\f0e2"; } .fa-legal:before, .fa-gavel:before { content: "\f0e3"; } .fa-dashboard:before, .fa-tachometer:before { content: "\f0e4"; } .fa-comment-o:before { content: "\f0e5"; } .fa-comments-o:before { content: "\f0e6"; } .fa-flash:before, .fa-bolt:before { content: "\f0e7"; } .fa-sitemap:before { content: "\f0e8"; } .fa-umbrella:before { content: "\f0e9"; } .fa-paste:before, .fa-clipboard:before { content: "\f0ea"; } .fa-lightbulb-o:before { content: "\f0eb"; } .fa-exchange:before { content: "\f0ec"; } .fa-cloud-download:before { content: "\f0ed"; } .fa-cloud-upload:before { content: "\f0ee"; } .fa-user-md:before { content: "\f0f0"; } .fa-stethoscope:before { content: "\f0f1"; } .fa-suitcase:before { content: "\f0f2"; } .fa-bell-o:before { content: "\f0a2"; } .fa-coffee:before { content: "\f0f4"; } .fa-cutlery:before { content: "\f0f5"; } .fa-file-text-o:before { content: "\f0f6"; } .fa-building-o:before { content: "\f0f7"; } .fa-hospital-o:before { content: "\f0f8"; } .fa-ambulance:before { content: "\f0f9"; } .fa-medkit:before { content: "\f0fa"; } .fa-fighter-jet:before { content: "\f0fb"; } .fa-beer:before { content: "\f0fc"; } .fa-h-square:before { content: "\f0fd"; } .fa-plus-square:before { content: "\f0fe"; } .fa-angle-double-left:before { content: "\f100"; } .fa-angle-double-right:before { content: "\f101"; } .fa-angle-double-up:before { content: "\f102"; } .fa-angle-double-down:before { content: "\f103"; } .fa-angle-left:before { content: "\f104"; } .fa-angle-right:before { content: "\f105"; } .fa-angle-up:before { content: "\f106"; } .fa-angle-down:before { content: "\f107"; } .fa-desktop:before { content: "\f108"; } .fa-laptop:before { content: "\f109"; } .fa-tablet:before { content: "\f10a"; } .fa-mobile-phone:before, .fa-mobile:before { content: "\f10b"; } .fa-circle-o:before { content: "\f10c"; } .fa-quote-left:before { content: "\f10d"; } .fa-quote-right:before { content: "\f10e"; } .fa-spinner:before { content: "\f110"; } .fa-circle:before { content: "\f111"; } .fa-mail-reply:before, .fa-reply:before { content: "\f112"; } .fa-github-alt:before { content: "\f113"; } .fa-folder-o:before { content: "\f114"; } .fa-folder-open-o:before { content: "\f115"; } .fa-smile-o:before { content: "\f118"; } .fa-frown-o:before { content: "\f119"; } .fa-meh-o:before { content: "\f11a"; } .fa-gamepad:before { content: "\f11b"; } .fa-keyboard-o:before { content: "\f11c"; } .fa-flag-o:before { content: "\f11d"; } .fa-flag-checkered:before { content: "\f11e"; } .fa-terminal:before { content: "\f120"; } .fa-code:before { content: "\f121"; } .fa-mail-reply-all:before, .fa-reply-all:before { content: "\f122"; } .fa-star-half-empty:before, .fa-star-half-full:before, .fa-star-half-o:before { content: "\f123"; } .fa-location-arrow:before { content: "\f124"; } .fa-crop:before { content: "\f125"; } .fa-code-fork:before { content: "\f126"; } .fa-unlink:before, .fa-chain-broken:before { content: "\f127"; } .fa-question:before { content: "\f128"; } .fa-info:before { content: "\f129"; } .fa-exclamation:before { content: "\f12a"; } .fa-superscript:before { content: "\f12b"; } .fa-subscript:before { content: "\f12c"; } .fa-eraser:before { content: "\f12d"; } .fa-puzzle-piece:before { content: "\f12e"; } .fa-microphone:before { content: "\f130"; } .fa-microphone-slash:before { content: "\f131"; } .fa-shield:before { content: "\f132"; } .fa-calendar-o:before { content: "\f133"; } .fa-fire-extinguisher:before { content: "\f134"; } .fa-rocket:before { content: "\f135"; } .fa-maxcdn:before { content: "\f136"; } .fa-chevron-circle-left:before { content: "\f137"; } .fa-chevron-circle-right:before { content: "\f138"; } .fa-chevron-circle-up:before { content: "\f139"; } .fa-chevron-circle-down:before { content: "\f13a"; } .fa-html5:before { content: "\f13b"; } .fa-css3:before { content: "\f13c"; } .fa-anchor:before { content: "\f13d"; } .fa-unlock-alt:before { content: "\f13e"; } .fa-bullseye:before { content: "\f140"; } .fa-ellipsis-h:before { content: "\f141"; } .fa-ellipsis-v:before { content: "\f142"; } .fa-rss-square:before { content: "\f143"; } .fa-play-circle:before { content: "\f144"; } .fa-ticket:before { content: "\f145"; } .fa-minus-square:before { content: "\f146"; } .fa-minus-square-o:before { content: "\f147"; } .fa-level-up:before { content: "\f148"; } .fa-level-down:before { content: "\f149"; } .fa-check-square:before { content: "\f14a"; } .fa-pencil-square:before { content: "\f14b"; } .fa-external-link-square:before { content: "\f14c"; } .fa-share-square:before { content: "\f14d"; } .fa-compass:before { content: "\f14e"; } .fa-toggle-down:before, .fa-caret-square-o-down:before { content: "\f150"; } .fa-toggle-up:before, .fa-caret-square-o-up:before { content: "\f151"; } .fa-toggle-right:before, .fa-caret-square-o-right:before { content: "\f152"; } .fa-euro:before, .fa-eur:before { content: "\f153"; } .fa-gbp:before { content: "\f154"; } .fa-dollar:before, .fa-usd:before { content: "\f155"; } .fa-rupee:before, .fa-inr:before { content: "\f156"; } .fa-cny:before, .fa-rmb:before, .fa-yen:before, .fa-jpy:before { content: "\f157"; } .fa-ruble:before, .fa-rouble:before, .fa-rub:before { content: "\f158"; } .fa-won:before, .fa-krw:before { content: "\f159"; } .fa-bitcoin:before, .fa-btc:before { content: "\f15a"; } .fa-file:before { content: "\f15b"; } .fa-file-text:before { content: "\f15c"; } .fa-sort-alpha-asc:before { content: "\f15d"; } .fa-sort-alpha-desc:before { content: "\f15e"; } .fa-sort-amount-asc:before { content: "\f160"; } .fa-sort-amount-desc:before { content: "\f161"; } .fa-sort-numeric-asc:before { content: "\f162"; } .fa-sort-numeric-desc:before { content: "\f163"; } .fa-thumbs-up:before { content: "\f164"; } .fa-thumbs-down:before { content: "\f165"; } .fa-youtube-square:before { content: "\f166"; } .fa-youtube:before { content: "\f167"; } .fa-xing:before { content: "\f168"; } .fa-xing-square:before { content: "\f169"; } .fa-youtube-play:before { content: "\f16a"; } .fa-dropbox:before { content: "\f16b"; } .fa-stack-overflow:before { content: "\f16c"; } .fa-instagram:before { content: "\f16d"; } .fa-flickr:before { content: "\f16e"; } .fa-adn:before { content: "\f170"; } .fa-bitbucket:before { content: "\f171"; } .fa-bitbucket-square:before { content: "\f172"; } .fa-tumblr:before { content: "\f173"; } .fa-tumblr-square:before { content: "\f174"; } .fa-long-arrow-down:before { content: "\f175"; } .fa-long-arrow-up:before { content: "\f176"; } .fa-long-arrow-left:before { content: "\f177"; } .fa-long-arrow-right:before { content: "\f178"; } .fa-apple:before { content: "\f179"; } .fa-windows:before { content: "\f17a"; } .fa-android:before { content: "\f17b"; } .fa-linux:before { content: "\f17c"; } .fa-dribbble:before { content: "\f17d"; } .fa-skype:before { content: "\f17e"; } .fa-foursquare:before { content: "\f180"; } .fa-trello:before { content: "\f181"; } .fa-female:before { content: "\f182"; } .fa-male:before { content: "\f183"; } .fa-gittip:before, .fa-gratipay:before { content: "\f184"; } .fa-sun-o:before { content: "\f185"; } .fa-moon-o:before { content: "\f186"; } .fa-archive:before { content: "\f187"; } .fa-bug:before { content: "\f188"; } .fa-vk:before { content: "\f189"; } .fa-weibo:before { content: "\f18a"; } .fa-renren:before { content: "\f18b"; } .fa-pagelines:before { content: "\f18c"; } .fa-stack-exchange:before { content: "\f18d"; } .fa-arrow-circle-o-right:before { content: "\f18e"; } .fa-arrow-circle-o-left:before { content: "\f190"; } .fa-toggle-left:before, .fa-caret-square-o-left:before { content: "\f191"; } .fa-dot-circle-o:before { content: "\f192"; } .fa-wheelchair:before { content: "\f193"; } .fa-vimeo-square:before { content: "\f194"; } .fa-turkish-lira:before, .fa-try:before { content: "\f195"; } .fa-plus-square-o:before { content: "\f196"; } .fa-space-shuttle:before { content: "\f197"; } .fa-slack:before { content: "\f198"; } .fa-envelope-square:before { content: "\f199"; } .fa-wordpress:before { content: "\f19a"; } .fa-openid:before { content: "\f19b"; } .fa-institution:before, .fa-bank:before, .fa-university:before { content: "\f19c"; } .fa-mortar-board:before, .fa-graduation-cap:before { content: "\f19d"; } .fa-yahoo:before { content: "\f19e"; } .fa-google:before { content: "\f1a0"; } .fa-reddit:before { content: "\f1a1"; } .fa-reddit-square:before { content: "\f1a2"; } .fa-stumbleupon-circle:before { content: "\f1a3"; } .fa-stumbleupon:before { content: "\f1a4"; } .fa-delicious:before { content: "\f1a5"; } .fa-digg:before { content: "\f1a6"; } .fa-pied-piper:before { content: "\f1a7"; } .fa-pied-piper-alt:before { content: "\f1a8"; } .fa-drupal:before { content: "\f1a9"; } .fa-joomla:before { content: "\f1aa"; } .fa-language:before { content: "\f1ab"; } .fa-fax:before { content: "\f1ac"; } .fa-building:before { content: "\f1ad"; } .fa-child:before { content: "\f1ae"; } .fa-paw:before { content: "\f1b0"; } .fa-spoon:before { content: "\f1b1"; } .fa-cube:before { content: "\f1b2"; } .fa-cubes:before { content: "\f1b3"; } .fa-behance:before { content: "\f1b4"; } .fa-behance-square:before { content: "\f1b5"; } .fa-steam:before { content: "\f1b6"; } .fa-steam-square:before { content: "\f1b7"; } .fa-recycle:before { content: "\f1b8"; } .fa-automobile:before, .fa-car:before { content: "\f1b9"; } .fa-cab:before, .fa-taxi:before { content: "\f1ba"; } .fa-tree:before { content: "\f1bb"; } .fa-spotify:before { content: "\f1bc"; } .fa-deviantart:before { content: "\f1bd"; } .fa-soundcloud:before { content: "\f1be"; } .fa-database:before { content: "\f1c0"; } .fa-file-pdf-o:before { content: "\f1c1"; } .fa-file-word-o:before { content: "\f1c2"; } .fa-file-excel-o:before { content: "\f1c3"; } .fa-file-powerpoint-o:before { content: "\f1c4"; } .fa-file-photo-o:before, .fa-file-picture-o:before, .fa-file-image-o:before { content: "\f1c5"; } .fa-file-zip-o:before, .fa-file-archive-o:before { content: "\f1c6"; } .fa-file-sound-o:before, .fa-file-audio-o:before { content: "\f1c7"; } .fa-file-movie-o:before, .fa-file-video-o:before { content: "\f1c8"; } .fa-file-code-o:before { content: "\f1c9"; } .fa-vine:before { content: "\f1ca"; } .fa-codepen:before { content: "\f1cb"; } .fa-jsfiddle:before { content: "\f1cc"; } .fa-life-bouy:before, .fa-life-buoy:before, .fa-life-saver:before, .fa-support:before, .fa-life-ring:before { content: "\f1cd"; } .fa-circle-o-notch:before { content: "\f1ce"; } .fa-ra:before, .fa-rebel:before { content: "\f1d0"; } .fa-ge:before, .fa-empire:before { content: "\f1d1"; } .fa-git-square:before { content: "\f1d2"; } .fa-git:before { content: "\f1d3"; } .fa-hacker-news:before { content: "\f1d4"; } .fa-tencent-weibo:before { content: "\f1d5"; } .fa-qq:before { content: "\f1d6"; } .fa-wechat:before, .fa-weixin:before { content: "\f1d7"; } .fa-send:before, .fa-paper-plane:before { content: "\f1d8"; } .fa-send-o:before, .fa-paper-plane-o:before { content: "\f1d9"; } .fa-history:before { content: "\f1da"; } .fa-genderless:before, .fa-circle-thin:before { content: "\f1db"; } .fa-header:before { content: "\f1dc"; } .fa-paragraph:before { content: "\f1dd"; } .fa-sliders:before { content: "\f1de"; } .fa-share-alt:before { content: "\f1e0"; } .fa-share-alt-square:before { content: "\f1e1"; } .fa-bomb:before { content: "\f1e2"; } .fa-soccer-ball-o:before, .fa-futbol-o:before { content: "\f1e3"; } .fa-tty:before { content: "\f1e4"; } .fa-binoculars:before { content: "\f1e5"; } .fa-plug:before { content: "\f1e6"; } .fa-slideshare:before { content: "\f1e7"; } .fa-twitch:before { content: "\f1e8"; } .fa-yelp:before { content: "\f1e9"; } .fa-newspaper-o:before { content: "\f1ea"; } .fa-wifi:before { content: "\f1eb"; } .fa-calculator:before { content: "\f1ec"; } .fa-paypal:before { content: "\f1ed"; } .fa-google-wallet:before { content: "\f1ee"; } .fa-cc-visa:before { content: "\f1f0"; } .fa-cc-mastercard:before { content: "\f1f1"; } .fa-cc-discover:before { content: "\f1f2"; } .fa-cc-amex:before { content: "\f1f3"; } .fa-cc-paypal:before { content: "\f1f4"; } .fa-cc-stripe:before { content: "\f1f5"; } .fa-bell-slash:before { content: "\f1f6"; } .fa-bell-slash-o:before { content: "\f1f7"; } .fa-trash:before { content: "\f1f8"; } .fa-copyright:before { content: "\f1f9"; } .fa-at:before { content: "\f1fa"; } .fa-eyedropper:before { content: "\f1fb"; } .fa-paint-brush:before { content: "\f1fc"; } .fa-birthday-cake:before { content: "\f1fd"; } .fa-area-chart:before { content: "\f1fe"; } .fa-pie-chart:before { content: "\f200"; } .fa-line-chart:before { content: "\f201"; } .fa-lastfm:before { content: "\f202"; } .fa-lastfm-square:before { content: "\f203"; } .fa-toggle-off:before { content: "\f204"; } .fa-toggle-on:before { content: "\f205"; } .fa-bicycle:before { content: "\f206"; } .fa-bus:before { content: "\f207"; } .fa-ioxhost:before { content: "\f208"; } .fa-angellist:before { content: "\f209"; } .fa-cc:before { content: "\f20a"; } .fa-shekel:before, .fa-sheqel:before, .fa-ils:before { content: "\f20b"; } .fa-meanpath:before { content: "\f20c"; } .fa-buysellads:before { content: "\f20d"; } .fa-connectdevelop:before { content: "\f20e"; } .fa-dashcube:before { content: "\f210"; } .fa-forumbee:before { content: "\f211"; } .fa-leanpub:before { content: "\f212"; } .fa-sellsy:before { content: "\f213"; } .fa-shirtsinbulk:before { content: "\f214"; } .fa-simplybuilt:before { content: "\f215"; } .fa-skyatlas:before { content: "\f216"; } .fa-cart-plus:before { content: "\f217"; } .fa-cart-arrow-down:before { content: "\f218"; } .fa-diamond:before { content: "\f219"; } .fa-ship:before { content: "\f21a"; } .fa-user-secret:before { content: "\f21b"; } .fa-motorcycle:before { content: "\f21c"; } .fa-street-view:before { content: "\f21d"; } .fa-heartbeat:before { content: "\f21e"; } .fa-venus:before { content: "\f221"; } .fa-mars:before { content: "\f222"; } .fa-mercury:before { content: "\f223"; } .fa-transgender:before { content: "\f224"; } .fa-transgender-alt:before { content: "\f225"; } .fa-venus-double:before { content: "\f226"; } .fa-mars-double:before { content: "\f227"; } .fa-venus-mars:before { content: "\f228"; } .fa-mars-stroke:before { content: "\f229"; } .fa-mars-stroke-v:before { content: "\f22a"; } .fa-mars-stroke-h:before { content: "\f22b"; } .fa-neuter:before { content: "\f22c"; } .fa-facebook-official:before { content: "\f230"; } .fa-pinterest-p:before { content: "\f231"; } .fa-whatsapp:before { content: "\f232"; } .fa-server:before { content: "\f233"; } .fa-user-plus:before { content: "\f234"; } .fa-user-times:before { content: "\f235"; } .fa-hotel:before, .fa-bed:before { content: "\f236"; } .fa-viacoin:before { content: "\f237"; } .fa-train:before { content: "\f238"; } .fa-subway:before { content: "\f239"; } .fa-medium:before { content: "\f23a"; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/css_scss_handler.css.scss0000644000175000017500000000004713525004651026232 0ustar srudsrud.css-scss-handler { color: yellow; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/css_sass_handler.css.sass0000644000175000017500000000004013525004651026217 0ustar srudsrud.css-sass-handler color: blue sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/css_scss_erb_handler.scss.erb0000644000175000017500000000005613525004651027042 0ustar srudsrud.css-scss-erb-handler { margin: <%= 0 %>; } sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/globbed/0000755000175000017500000000000013525004651022623 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/stylesheets/globbed/nested/0000755000175000017500000000000013525004651024105 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/stylesheets/globbed/nested/nested_glob.scss0000644000175000017500000000003713525004651027267 0ustar srudsrud.nested-glob { color: blue; }sassc-rails-2.1.2/test/dummy/app/assets/stylesheets/globbed/globbed.scss0000644000175000017500000000003513525004651025114 0ustar srudsrud.globbed { color: green; } sassc-rails-2.1.2/test/dummy/app/assets/images/0000755000175000017500000000000013525004651020116 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/images/rails.png0000644000175000017500000001476613525004651021754 0ustar srudsrudPNG  IHDR2@X${tEXtSoftwareAdobe ImageReadyqe<IDATxڬ[ \eR֮^;Iwga@`gGgDgtqDFqFDqF@NRU]˫|_-Qy^Ǹ.݋0W_6kbf̻ܸ6<4 w5~*r?9m&"M7@vm' {_S)Vi\WG?իjMd@ lDLX鸺W-TU+@EPo\&*Rnn, fDWrX|3M=\EJB[d6A'=tx^$a86̈{, ϱPepN*_W_3o;ޥ(0E:i6eXnhGf"L|S+(+.gФg=Ych=m#V_#}Ǫ|tR D8VՄM~xg!ni%Dy( B,{(Np$3iر$h.@e[a'eJԂyϠ4>H*MHQ(Jgt-֢QI ^d„@s-'- 51{'0 |n4ۉh{V@ܩw"BT =rzqPpBHȃ?ň ]-qpgsPiSӪg`jn)m 御B2L.x!jJP! K/\ ʮRB[09Trӈu. uH$ DDQ+:ݘٻ 3/nލ%Sjm2!&D/[EHwW A-RR!PeuHim"t6lFgЫ-O.1?ƞksX~VtmZJR11Nu&<⽩,Tb,`w WPx-G5 `մ/5pbAtIVJ_]0/DiH=ô#*77-3 VuQ0.pݔ%yw hљW0),2$b6&I/@bj$I(fx' JnO"`<-/LѮ%^ȫͶn2wҗ2}}XսL'Q-,m/ꤋ4#0Q&00NKrsA,Aײ)aIEC(ERK{8Ȭ[y?iI5$%f{}u F 1~;v1l'@F 'IF'm!K7"&]w 15#4Vižn[v 8Ě)>C=LBo~/3% wF4֓ʿ8>bWX@bb@IzP9IvFfQL!2cEP(se4~5RhAŽ90_? cMEteVOaOr B]pȱؓ"Eyx: NJ)bl׋hYuTdԫw=آMgwVPOFΒ25-TD[Z2>]V,xӛIOƅ)Jͺ[)?cn28p#(mk+./phʮQ6?w7HIoSj)1<#-N9O1ͰސkIKr:(ŗ;rR&<93v@w(w:~:TFSޒ" ՊTdT9PIb3JzTQׄBP23ƵW*|@^)Qw?Iq =,<@ B8);50H-=T SA@@f5r[T%#c|Z&w(B)tDQ%vyC(,Ɵ|ʰi&<#u:3EHkzд)ndF>1V2kFGYL KMQlR&TB,igv8]C8Sf#ą4Q'?,= aV9WEXYrr*!cƯ~),=yџ]jlGeE̺5r_2Ԏ}d"a]0M9PZG17nE"Rr\YQ)!|5U(d=^ŗo8+2NU6jB[B5V.]ŲW/^䩬 ;Y"Vi$2ٲ_c(F^Egq{CP/ #K8Y+Q M1>ܞAߏ,gytޕn,zE$V.v.PyLapG9Tn:uiRZ! zI0?Џ1u#$6ɱGMhFdtd|~d\O9Ij**zD؍b)PBҽh-q ql%/{Gz*d7=QS]:RQbUMPᒯ$% du] XefQz$('ИZH#ARXDB ~`0.F|XXK)wFolzyhߚKz>.&n EjU,2' &iw[d[ V)*Qavl QDit[VIQhR@$)y~m|>?cJ+VH'6? 7 i.XH8Fި)dAYUBjE".4w-?l2Y.RjWD@Bج.߆s[H-gASF3Fj]آBP떬_>M%bt ?_rլ -h]r_ž[nȶQ+Gԭ_\Ê Z٦fet(|U('.g VFEN9}Ll4T&nto¨Ӓ X F "_fYzF~y& Gu]$O[v#].@$VA`ⱧTѰZ[2u+/mUC_ TnyѠ |l\ M"G[R$d|:ěFIire"ٵt,+ی1Z11udt*K2 sd; [)xW.z2jTh#DV\NO &e_vU2B^%0FH(/ԘI2>=L]dv UUpk"ijB$,O-0y<}~*T5LErE4B߳XXN:<9>Ed -V*uBLsN**JxRU辖,T( Gu @ůY{u|CJF(OLbnմiKhpFtx8#9FsFڋDTAn1veF^M ^kf.ĆݠVʓǰ3JaY@n&jLl:McӚ…vu?9w!/~#hM ڛ ̴nMA}m W,)(î.N y%$*={P9c DzH>Blu޾K78x->V,'JU \L]l>W*r-hXf~oI Z3f玱>vN3 uZTgg}Վ363:.g /-H+"PKۉSZ4Z_GlXMc7";ҿ (5fMUCOF6 CNft>$S1VaR&4) ٗay]%W A*|gX{Qc>iTX1F M`|![$P4ʊ$#,dɌ(?KTJR۸S%C7jHb浃j+N$,[.@˹_ ?.3ĵH"U$Z^ X02!Kc 8q.NMI6N&3n8exoWfPIJB<pREAdo$*m)e9D 5X[T$LΠ:]C$n#mC[P~Yt*d?\q^WXs!E-2#_mw8;2!vw:DUn$)GiGn3_o EZE3k-EHv.OûzE>"֛}l\/-nرQHԽab*#K׋eIƳd#G et\ ,:MێÜIC}m ٽO?eb%ːٰStB|Aznaz*FlQ/K uu*1wDvE֯SJTK;(4kƣ;v2P9`k{?~_[hʢ^9фǡ;m|]o9<#jz\wD,8V]]%K9er懇0n^FcI>`Ub+kօO1|NO]t+,Ȑl_ˮ6 ĒDbrz^pe7^[aþo確jN+xsNC߅wμ7|za2, omrbZ~,pN>;?Y,z[u◿jq 4aqڶNu6Zid@h!!F9#,#UrOa0=Då ,,,bE#ȮX3ªޏ=a< =&_~ ٵѽacj񫒆LsXuXB (wzEk_QIف*4'ѣSl{.,p۵2`jp^؇nZXPź^]wމ]aQ-oI5O3a] _wb ŭL]$"|sԩȬ= VсLIUbYY搮͢I$tf$2|r;~'GSXkᇦԭF4b4 xo[,04F~<}ۭR%myb׾\mlO.4}tE\7}M)tՉ13xF [-26t䢄&E"9;ٜrq e)K!:bwY }g;Jר)5D$!Kɤ9߫-K$$ hlDUFF J{s2R6rC&&0;@>]/Z3E,k;( 2^09 xIIDATxb?@ۢMIENDB`sassc-rails-2.1.2/test/dummy/app/assets/images/.keep0000644000175000017500000000000013525004651021031 0ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/config/0000755000175000017500000000000013525004651020116 5ustar srudsrudsassc-rails-2.1.2/test/dummy/app/assets/config/manifest.js0000644000175000017500000000014513525004651022262 0ustar srudsrud//= link_tree ../images //= link_directory ../javascripts .js //= link_directory ../stylesheets .css sassc-rails-2.1.2/test/test_helper.rb0000644000175000017500000000060113525004651016274 0ustar srudsrud# frozen_string_literal: true ENV["RAILS_ENV"] = "test" $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require "pry" require "fileutils" require 'rails' require 'bundler/setup' require "minitest/autorun" require 'mocha/minitest' Bundler.require Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } sassc-rails-2.1.2/lib/0000755000175000017500000000000013525004651013223 5ustar srudsrudsassc-rails-2.1.2/lib/sassc/0000755000175000017500000000000013525004651014337 5ustar srudsrudsassc-rails-2.1.2/lib/sassc/rails/0000755000175000017500000000000013525004651015451 5ustar srudsrudsassc-rails-2.1.2/lib/sassc/rails/functions.rb0000644000175000017500000000050413525004651020005 0ustar srudsrud# frozen_string_literal: true require 'sprockets/sass_functions' module Sprockets module SassFunctions def asset_data_url(path) ::SassC::Script::Value::String.new("url(" + sprockets_context.asset_data_uri(path.value) + ")") end end end ::SassC::Script::Functions.send :include, Sprockets::SassFunctions sassc-rails-2.1.2/lib/sassc/rails/importer.rb0000644000175000017500000001146713525004651017650 0ustar srudsrud# frozen_string_literal: true require 'tilt' module SassC module Rails class Importer < SassC::Importer class Extension attr_reader :postfix def initialize(postfix=nil) @postfix = postfix end def import_for(full_path, parent_dir, options) SassC::Importer::Import.new(full_path) end end class CSSExtension def postfix ".css" end def import_for(full_path, parent_dir, options) import_path = full_path.gsub(/\.css$/,"") SassC::Importer::Import.new(import_path) end end class CssScssExtension < Extension def postfix ".css.scss" end def import_for(full_path, parent_dir, options) source = File.open(full_path, 'rb') { |f| f.read } SassC::Importer::Import.new(full_path, source: source) end end class CssSassExtension < Extension def postfix ".css.sass" end def import_for(full_path, parent_dir, options) sass = File.open(full_path, 'rb') { |f| f.read } parsed_scss = SassC::Sass2Scss.convert(sass) SassC::Importer::Import.new(full_path, source: parsed_scss) end end class SassERBExtension < Extension def postfix ".sass.erb" end def import_for(full_path, parent_dir, options) template = Tilt::ERBTemplate.new(full_path) parsed_erb = template.render(options[:sprockets][:context], {}) parsed_scss = SassC::Sass2Scss.convert(parsed_erb) SassC::Importer::Import.new(full_path, source: parsed_scss) end end class ERBExtension < Extension def import_for(full_path, parent_dir, options) template = Tilt::ERBTemplate.new(full_path) parsed_erb = template.render(options[:sprockets][:context], {}) SassC::Importer::Import.new(full_path, source: parsed_erb) end end EXTENSIONS = [ CssScssExtension.new, CssSassExtension.new, SassERBExtension.new, ERBExtension.new(".scss.erb"), ERBExtension.new(".css.erb"), Extension.new(".scss"), Extension.new(".sass"), CSSExtension.new ].freeze PREFIXS = [ "", "_" ] GLOB = /(\A|\/)(\*|\*\*\/\*)\z/ def imports(path, parent_path) parent_dir, _ = File.split(parent_path) specified_dir, specified_file = File.split(path) if m = path.match(GLOB) path = path.sub(m[0], "") base = File.expand_path(path, File.dirname(parent_path)) return glob_imports(base, m[2], parent_path) end search_paths = ([parent_dir] + load_paths).uniq if specified_dir != "." search_paths.map! do |path| File.join(path, specified_dir) end search_paths.select! do |path| File.directory?(path) end end search_paths.each do |search_path| PREFIXS.each do |prefix| file_name = prefix + specified_file EXTENSIONS.each do |extension| try_path = File.join(search_path, file_name + extension.postfix) if File.exist?(try_path) record_import_as_dependency try_path return extension.import_for(try_path, parent_dir, options) end end end end SassC::Importer::Import.new(path) end private def extension_for_file(file) EXTENSIONS.detect do |extension| file.include? extension.postfix end end def record_import_as_dependency(path) context.depend_on path end def context options[:sprockets][:context] end def load_paths options[:load_paths] end def glob_imports(base, glob, current_file) files = globbed_files(base, glob) files = files.reject { |f| f == current_file } files.map do |filename| record_import_as_dependency(filename) extension = extension_for_file(filename) extension.import_for(filename, base, options) end end def globbed_files(base, glob) # TODO: Raise an error from SassC here raise ArgumentError unless glob == "*" || glob == "**/*" extensions = EXTENSIONS.map(&:postfix) exts = extensions.map { |ext| Regexp.escape("#{ext}") }.join("|") sass_re = Regexp.compile("(#{exts})$") record_import_as_dependency(base) files = Dir["#{base}/#{glob}"].sort.map do |path| if File.directory?(path) record_import_as_dependency(path) nil elsif sass_re =~ path path end end files.compact end end end end sassc-rails-2.1.2/lib/sassc/rails/railtie.rb0000644000175000017500000000573713525004651017443 0ustar srudsrud# frozen_string_literal: true require 'active_support/core_ext/class/attribute' require 'sprockets/railtie' module SassC::Rails class Railtie < ::Rails::Railtie config.sass = ActiveSupport::OrderedOptions.new # Establish static configuration defaults # Emit scss files during stylesheet generation of scaffold config.sass.preferred_syntax = :scss # Initialize the load paths to an empty array config.sass.load_paths = [] # Display line comments above each selector as a debugging aid config.sass.line_comments = true # Set the default stylesheet engine # It can be overridden by passing: # --stylesheet_engine=sass # to the rails generate command config.app_generators.stylesheet_engine config.sass.preferred_syntax if config.respond_to?(:annotations) config.annotations.register_extensions("scss", "sass") { |annotation| /\/\/\s*(#{annotation}):?\s*(.*)$/ } end # Remove the sass middleware if it gets inadvertently enabled by applications. config.after_initialize do |app| app.config.middleware.delete(Sass::Plugin::Rack) if defined?(Sass::Plugin::Rack) end initializer :setup_sass, group: :all do |app| # Only emit one kind of syntax because though we have registered two kinds of generators syntax = app.config.sass.preferred_syntax.to_sym alt_syntax = syntax == :sass ? "scss" : "sass" app.config.generators.hide_namespace alt_syntax # Override stylesheet engine to the preferred syntax config.app_generators.stylesheet_engine syntax # Establish configuration defaults that are environmental in nature # if config.sass.full_exception.nil? # # Display a stack trace in the css output when in development-like environments. # config.sass.full_exception = app.config.consider_all_requests_local # end app.config.assets.configure do |env| env.context_class.class_eval do class_attribute :sass_config self.sass_config = app.config.sass end if env.respond_to?(:register_transformer) env.register_transformer 'text/sass', 'text/css', SassC::Rails::SassTemplate.new env.register_transformer 'text/scss', 'text/css', SassC::Rails::ScssTemplate.new end if env.respond_to?(:register_engine) [ ['.sass', SassC::Rails::SassTemplate], ['.scss', SassC::Rails::ScssTemplate] ].each do |engine| engine << { silence_deprecation: true } if Sprockets::VERSION.start_with?("3") env.register_engine(*engine) end end end end initializer :setup_compression, group: :all do |app| if !Rails.env.development? app.config.assets.css_compressor = :sass unless app.config.assets.has_key?(:css_compressor) else # Use expanded output instead of the sass default of :nested unless specified app.config.sass.style ||= :expanded end end end end sassc-rails-2.1.2/lib/sassc/rails/compressor.rb0000644000175000017500000000113613525004651020173 0ustar srudsrud# frozen_string_literal: true require 'sprockets/sass_compressor' require 'securerandom' class Sprockets::SassCompressor def initialize(options = {}) @options = { syntax: :scss, cache: false, read_cache: false, style: :compressed }.merge(options).freeze @cache_key = SecureRandom.uuid end def call(*args) input = if defined?(data) data # sprockets 2.x else args[0][:data] #sprockets 3.x end SassC::Engine.new( input, { style: :compressed } ).render end # sprockets 2.x alias :evaluate :call end sassc-rails-2.1.2/lib/sassc/rails/template.rb0000644000175000017500000000624413525004651017617 0ustar srudsrud# frozen_string_literal: true require "sprockets/version" require 'sprockets/sass_processor' require "sprockets/utils" module SassC::Rails class SassTemplate < Sprockets::SassProcessor def initialize(options = {}, &block) @cache_version = options[:cache_version] @cache_key = "#{self.class.name}:#{VERSION}:#{SassC::VERSION}:#{@cache_version}".freeze #@importer_class = options[:importer] || Sass::Importers::Filesystem @sass_config = options[:sass_config] || {} @functions = Module.new do include Functions include options[:functions] if options[:functions] class_eval(&block) if block_given? end end def call(input) context = input[:environment].context_class.new(input) options = { filename: input[:filename], line_comments: line_comments?, syntax: self.class.syntax, load_paths: input[:environment].paths, importer: SassC::Rails::Importer, sprockets: { context: context, environment: input[:environment], dependencies: context.metadata[:dependency_paths] } }.merge!(config_options) { |key, left, right| safe_merge(key, left, right) } engine = ::SassC::Engine.new(input[:data], options) css = Sprockets::Utils.module_include(::SassC::Script::Functions, @functions) do engine.render end context.metadata.merge(data: css) end def config_options opts = { style: sass_style, load_paths: load_paths } if Rails.application.config.sass.inline_source_maps opts.merge!({ source_map_file: ".", source_map_embed: true, source_map_contents: true, }) end opts end def sass_style (Rails.application.config.sass.style || :expanded).to_sym end def load_paths Rails.application.config.sass.load_paths || [] end def line_comments? Rails.application.config.sass.line_comments end def safe_merge(_key, left, right) if [left, right].all? { |v| v.is_a? Hash } left.merge(right) { |k, l, r| safe_merge(k, l, r) } elsif [left, right].all? { |v| v.is_a? Array } (left + right).uniq else right end end # The methods in the Functions module were copied here from sprockets in order to # override the Value class names (e.g. ::SassC::Script::Value::String) module Functions def asset_path(path, options = {}) path = path.value path, _, query, fragment = URI.split(path)[5..8] path = sprockets_context.asset_path(path, options) query = "?#{query}" if query fragment = "##{fragment}" if fragment ::SassC::Script::Value::String.new("#{path}#{query}#{fragment}", :string) end def asset_url(path, options = {}) ::SassC::Script::Value::String.new("url(#{asset_path(path, options).value})") end def asset_data_url(path) url = sprockets_context.asset_data_uri(path.value) ::SassC::Script::Value::String.new("url(" + url + ")") end end end class ScssTemplate < SassTemplate def self.syntax :scss end end end sassc-rails-2.1.2/lib/sassc/rails/version.rb0000644000175000017500000000013313525004651017460 0ustar srudsrud# frozen_string_literal: true module SassC module Rails VERSION = "2.1.2" end end sassc-rails-2.1.2/lib/sassc/rails.rb0000644000175000017500000000037513525004651016003 0ustar srudsrud# frozen_string_literal: true require_relative "rails/version" require "sassc" require_relative "rails/functions" require_relative "rails/importer" require_relative "rails/template" require_relative "rails/compressor" require_relative "rails/railtie" sassc-rails-2.1.2/lib/rails/0000755000175000017500000000000013525004651014335 5ustar srudsrudsassc-rails-2.1.2/lib/rails/generators/0000755000175000017500000000000013525004651016506 5ustar srudsrudsassc-rails-2.1.2/lib/rails/generators/scss/0000755000175000017500000000000013525004651017461 5ustar srudsrudsassc-rails-2.1.2/lib/rails/generators/scss/scaffold/0000755000175000017500000000000013525004651021242 5ustar srudsrudsassc-rails-2.1.2/lib/rails/generators/scss/scaffold/scaffold_generator.rb0000644000175000017500000000027113525004651025416 0ustar srudsrudrequire "rails/generators/sass_scaffold" module Scss module Generators class ScaffoldGenerator < ::Sass::Generators::ScaffoldBase def syntax() :scss end end end end sassc-rails-2.1.2/lib/rails/generators/scss/assets/0000755000175000017500000000000013525004651020763 5ustar srudsrudsassc-rails-2.1.2/lib/rails/generators/scss/assets/templates/0000755000175000017500000000000013525004651022761 5ustar srudsrudsassc-rails-2.1.2/lib/rails/generators/scss/assets/templates/stylesheet.scss0000644000175000017500000000026713525004651026054 0ustar srudsrud// Place all the styles related to the <%= name %> controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: https://sass-lang.com/ sassc-rails-2.1.2/lib/rails/generators/scss/assets/assets_generator.rb0000644000175000017500000000053113525004651024657 0ustar srudsrudrequire "rails/generators/named_base" module Scss module Generators class AssetsGenerator < ::Rails::Generators::NamedBase source_root File.expand_path("../templates", __FILE__) def copy_scss template "stylesheet.scss", File.join('app/assets/stylesheets', class_path, "#{file_name}.scss") end end end end sassc-rails-2.1.2/lib/rails/generators/sass_scaffold.rb0000644000175000017500000000073113525004651021646 0ustar srudsrudrequire "sassc/engine" require "rails/generators/named_base" module Sass module Generators class ScaffoldBase < ::Rails::Generators::NamedBase def copy_stylesheet dir = ::Rails::Generators::ScaffoldGenerator.source_root file = File.join(dir, "scaffold.css") converted_contents = ::SassC::Engine.new(File.read(file)).render create_file "app/assets/stylesheets/scaffolds.#{syntax}", converted_contents end end end end sassc-rails-2.1.2/lib/rails/generators/sass/0000755000175000017500000000000013525004651017457 5ustar srudsrudsassc-rails-2.1.2/lib/rails/generators/sass/scaffold/0000755000175000017500000000000013525004651021240 5ustar srudsrudsassc-rails-2.1.2/lib/rails/generators/sass/scaffold/scaffold_generator.rb0000644000175000017500000000027013525004651025413 0ustar srudsrudrequire "rails/generators/sass_scaffold" module Sass module Generators class ScaffoldGenerator < ::Sass::Generators::ScaffoldBase def syntax() :sass end end end end sassc-rails-2.1.2/lib/rails/generators/sass/assets/0000755000175000017500000000000013525004651020761 5ustar srudsrudsassc-rails-2.1.2/lib/rails/generators/sass/assets/templates/0000755000175000017500000000000013525004651022757 5ustar srudsrudsassc-rails-2.1.2/lib/rails/generators/sass/assets/templates/stylesheet.sass0000644000175000017500000000026013525004651026041 0ustar srudsrud// Place all the styles related to the <%= name %> controller here. // They will automatically be included in application.css. // You can use Sass here: https://sass-lang.com/ sassc-rails-2.1.2/lib/rails/generators/sass/assets/assets_generator.rb0000644000175000017500000000053113525004651024655 0ustar srudsrudrequire "rails/generators/named_base" module Sass module Generators class AssetsGenerator < ::Rails::Generators::NamedBase source_root File.expand_path("../templates", __FILE__) def copy_sass template "stylesheet.sass", File.join('app/assets/stylesheets', class_path, "#{file_name}.sass") end end end end sassc-rails-2.1.2/lib/sassc-rails.rb0000644000175000017500000000007713525004651016000 0ustar srudsrud# frozen_string_literal: true require_relative "sassc/rails" sassc-rails-2.1.2/gemfiles/0000755000175000017500000000000013525004651014250 5ustar srudsrudsassc-rails-2.1.2/gemfiles/sprockets_3_0.gemfile0000644000175000017500000000021113525004651020252 0ustar srudsrudsource 'https://rubygems.org' gem "sprockets", "~> 3.0.3" # Specify your gem's dependencies in sassc-rails.gemspec gemspec path: "../" sassc-rails-2.1.2/gemfiles/sprockets_4_0.gemfile0000644000175000017500000000021113525004651020253 0ustar srudsrudsource 'https://rubygems.org' gem "sprockets", "~> 4.0.x" # Specify your gem's dependencies in sassc-rails.gemspec gemspec path: "../" sassc-rails-2.1.2/gemfiles/sprockets-rails_2_3.gemfile0000644000175000017500000000021713525004651021372 0ustar srudsrudsource 'https://rubygems.org' gem "sprockets-rails", "~> 2.3.3" # Specify your gem's dependencies in sassc-rails.gemspec gemspec path: "../" sassc-rails-2.1.2/gemfiles/rails_4_2.gemfile0000644000175000017500000000020513525004651017355 0ustar srudsrudsource 'https://rubygems.org' gem "rails", "~> 4.2.0" # Specify your gem's dependencies in sassc-rails.gemspec gemspec path: "../" sassc-rails-2.1.2/gemfiles/sprockets-rails_3_0.gemfile0000644000175000017500000000021713525004651021370 0ustar srudsrudsource 'https://rubygems.org' gem "sprockets-rails", "~> 3.0.0" # Specify your gem's dependencies in sassc-rails.gemspec gemspec path: "../" sassc-rails-2.1.2/gemfiles/rails_5_2.gemfile0000644000175000017500000000020513525004651017356 0ustar srudsrudsource 'https://rubygems.org' gem "rails", "~> 5.2.1" # Specify your gem's dependencies in sassc-rails.gemspec gemspec path: "../" sassc-rails-2.1.2/LICENSE.txt0000644000175000017500000000205413525004651014301 0ustar srudsrudCopyright (c) 2015 Ryan Boland MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. sassc-rails-2.1.2/Gemfile0000644000175000017500000000023213525004651013745 0ustar srudsrudsource 'https://rubygems.org' # for working locally # gem "sassc", :path => "../sassc" # Specify your gem's dependencies in sassc-rails.gemspec gemspec sassc-rails-2.1.2/CODE_OF_CONDUCT.md0000644000175000017500000000103113525004651015247 0ustar srudsrudSass is more than a technology; Sass is driven by the community of individuals that power its development and use every day. As a community, we want to embrace the very differences that have made our collaboration so powerful, and work together to provide the best environment for learning, growing, and sharing of ideas. It is imperative that we keep Sass a fun, welcoming, challenging, and fair place to play. [The full community guidelines can be found on the Sass website.][link] [link]: https://sass-lang.com/community-guidelines sassc-rails-2.1.2/sassc-rails.gemspec0000644000175000017500000000222013525004651016242 0ustar srudsrud# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'sassc/rails/version' Gem::Specification.new do |spec| spec.name = "sassc-rails" spec.version = SassC::Rails::VERSION spec.authors = ["Ryan Boland"] spec.email = ["ryan@tanookilabs.com"] spec.summary = %q{Integrate SassC-Ruby into Rails.} spec.description = %q{Integrate SassC-Ruby into Rails.} spec.homepage = "https://github.com/sass/sassc-rails" spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] spec.add_development_dependency 'pry' spec.add_development_dependency "bundler" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency 'mocha' spec.add_dependency "sassc", ">= 2.0" spec.add_dependency "tilt" spec.add_dependency 'railties', '>= 4.0.0' spec.add_dependency 'sprockets', '> 3.0' spec.add_dependency 'sprockets-rails' end