Class: Shine::JS::Compressor
- Inherits:
-
Object
- Object
- Shine::JS::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.
128 129 130 |
# File 'lib/shine.rb', line 128 def initialize(filepaths) @filepaths = filepaths end |
Instance Method Details
#compress(options = {}) ⇒ Object
132 133 134 |
# File 'lib/shine.rb', line 132 def compress(={}) Shine.compress_js(@filepaths, ) end |
#compress_in_place(options = {}) ⇒ Object
136 137 138 139 140 141 |
# File 'lib/shine.rb', line 136 def compress_in_place(={}) @filepaths.each do |p| c = Shine.compress_js(p, ) File.open(p, 'w') { |f| f.write(c) } end end |