Sha256: 31d84ad877ee58353c57650eac4865e24d3918afdf2dcd6cb6376d573c2f6074
Contents?: true
Size: 782 Bytes
Versions: 11
Compression:
Stored size: 782 Bytes
Contents
GEM_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) GOOGLE_JS_COMPRESSOR = File.join(GEM_ROOT, 'lib', 'google-compiler-20100917.jar') YUI_JS_COMPRESSOR = File.join(GEM_ROOT, 'lib', 'yuicompressor-2.4.2.jar') def compress_js(scripts, compressor) min_js = '' if (compressor.downcase == "google") cmd = %Q/java -jar "#{GOOGLE_JS_COMPRESSOR}" --charset utf8/ else cmd = %Q/java -jar "#{YUI_JS_COMPRESSOR}" --type js --charset utf8/ end IO.popen(cmd, 'r+') { |f| f.print(scripts); f.close_write; min_js = f.read } min_js end def concat_files(files) out = '' files.each do |file| out += file end out end def all_files(pattern) FileList[pattern].collect {|filename| File.read(filename)}.join "\n\n" end
Version data entries
11 entries across 11 versions & 1 rubygems