Before talking about how you can write custom Rake tasks to support your project, you should take a look at the variety of Rake tasks that have already been created. These cover a wide variety of tasks, including database support, documentation support, annotation support, and test support. Use the following command line to see a list of defined Rake tasks:
The output of this command is a list of the defined Rake tasks with their descriptions as entered in the rakefile.
The following sections describe the tasks in the standard Rails rakefile. There's a good chance that there's a task in here that you didn't know about that will save you time on your projects. Each group of tasks has a table, and any further comments about these tasks are included after the table.
Most of the Rake tasks defined by Rails concern the database, in part to provide a common command line shortcut for database features that would otherwise take a significant amount of scripting, and which might differ depending on the exact database being used.
The first set of tasks, described in the following table, deals with creating a database or setting it to the current schema. A couple of methods of dumping the schema to a text file are also supported. The colon is the namespace delimiter in Rake, and all the database tasks start with db: .
|db:abort_if_pending_migrations||Used as a dependent task, stops Rake if there is an unperformed ...|