Ruby CGI script that strips and concatenates CSS or Javascript files to cut down on HTTP requests
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Ruby CSS Combiner

Copyright (C) 2008, Mike Green <>


This script simply concatenates CSS or Javascript files, strips out comments and whitespace, and sends them back to the page that requested them. It's meant to be embedded in an (X)HTML document just like a Javascript of CSS file.

NOTE: For debugging purposes, I've required Rubygems and the CGI-Exception gem in the script. These are totally optional and should be commented out for production use because they'll slow you down quite a bit. It's just a convenient way to check CGI errors without delving into Apache log files.


I don't really have time to figure out the peculiarities of Github's Textile and RDoc rendering, so I'm just going to give a couple very basic examples. Here's how to use the script in an HTTP request: