Class: Shine::CSS::Compressor
- Inherits:
-
Object
- Object
- Shine::CSS::Compressor
- Defined in:
- lib/shine.rb
Instance Method Summary collapse
- #compress(options = {}) ⇒ Object
- #compress_in_place(options = {}) ⇒ Object
-
#initialize(filepaths) ⇒ Compressor
constructor
A new instance of Compressor.
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(={}) Shine.compress_css(@filepaths, ) end |
#compress_in_place(options = {}) ⇒ Object
178 179 180 181 182 183 |
# File 'lib/shine.rb', line 178 def compress_in_place(={}) @filepaths.each do |p| c = Shine.compress_css(p, ) File.open(p, 'w') { |f| f.write(c) } end end |