File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ module Sprockets
4
4
class SassImporter < Sass ::Importers ::Filesystem
5
5
GLOB = /\* |\[ .+\] /
6
6
7
+ attr_reader :context
8
+
7
9
def extensions
8
10
{
9
11
"css" => :scss ,
@@ -35,17 +37,17 @@ def find_with_glob(name, options)
35
37
def each_globbed_file ( glob , base_pathname , options )
36
38
Dir [ "#{ base_pathname } /#{ glob } " ] . sort . each do |filename |
37
39
next if filename == options [ :filename ]
38
- yield filename if File . directory? ( filename ) || @ context. asset_requirable? ( filename )
40
+ yield filename if File . directory? ( filename ) || context . asset_requirable? ( filename )
39
41
end
40
42
end
41
43
42
44
def glob_imports ( glob , base_pathname , options )
43
45
contents = ""
44
46
each_globbed_file ( glob , base_pathname . dirname , options ) do |filename |
45
47
if File . directory? ( filename )
46
- @ context. depend_on ( filename )
47
- elsif @ context. asset_requirable? ( filename )
48
- @ context. depend_on ( filename )
48
+ context . depend_on ( filename )
49
+ elsif context . asset_requirable? ( filename )
50
+ context . depend_on ( filename )
49
51
contents << "@import #{ Pathname . new ( filename ) . relative_path_from ( base_pathname . dirname ) . to_s . inspect } ;\n "
50
52
end
51
53
end
Original file line number Diff line number Diff line change @@ -62,11 +62,13 @@ class SassRailsTest < Sass::Rails::TestCase
62
62
end
63
63
end
64
64
65
+ focus
65
66
test 'sprockets require works correctly' do
66
67
css_output = sprockets_render ( 'scss_project' , 'css_application.css' )
67
68
assert_match /globbed/ , css_output
68
69
end
69
70
71
+ focus
70
72
test 'sass imports work correctly' do
71
73
css_output = sprockets_render ( 'scss_project' , 'application.css.scss' )
72
74
assert_match /main/ , css_output
You can’t perform that action at this time.
0 commit comments