Write a new generator

Hi,

Could anyone point me to how to write a generator in Ruby?
I was going through code in ruby files at
\rails-1.1.2\lib\rails_generatorand found that it reads gems
specification to look for generator s present
on the system.
The way there are tutorials on how to create plugins for Rails, are
there
any for Generators?

At the end of it I should be able to do something like this

ruby script/generate <my_generator> arguments

Appreciate help.

Regards,
Jatinder

Here is an example I found. You might be able to model your after this
generator.

http://svn.dpiddy.net/plugins/crud_generator/

Peter

Thanks Peter!
I will look through the example generator.

I was worrying about telling script/generate ruby program that please
consider my generator as well, for which I thought I would have to write
down my generators name/location in some rails config file.

Regards,
Jatinder

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs