Sqwish-ruby

A CSS compressor

This as a Ruby bridge to Sqwish by Dustin Diaz to compress CSS very efficiently.

Ruby usage

Just install it:

$ gem install sqwish

Then use it like so:

require 'sqwish'

Sqwish.minify "div { color: red; } div { background: black; }"
#=> "div{color:red}div{background:black}"

You can also use the strict: true flag (it defaults to false):

Sqwish.minify "div { color: red; } div { background: black; }", strict: true
#=> "div{color:red;background:black}"

Rails usage

In your Gemfile:

gem 'sqwish'

# or optionally:
gem 'sqwish', github: 'rstacruz/sqwish.rb'

In your config/environments/production.rb:

config.assets.css_compressor = Sqwish

Authors

Released under the MIT license.