Skip to content

Fix the ordering so that more specialised files are correctly picked #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/sassc/rails/importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ def import_for(full_path, parent_dir, options)
EXTENSIONS = [
CssScssExtension.new,
CssSassExtension.new,
Extension.new(".scss"),
Extension.new(".sass"),
CSSExtension.new,
SassERBExtension.new,
ERBExtension.new(".scss.erb"),
ERBExtension.new(".css.erb"),
SassERBExtension.new
]
Extension.new(".scss"),
Extension.new(".sass"),
CSSExtension.new
].freeze

PREFIXS = [ "", "_" ]
GLOB = /(\A|\/)(\*|\*\*\/\*)\z/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "globbed_multiple_extensions/**/*";
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.glob {
margin: <%= 0 %>;
}
10 changes: 10 additions & 0 deletions test/sassc_rails_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,16 @@ def test_allows_for_inclusion_of_inline_source_maps
# 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"

Expand Down