Using a Cakefile

We've gotten a little ahead of ourselves. We upgraded our application to use data from a database, but right now our database doesn't exist! While we might build some sort of import system or data entry interface to add records to our application in production, during development it's nice to be able to easily add a set of seed data. We already have this seed data, we just need a way to put it into our database.

CoffeeScript provides a simple but effective solution to these sorts of problems: Cakefiles. Cakefiles are inspired by the venerable Makefiles, the build system for C and friends. The premise of a Makefile and its variants (Ruby users will also be familiar with Rakefiles) is simple: it consists of various tasks which can ...

Get CoffeeScript Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.