- Merge and compress JS files. (does this! using Juicer)
- Merge and compress CSS files. (does this! using Juicer)
- Remove and/or rewrite excess CSS/JS file references used in HTML files. (does this! using Hpricot)
- Test CSS files for W3c validation. (does this! using W3c_validators)
- Test JS files using JSLint. (does this! using Juicer)
- Test HTML files for W3c validation. (does this! using W3c_validators)
- ? Test CSS files with CSSLint? (This never really goes well for me.)
- Provide a simplified way of generating a SVN/Git tag for different releases of code.
- SVN (does this!)
- Git (does this!)
- Provide a hook into ImageOptim for triggering compression of image files. (does this!)
- Will clone the images directory from the dev structure into the build structure. (does this!)
- Replaces the token
$BuildDate$ in HTML, CSS and JS files with a date/time stamp for when the last build was performed. (v0.5)
Todo:
- Installation/setup documentation
- The HTML validation provided by the w3c_validator gem returns an error object where all the property values are null. So I can't identify actual specific errors from the command line, only identify that the file as a whole fails validation.
- Can't colorize the output of some tasks since (most notably TEST:JS) since they're really wrappers around command line calls (Juicer didn't have any documentation around using it from within a ruby script.)
In Terminal open the Preferences pane. Go to Settings > Text and check the "Display ANSI colors" checkbox. (This isn't strictly necessary, but without it you don't get pretty colors to help show what's going on.)
- ImageOptim (used for image compression)
Just to make sure that it's up to date and will look for all the current repository locations to pull gems from, run the following command from Terminal.
sudo gem update --system
(this only needs to be done the FIRST TIME you set this up on your system)
gem install syntax: sudo gem install {gem name}
- rake
- juicer
- hpricot
- w3c_validators
- colorize
- json (used by the W3c validators gem)
- Yaml (Yaml is installed by default with Ruby, you do not need to use GEM to install it.)
juicer install yui_compressorjuicer install jslint
Navigate to your project directory, and type rake to get a list of commands.
Use rake setup to check the presence of and generate (if necessary) the directory structure that you identified in CONFIG.YML for your project.
Rake tutorials
The image tasks can't be used on windows. (There's no ImageOptim and the rsync options have all been pretty mediocre so far.) It's possible to find workarounds to tie into software that would run on windows, but since none of our FE devs use windows as anything but a browser testing platform I didn't figure it was worth the effort right now.
- Ruby 1.8.7
- Ruby DevKit
- Java (for Rhino, used by JSlint for testing of JS files)
- Ansicon (to enable ANSI color support in cmd.exe)