@@ -28,7 +28,8 @@ def find(name, options)
28
28
private
29
29
def glob_imports ( base , glob , options )
30
30
contents = ""
31
- each_globbed_file ( base , glob ) do |filename |
31
+ context = options [ :sprockets ] [ :context ]
32
+ each_globbed_file ( base , glob , context ) do |filename |
32
33
next if filename == options [ :filename ]
33
34
contents << "@import #{ filename . inspect } ;\n "
34
35
end
@@ -39,7 +40,7 @@ def glob_imports(base, glob, options)
39
40
) )
40
41
end
41
42
42
- def each_globbed_file ( base , glob )
43
+ def each_globbed_file ( base , glob , context )
43
44
raise ArgumentError unless glob == "*" || glob == "**/*"
44
45
45
46
exts = extensions . keys . map { |ext | Regexp . escape ( ".#{ ext } " ) } . join ( "|" )
@@ -85,7 +86,7 @@ def find(*args)
85
86
def process_erb_engine ( engine )
86
87
if engine && syntax = erb_extensions [ engine . options [ :syntax ] ]
87
88
template = Tilt ::ERBTemplate . new ( engine . options [ :filename ] )
88
- contents = template . render ( context , { } )
89
+ contents = template . render ( engine . options [ :sprockets ] [ : context] , { } )
89
90
90
91
Sass ::Engine . new ( contents , engine . options . merge ( :syntax => syntax ) )
91
92
else
@@ -136,13 +137,6 @@ def deprecate_extra_css_extension(engine)
136
137
include ERB
137
138
include Globbing
138
139
139
- attr_reader :context
140
-
141
- def initialize ( context , *args )
142
- @context = context
143
- super ( *args )
144
- end
145
-
146
140
# Allow .css files to be @import'd
147
141
def extensions
148
142
{ 'css' => :scss } . merge ( super )
0 commit comments