Class: CsscompressCompressor

Inherits:
Object
  • Object
show all
Defined in:
lib/csscompress/sprockets.rb

Constant Summary collapse

VERSION =
1

Class Method Summary collapse

Class Method Details

.cache_keyObject



4
5
6
# File 'lib/csscompress/sprockets.rb', line 4

def self.cache_key
  "#{name}:#{Csscompress::VERSION}:#{VERSION}".freeze
end

.call(input) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/csscompress/sprockets.rb', line 8

def self.call(input)
  puts "[#{name}] Compressing…"
  Tempfile.create([input[:name], ".css"]) do |file|
    file << input[:data]
    file.close
    {data: Csscompress.minify(file.path)}
  end
end