Sunday, December 13, 2009

FrontCompiler With Rubygem And Console Tool

FrontCompiler is a Ruby based JavaScript/CSS/HTML compressing tool of mine. It can create albeit packed JavaScript, works with DRYed CSS, can inline css in javascript, works as a Rails plugin, etc.

And as I use it quite a lot on my projects, finally, I've created a rubygem for it. It's available at the gemcutter service now.

http://gemcutter.org/gems/front-compiler

So if you use the project, you might just install it from there.

gem sources -a http://gemcutter.org
gem install front-compiler

Along with the rubygem I've added a simple console tool to work with the compressor

$ frontcc file1.js file2.js ....

It will automatically recognize the file type by its extension, so you can feed it with javascript or css or html. It will read them all, compress in a single string and spit it in the stdout. You also can mix javascript and css in one command to make the css be inlined in javascript.

Enjoy!

No comments: