Module: Shine::JS
- Defined in:
- lib/shine.rb
Defined Under Namespace
Classes: Compressor
Class Method Summary collapse
- .file(f) ⇒ Object
- .files(*input_files) ⇒ Object
- .in_place(input_file_path) ⇒ Object
- .string(js, options = {}) ⇒ Object
Class Method Details
.file(f) ⇒ Object
93 94 95 |
# File 'lib/shine.rb', line 93 def self.file(f) self.files([f]) end |
.files(*input_files) ⇒ Object
96 97 98 99 100 |
# File 'lib/shine.rb', line 96 def self.files(*input_files) input_files.flatten! compressor = Shine::JS::Compressor.new(input_files) compressor.compress end |
.in_place(input_file_path) ⇒ Object
81 82 83 84 |
# File 'lib/shine.rb', line 81 def self.in_place(input_file_path) compressor = Shine::JS::Compressor.new(input_file_path) compressor.compress_in_place end |
.string(js, options = {}) ⇒ Object
86 87 88 89 90 91 92 |
# File 'lib/shine.rb', line 86 def self.string(js, ={}) begin Shine.compress_string(js, :js, ) rescue CompressionError js end end |