Class: Shine::CSS::Compressor

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

Instance Method Summary collapse

Constructor Details

#initialize(filepaths) ⇒ Compressor

Returns a new instance of Compressor.



170
171
172
# File 'lib/shine.rb', line 170

def initialize(filepaths)
  @filepaths = filepaths
end

Instance Method Details

#compress(options = {}) ⇒ Object



174
175
176
# File 'lib/shine.rb', line 174

def compress(options={})
  Shine.compress_css(@filepaths, options)
end

#compress_in_place(options = {}) ⇒ Object



178
179
180
181
182
183
# File 'lib/shine.rb', line 178

def compress_in_place(options={})
  @filepaths.each do |p|
    c = Shine.compress_css(p, options)
    File.open(p, 'w') { |f| f.write(c) }
  end
end