Module: Shine::JS
- Defined in:
- lib/shine.rb
Defined Under Namespace
Classes: Compressor
Class Method Summary collapse
- .file(f, options = {}) ⇒ Object
- .files(input_files, options = {}) ⇒ Object
- .in_place(input_file_path) ⇒ Object
- .string(js, options = {}) ⇒ Object
Class Method Details
.file(f, options = {}) ⇒ Object
116 117 118 |
# File 'lib/shine.rb', line 116 def self.file(f, ={}) self.files(f, ) end |
.files(input_files, options = {}) ⇒ Object
120 121 122 123 124 125 |
# File 'lib/shine.rb', line 120 def self.files(input_files, ={}) input_files = [input_files] unless input_files.is_a?(Array) input_files.flatten! compressor = Shine::JS::Compressor.new(input_files) compressor.compress() end |
.in_place(input_file_path) ⇒ Object
103 104 105 106 |
# File 'lib/shine.rb', line 103 def self.in_place(input_file_path) compressor = Shine::JS::Compressor.new(input_file_path) compressor.compress_in_place end |
.string(js, options = {}) ⇒ Object
108 109 110 111 112 113 114 |
# File 'lib/shine.rb', line 108 def self.string(js, ={}) begin Shine.compress_string(js, :js, ) rescue CompressionError js end end |