Skip to content
This repository was archived by the owner on Sep 20, 2019. It is now read-only.

mraichelson/rake_experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build script experiment

What I'd like it to do...

  • 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

Known issues

  • 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.)

Installation

Terminal configuration

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.)

Third-party applications

Update the Ruby Gem package manager

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

Ruby gems

(this only needs to be done the FIRST TIME you set this up on your system)

gem install syntax: sudo gem install {gem name}

Juicer config...

  • juicer install yui_compressor
  • juicer install jslint

Get down to it, yo...

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.

External docs that may be of use

Rake tutorials

Installation on windows

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.

About

Once upon a time this was a build tool for working on HTML projects. It is very old.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors