Class: Middleman::Renderers::Sass::SassPlusCSSFilenameTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/middleman3-sassc/monkey-patches.rb

Instance Method Summary collapse

Instance Method Details

#evaluate(context, _) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/middleman3-sassc/monkey-patches.rb', line 41

def evaluate(context, _)
  # empty file?
  if data.empty?
    @output = ''
  end

  @context ||= context
  sprockets = context.sprockets
  @sprockets_context ||= sprockets.context_class.new(sprockets, File.basename(file),
    Pathname.new(file))

  options = sass_options.merge(::Middleman3::SassC::create_sassc_options(sprockets,
    @sprockets_context))
  @engine = ::SassC::Engine.new(data, options)
  @engine.render
end