Class: Sprockets::ClosureCompressor

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.engine_initialized?Boolean

Returns:

  • (Boolean)

7
8
9
# File 'lib/sprockets/closure_compressor.rb', line 7

def self.engine_initialized?
  defined?(::Closure::Compiler)
end

Instance Method Details

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


18
19
20
# File 'lib/sprockets/closure_compressor.rb', line 18

def evaluate(context, locals, &block)
  Closure::Compiler.new.compile(data)
end

#initialize_engineObject


11
12
13
# File 'lib/sprockets/closure_compressor.rb', line 11

def initialize_engine
  require_template_library 'closure-compiler'
end

#prepareObject


15
16
# File 'lib/sprockets/closure_compressor.rb', line 15

def prepare
end