Method: YUICompressor.compress_js
- Defined in:
- lib/yuicompressor.rb
.compress_js(stream_or_string, options = {}, &block) ⇒ Object
Compress the given JavaScript stream_or_string using the given options. Options should be a Hash with any of the following keys:
:line_break-
The maximum number of characters that may appear in a single line of compressed code. Defaults to no maximum length. If set to 0 each line will be the minimum length possible.
:munge-
Should be
trueif the compressor should shorten local variable names when possible. Defaults tofalse. :preserve_semicolons-
Should be
trueif the compressor should preserve all semicolons in the code. Defaults tofalse. :optimize-
Should be
trueif the compressor should enable all micro optimizations. Defaults totrue. :charset-
Charset. Default is utf8.
40 41 42 |
# File 'lib/yuicompressor.rb', line 40 def compress_js(stream_or_string, ={}, &block) compress(stream_or_string, .merge(:type => 'js'), &block) end |