Tass edited this page Sep 13, 2010 · 16 revisions

This page is up to date for Rango 0.1.

Rango uses simple-templater which is simple, but powerful tool for creating generators. Because writing generators is real pain in the ass, simple-templater is opinionated, so you don’t have to specify where you have which kind of files, which files are templates and which are just plain ones.

It provides hooks, you can register your own templates which will be available via rango create [yourgenerator] etc. Check its README for more informations!

Available Generators

Project Generator

rango create stack blog --models=post,tag --controllers=posts,tags --orm=sequel

Available options

- --orm=[datamapper|sequel] Datamapper is default and fully supported, Sequel just partially.
- --models=[list] Comma-separated list of models you want to generate.
- --controllers=[list] Comma-separated list of controllers you want to generate.
- --template-engine=haml Just haml is supported at the moment
- --router=usher|rack-router|rack-mount Router you want to use, usher is default.
- --[no-]git-repository If you want to initialize new Git repository, add everything and do the initial commit. If you don’t provide this option via ARGV, this hook will ask you.

Flat Generator

This generator generates just one rackup file, so rango create flat my_service will create

Customizing Rango generators

Lets say you are not very big MIT fan, and you want to use Ruby license instead. The only thing you have to do is create ~/.simple-templater/rango/project/content/LICENSE file containing the Ruby license. Easy, right?

Customizing Hooks

Writing Your Own Generators

It’s actually pretty easy. simple-templater create stub settings and you can start to add your files into content directory, customize hooks etc. Check simple-templater README for more informations!