Airgun

This gem provides a simple Ruby interface to compress HTML, JS, and CSS, including embedded JS and CSS. This is useful for compressing static web content for size and obfuscation.

require 'airgun'
puts Airgun::html 'file.htm'

args = {
  :outfile => 'compressed.htm',
  :jscompressor => :closure,
  :erb => true,
  :compressjs => true,
  :compresscss => false
}
Airgun::html 'file.htm', args

HTML compresson is provided by the html_compressor gem after parsing with Nokogiri}[]. CSS compression is provided by the {YUI Compressor. JS compression is provided by Google’s Closure Compiler.

Documentation

Airgun::html file, args

By default this method returns the compressed HTML as a string.

Possible arguments:

Airgun::js file, args

By default this method returns the compressed JS as a string.

Possible arguments:

Airgun::css file, args

By default this method returns the compressed CSS as a string.

Possible arguments: