Class: Requirejs::Tilt::Template

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/requirejs/tilt/template.rb

Instance Method Summary collapse

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object

Internal: Compile the template Stylus using this instance options. The current ‘scope’ and given ‘locals’ are ignored and the output is cached.

Returns a String with the compiled stylesheet with CSS syntax.



24
25
26
27
28
29
30
31
# File 'lib/requirejs/tilt/template.rb', line 24

def evaluate(scope, locals, &block)
  if ::Requirejs::BuildConfig.new(file).exists?
    compiler = ::Requirejs::Compiler.new(scope: scope, data: data, file: file)
    @output ||= compiler.exec
  else
    @output ||= data
  end
end

#prepareObject



16
17
# File 'lib/requirejs/tilt/template.rb', line 16

def prepare
end