Class: Embork::Sprockets::ClosureCompiler
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- Embork::Sprockets::ClosureCompiler
- Defined in:
- lib/embork/sprockets/closure_compiler.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.compiler ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/embork/sprockets/closure_compiler.rb', line 11 def self.compiler require 'closure-compiler' @compiler ||= Closure::Compiler.new( :jar_file => File.('../support/closure_compiler.jar', __FILE__), :compilation_level => 'SIMPLE' ) end |
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
19 20 21 22 |
# File 'lib/embork/sprockets/closure_compiler.rb', line 19 def evaluate(scope, locals, &block) @logger.info 'Compressing %s.js with the closure compiler' % scope.logical_path self.class.compiler.compile data end |