Class

Create

Extends:

Create is the premier generator command. It copies files, creates directories, renders templates, and more.

Constants
SYNONYM_LOOKUP_URI
Public Methods
class_collisions Check whether the given class names are already taken by Ruby or Rails. In the future, expand to check other namespaces such as the rest of the user’s app.
complex_template
directory Create a directory including any missing parent directories. Always skips directories which exist.
file Copy a file from source to destination with collision checking.
identical? Checks if the source and the destination file are identical. If passed a block then the source file is a template that needs to first be evaluated before being compared to the destination.
migration_template When creating a migration, it knows to find the first available file in db/migrate and use the migration.rb template.
readme Display a README.
route_resources
template Generate a file for a Rails application using an ERuby template. Looks up and evaluates a template by name and writes the result.
Private Methods
find_synonyms Look up synonyms on WordNet. Thanks to Florian Gross (flgr).
raise_class_collision Raise a usage error with an informative WordNet suggestion. Thanks to Florian Gross (flgr).
render_file
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.