class Tilt::StylusTemplate

Public Class Methods

engine_initialized?() click to toggle source

Internal: Checks if the Stylus module has been properly defined.

Returns true if the 'Stylus' module is present.

# File lib/stylus/tilt/stylus.rb, line 21
def self.engine_initialized?
  defined? ::Stylus
end

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source

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.

# File lib/stylus/tilt/stylus.rb, line 46
def evaluate(scope, locals, &block)
  @output ||= Stylus.compile(data, options)
end
initialize_engine() click to toggle source

Internal: Require the 'stylus' file to load the Stylus module.

Returns nothing.

# File lib/stylus/tilt/stylus.rb, line 28
def initialize_engine
  require_template_library 'stylus'
end
prepare() click to toggle source

Internal: Caches the filename as an option entry if it's present.

Returns nothing.

# File lib/stylus/tilt/stylus.rb, line 35
def prepare
  if self.file
    options[:filename] ||= self.file
  end
end