Module: Squoosh

Defined in:
lib/squoosh.rb,
lib/squoosh/version.rb

Overview

Minify HTML, JavaScript, and CSS.

Examples

html = <<-EOF
<!DOCTYPE html>
<html>
  <head>
    <!-- Set the title -->
    <title>My fancy title!</title>
  </head>
  <body>
    <p>Two</p>
    <p>paragraphs.</p>
  </body>
</html>
EOF
compressed = Squoosh.minify_html(html)
# "<!DOCTYPE html><title>My fancy title!</title><p>Two<p>paragraphs."

Author:

Defined Under Namespace

Classes: Squoosher

Constant Summary collapse

VERSION =

The version of squoosh.

'0.2.0'

Class Method Summary collapse

Class Method Details

.minify_css(content, options = {}) ⇒ String

Minify CSS convenience method.


595
596
597
# File 'lib/squoosh.rb', line 595

def self.minify_css(content, options = {})
  Squoosher.new(options).minify_css content
end

.minify_html(content, options = {}) ⇒ String

Minify HTML convenience method.


586
587
588
# File 'lib/squoosh.rb', line 586

def self.minify_html(content, options = {})
  Squoosher.new(options).minify_html content
end

.minify_js(content, options = {}) ⇒ String

Minify JavaScript convenience method.


604
605
606
# File 'lib/squoosh.rb', line 604

def self.minify_js(content, options = {})
  Squoosher.new(options).minify_js content
end