I'm hoping to flesh this out more in the future. For now, here's something I threw together recently. It's a Capistrano task for compressing your Rails app's stylesheets on deploy so that they will be smaller for your clients to download:
task :compress_stylesheets, :roles => :app do Dir.glob("public/stylesheets/*.css").each do |path| contents = File.open(path, "r").read contents.gsub!(/\/\*.*?\*\//m, '') # strip comments contents.gsub!(/\s*[\n\r]+\s*/, '') # strip newlines and surrounding whitespace contents.gsub!(/\s*([:;{}])\s*/, '\1') # strip whitespace around colons, semi-colons, and squiggly brackets contents.gsub!(/\s+\s\s+/, ' ') # strip extra whitespace put contents, File.join(release_path, path) end end