Module: SassC::Rails::SassTemplate::Sprockets3

Included in:
SassC::Rails::SassTemplate
Defined in:
lib/sassc/rails/template.rb

Instance Method Summary collapse

Instance Method Details

#call(input) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/sassc/rails/template.rb', line 8

def call(input)
  context = input[:environment].context_class.new(input)

  options = {
    filename: input[:filename],
    syntax: self.class.syntax,
    load_paths: input[:environment].paths,
    importer: SassC::Rails::Importer,
    sprockets: {
      context: context,
      environment: input[:environment],
      dependencies: context.[:dependency_paths]
    }
  }

  engine = ::SassC::Engine.new(input[:data], options)

  css = Sprockets::Utils.module_include(::SassC::Script::Functions, @functions) do
    engine.render
  end

  context..merge(data: css)
end