From b2c7d4d855178c1cdfc34ff91146c3261fcf5a8c Mon Sep 17 00:00:00 2001 From: Matthew Kirk Date: Mon, 28 Nov 2016 11:33:47 -0800 Subject: [PATCH 1/3] Stringify paths to unique paths correctly The problem here is that gems like compass-sass and bootstrap-sass will build their own Importer classes that aren't being properly uniqued. Also this resolves the issue outlined in https://github.com/sass/sassc-rails/issues/79 --- lib/sassc/rails/importer.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/sassc/rails/importer.rb b/lib/sassc/rails/importer.rb index dd13704..6fab954 100644 --- a/lib/sassc/rails/importer.rb +++ b/lib/sassc/rails/importer.rb @@ -96,7 +96,9 @@ def imports(path, parent_path) return glob_imports(base, m[2], parent_path) end - search_paths = ([parent_dir] + load_paths).uniq + # Compass and other gems us their own special loaders + # Hence making this to_s required to have a proper uniq set. + search_paths = ([parent_dir] + load_paths).map(&:to_s).uniq if specified_dir != "." search_paths.map! do |path| From df1a4a5a411fceeca624fa789922a2b1466929dc Mon Sep 17 00:00:00 2001 From: Matthew Kirk Date: Mon, 23 Jan 2017 07:40:06 -0800 Subject: [PATCH 2/3] Us -> Use typo --- lib/sassc/rails/importer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sassc/rails/importer.rb b/lib/sassc/rails/importer.rb index 6fab954..39955b6 100644 --- a/lib/sassc/rails/importer.rb +++ b/lib/sassc/rails/importer.rb @@ -96,7 +96,7 @@ def imports(path, parent_path) return glob_imports(base, m[2], parent_path) end - # Compass and other gems us their own special loaders + # Compass and other gems use their own special loaders # Hence making this to_s required to have a proper uniq set. search_paths = ([parent_dir] + load_paths).map(&:to_s).uniq From d6de4560195e5f086ae71e904e426e4c3c5b635a Mon Sep 17 00:00:00 2001 From: Matthew Kirk Date: Mon, 23 Jan 2017 15:20:07 -0800 Subject: [PATCH 3/3] Fix failing spec on line_comments --- test/sassc_rails_test.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/sassc_rails_test.rb b/test/sassc_rails_test.rb index 321fcd8..f1abbdb 100644 --- a/test/sassc_rails_test.rb +++ b/test/sassc_rails_test.rb @@ -45,6 +45,7 @@ def initialize! def initialize_dev! Rails.env = "development" + Dir.chdir(File.join(File.dirname(__FILE__), '../../../')) @app.initialize! end @@ -168,6 +169,7 @@ def test_line_comments_active_in_dev 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