123456789_123456789_123456789_123456789_123456789_

Class: Sprockets::JSMincCompressor

Relationships & Source Files
Inherits: Object
Defined in: lib/sprockets/jsminc_compressor.rb

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(options = {}) ⇒ JSMincCompressor

[ GitHub ]

  
# File 'lib/sprockets/jsminc_compressor.rb', line 23

def initialize(options = {})
  @compressor_class = Autoload::JSMinC
  @cache_key = "#{self.class.name}:#{Autoload::JSMinC::VERSION}:#{VERSION}:#{DigestUtils.digest(options)}".freeze
end

Class Method Details

.cache_key

[ GitHub ]

  
# File 'lib/sprockets/jsminc_compressor.rb', line 17

def self.cache_key
  instance.cache_key
end

.call(input)

[ GitHub ]

  
# File 'lib/sprockets/jsminc_compressor.rb', line 13

def self.call(input)
  instance.call(input)
end

.instance

[ GitHub ]

  
# File 'lib/sprockets/jsminc_compressor.rb', line 9

def self.instance
  @instance ||= new
end

Instance Attribute Details

#cache_key (readonly)

[ GitHub ]

  
# File 'lib/sprockets/jsminc_compressor.rb', line 21

attr_reader :cache_key

Instance Method Details

#call(input)

[ GitHub ]

  
# File 'lib/sprockets/jsminc_compressor.rb', line 28

def call(input)
  @compressor_class.minify(input[:data])
end