Class: Sprockets::CocoTemplate

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/sprockets/coco.rb

Constant Summary collapse

@@default_bare =
false

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_bareObject



9
10
11
# File 'lib/sprockets/coco.rb', line 9

def self.default_bare
  @@default_bare
end

.default_bare=(value) ⇒ Object



13
14
15
# File 'lib/sprockets/coco.rb', line 13

def self.default_bare=(value)
  @@default_bare = value
end

.engine_initialized?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/sprockets/coco.rb', line 17

def self.engine_initialized?
  defined? ::Coco
end

Instance Method Details

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



31
32
33
# File 'lib/sprockets/coco.rb', line 31

def evaluate(scope, locals, &block)
  @output ||= Coco.compile(data, options)
end

#initialize_engineObject



21
22
23
# File 'lib/sprockets/coco.rb', line 21

def initialize_engine
  require_template_library 'ruby-coco'
end

#prepareObject



25
26
27
28
29
# File 'lib/sprockets/coco.rb', line 25

def prepare
  if !options.key?(:bare)
    options[:bare] = self.class.default_bare
  end
end