Class: Tilt::LessTemplate
Overview
lesscss.org/
Less templates do not support object scopes, locals, or yield.
Instance Attribute Summary
Attributes inherited from Template
#data, #file, #line, #options
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Template
#basename, #default_encoding, #eval_file, #initialize, #name, #read_template_file, #render
Constructor Details
This class inherits a constructor from Tilt::Template
Class Method Details
.engine_initialized? ⇒ Boolean
54
55
56
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/css.rb', line 54
def self.engine_initialized?
defined? ::Less
end
|
Instance Method Details
#allows_script? ⇒ Boolean
75
76
77
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/css.rb', line 75
def allows_script?
false
end
|
#evaluate(scope, locals, &block) ⇒ Object
71
72
73
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/css.rb', line 71
def evaluate(scope, locals, &block)
@output ||= @engine.to_css(options)
end
|
#initialize_engine ⇒ Object
58
59
60
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/css.rb', line 58
def initialize_engine
require_template_library 'less'
end
|
62
63
64
65
66
67
68
69
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/css.rb', line 62
def prepare
if ::Less.const_defined? :Engine
@engine = ::Less::Engine.new(data)
else
parser = ::Less::Parser.new(options.merge :filename => eval_file, :line => line)
@engine = parser.parse(data)
end
end
|