Class: Sprockets::JSMincCompressor
- Inherits:
-
Object
- Object
- Sprockets::JSMincCompressor
- Defined in:
- lib/sprockets/jsminc_compressor.rb
Constant Summary collapse
- VERSION =
'1'
Instance Attribute Summary collapse
-
#cache_key ⇒ Object
readonly
Returns the value of attribute cache_key.
Class Method Summary collapse
Instance Method Summary collapse
- #call(input) ⇒ Object
-
#initialize(options = {}) ⇒ JSMincCompressor
constructor
A new instance of JSMincCompressor.
Constructor Details
#initialize(options = {}) ⇒ JSMincCompressor
Returns a new instance of JSMincCompressor.
23 24 25 26 |
# File 'lib/sprockets/jsminc_compressor.rb', line 23 def initialize( = {}) @compressor_class = Autoload::JSMinC @cache_key = "#{self.class.name}:#{Autoload::JSMinC::VERSION}:#{VERSION}:#{DigestUtils.digest()}".freeze end |
Instance Attribute Details
#cache_key ⇒ Object (readonly)
Returns the value of attribute cache_key.
21 22 23 |
# File 'lib/sprockets/jsminc_compressor.rb', line 21 def cache_key @cache_key end |
Class Method Details
.cache_key ⇒ Object
17 18 19 |
# File 'lib/sprockets/jsminc_compressor.rb', line 17 def self.cache_key instance.cache_key end |
.call(input) ⇒ Object
13 14 15 |
# File 'lib/sprockets/jsminc_compressor.rb', line 13 def self.call(input) instance.call(input) end |
.instance ⇒ Object
9 10 11 |
# File 'lib/sprockets/jsminc_compressor.rb', line 9 def self.instance @instance ||= new end |
Instance Method Details
#call(input) ⇒ Object
28 29 30 |
# File 'lib/sprockets/jsminc_compressor.rb', line 28 def call(input) @compressor_class.minify(input[:data]) end |