dm-gen is a collection of generators for DataMapper, to allieviate the need to type boilerplate code to get started on a project. dm-gen uses templater as a base.

The Generators


The one file generator generates a single file, which sets up a connection to an in memory sqlite3 database, along with debug logging and a example model, which it then automigrates. One file scripts are great to use as demonstration, either of a bug, or just how to do something.

dm-gen one_file validations_example


The is generator generates an 'is' plugin structure, appropriate for plugins such as dm-is-list, dm-is-remixable etc. A complete plugin structure is generated, including a Rakefile and spec suite skeleton.

dm-gen is example


The adapter generator generates an adapter structure, appropriate for adapters to new data-sources, such as couchdb, YAML files, or anything else. A complete plugin structure is generated. The adapter file generated comes with a lot of documentation explaining the arguments and returns of the 4 methods in the DM adaptor API.

dm-gen adapter example

NB: This generates adapters with the 1.0 API, so make sure you're running that

Copyright © 2008-2010 Jonathan Stott. See LICENSE for details.