Sha256: de1ca2baa51594668519b50e7da497d5046ad22b4901e1bbea7074785b88188b

Contents?: true

Size: 586 Bytes

Versions: 4

Compression:

Stored size: 586 Bytes

Contents

require "crush/engine"

module Crush
  # Engine implementation of the UglifyJS
  # JavaScript compressor. See:
  #
  # https://rubygems.org/gems/rainpress
  class Uglifier < Engine
    self.default_mime_type = "application/javascript"
      
    def self.engine_initialized?
      !!(defined? ::Uglifier)
    end
    
    def initialize_engine
      require_template_library "uglifier"
    end
    
    def prepare
      @engine = ::Uglifier.new(options)
      @output = nil
    end
    
    def evaluate(scope, locals, &block)
      @output ||= @engine.compile(data)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
crush-0.3.3 lib/crush/uglifier.rb
crush-0.3.2 lib/crush/uglifier.rb
crush-0.3.1 lib/crush/uglifier.rb
crush-0.3.0 lib/crush/uglifier.rb