bin/jsus in jsus-0.3.3 vs bin/jsus in jsus-0.3.4
- old
+ new
@@ -71,10 +71,14 @@
opts.on('--compress', 'compresses resulting file with YUI compressor') do
options[:compress] = true
end
+ opts.on('--no-cycle-search', 'disables search for circular dependencies which may take quite some time during compilation') do
+ Jsus.look_for_cycles = false
+ end
+
opts.on_tail('-v', '--verbose', 'verbose mode, shows various debug messages') do
Jsus.verbose = true
end
opts.on_tail('--very-verbose', 'very verbose mode, shows pool stats beside usual verbose stuff') do
@@ -274,24 +278,20 @@
end
checkpoint(:postproc)
end
def compress_package
- require 'yui/compressor'
- compressor = YUI::JavaScriptCompressor.new(:munge => true)
- compressed_content = compressor.compress(@package_content)
+ compressed_content = Jsus::Util::Compressor.new(@package_content).result
if compressed_content != ""
@compression_ratio = compressed_content.size.to_f / @package_content.size.to_f
compressed_file_name = @package.filename.sub(/.js$/, ".min.js")
File.open(File.join(@output_dir, compressed_file_name), "w") {|f| f.write(compressed_content) }
else
@compression_ratio = 1.00
puts "ERROR: YUI compressor could not parse input. "
puts "Compressor command used: #{compressor.command.join(' ')}"
end
checkpoint(:compress)
- rescue LoadError
- puts 'ERROR: You need "yui-compressor" gem in order to use --compress option'
end
def generate_supplemental_files
@package.generate_scripts_info(@output_dir) unless options[:without_scripts_info]
@package.generate_tree(@output_dir) unless options[:without_tree_info]