grosser / reduce

Ruby/CLI: minify javascript + stylesheets, lossless image optimization

This URL has Read+Write access

reduce /
name age message
file .gitignore Wed Feb 11 12:32:47 -0800 2009 added docs + bin [grosser]
file README.markdown Fri Oct 09 05:47:19 -0700 2009 readme update [grosser]
file Rakefile Sun Nov 22 00:40:19 -0800 2009 gemcutter is default now hurray [grosser]
file VERSION Fri Oct 09 05:37:44 -0700 2009 Version bump to 0.2.0 [grosser]
directory bin/ Fri Oct 09 05:37:35 -0700 2009 simplified interface [grosser]
directory lib/ Fri Oct 09 05:37:35 -0700 2009 simplified interface [grosser]
file reduce.gemspec Sun Nov 22 00:40:31 -0800 2009 Regenerated gemspec for version 0.2.0 [grosser]
directory spec/ Fri Oct 09 05:37:35 -0700 2009 simplified interface [grosser]
directory vendor/ Wed Feb 11 12:32:47 -0800 2009 added docs + bin [grosser]
README.markdown

Lossless reduction for js, css, jpg, png, gif

Install

install ruby + rubygems
sudo gem install reduce

Usage

reduce -o public/image.gif
reduce public/javascripts/application.js > public/javascripts/application.min.js

Options

-o, --overwrite                  overwrite file
-v, --version                    Show Version
-h, --help                       Show this.

Ruby

reduced_data = Reduce.reduce('files/bla.js')

How does it work?

  • uses web-based lossless image reduction service Smush.it / PunyPng through smusher
  • uses YUI compressor to minify css/js

Author

Michael Grosser
grosser.michael@gmail.com
Hereby placed under public domain, do what you want, just do not hold me accountable...