3
3
module SassC
4
4
module Rails
5
5
class Importer < SassC ::Importer
6
-
7
6
class Extension
8
7
attr_reader :postfix
9
8
10
9
def initialize ( postfix )
11
10
@postfix = postfix
12
11
end
13
12
14
- def import_for ( original_path , parent_path , full_path )
13
+ def import_for ( original_path , parent_path , full_path , options )
15
14
SassC ::Importer ::Import . new ( full_path )
16
15
end
17
16
end
@@ -21,7 +20,7 @@ def postfix
21
20
".css"
22
21
end
23
22
24
- def import_for ( original_path , parent_path , full_path )
23
+ def import_for ( original_path , parent_path , full_path , options )
25
24
import_path = full_path . gsub ( /\. css$/ , "" )
26
25
SassC ::Importer ::Import . new ( import_path )
27
26
end
@@ -32,9 +31,9 @@ def initialize(postfix)
32
31
super
33
32
end
34
33
35
- def import_for ( original_path , parent_path , full_path )
34
+ def import_for ( original_path , parent_path , full_path , options )
36
35
template = Tilt ::ERBTemplate . new ( full_path )
37
- parsed_erb = template . render
36
+ parsed_erb = template . render ( options [ :sprockets ] [ :context ] , { } )
38
37
SassC ::Importer ::Import . new ( full_path , source : parsed_erb )
39
38
end
40
39
end
@@ -99,7 +98,7 @@ def imports(path, parent_path)
99
98
try_path = File . join ( search_path , file_name + extension . postfix )
100
99
if File . exists? ( try_path )
101
100
record_import_as_dependency try_path
102
- return extension . import_for ( path , parent_path , try_path )
101
+ return extension . import_for ( path , parent_path , try_path , options )
103
102
end
104
103
end
105
104
end
0 commit comments