Module: Crush

Extended by:
Crush
Included in:
Crush
Defined in:
lib/crush.rb,
lib/crush/yui.rb,
lib/crush/sass.rb,
lib/crush/jsmin.rb,
lib/crush/packr.rb,
lib/crush/cssmin.rb,
lib/crush/engine.rb,
lib/crush/closure.rb,
lib/crush/version.rb,
lib/crush/uglifier.rb,
lib/crush/rainpress.rb

Defined Under Namespace

Modules: Closure, Sass, YUI Classes: CSSMin, Engine, JSMin, Packr, Rainpress, Uglifier

Constant Summary collapse

VERSION =
"0.3.3"

Instance Method Summary collapse

Instance Method Details

#registerObject Also known as: register_all

Registers all of the included engines with Tilt.

(see #register_js) (see #register_css)



51
52
53
54
# File 'lib/crush.rb', line 51

def register
  register_js
  register_css
end

#register_cssObject

Registers all of the CSS engines with Tilt in the following order of importance:

  1. Crush::CSSMin

  2. Crush::Rainpress

  3. Crush::YUI::CssCompressor



39
40
41
42
43
44
# File 'lib/crush.rb', line 39

def register_css
  Tilt.register CSSMin,             "css"
  Tilt.register Rainpress,          "css"
  Tilt.register YUI::CssCompressor, "css"
  Tilt.register Sass::Engine,       "css"
end

#register_jsObject

Registers all of the JavaScripts engines with Tilt in the following order of importance:

  1. Crush::Uglifer

  2. Crush::Closure::Compiler

  3. Crush::YUI::JavaScriptCompressor

  4. Crush::Packr

  5. Crush::JSMin



25
26
27
28
29
30
31
# File 'lib/crush.rb', line 25

def register_js
  Tilt.register JSMin,                     "js"
  Tilt.register Packr,                     "js"
  Tilt.register YUI::JavaScriptCompressor, "js"
  Tilt.register Closure::Compiler,         "js"
  Tilt.register Uglifier,                  "js"
end