Module: Jsus::Util::Compressor
- Defined in:
- lib/jsus/util/compressor.rb
Class Method Summary collapse
-
.compress(source, options = {}) ⇒ String
Compresses the javascript source with given compressor and returns the result.
Class Method Details
.compress(source, options = {}) ⇒ String
Compresses the javascript source with given compressor and returns the result.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/jsus/util/compressor.rb', line 14 def compress(source, = {}) method = .fetch(:method, :yui) @result = case method.to_s when "uglifier" then compress_with_uglifier(source) when "frontcompiler" then compress_with_frontcompiler(source) when "closure" then compress_with_closure(source) when "yui" then compress_with_yui(source) else Jsus.logger.error "tried to use unavailable method #{method.inspect}" source end end |