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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060718/bcdb9180/attachment.html
Here is an example I found. You might be able to model your after this generator. http://svn.dpiddy.net/plugins/crud_generator/ Peter On 7/18/06, Jatinder Singh <jatinder.saundh@gmail.com> wrote:> 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_generator > and 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 > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
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 On 7/18/06, Peter Michaux <petermichaux@gmail.com> wrote:> > Here is an example I found. You might be able to model your after this > generator. > > http://svn.dpiddy.net/plugins/crud_generator/ > > Peter > > > > > On 7/18/06, Jatinder Singh <jatinder.saundh@gmail.com> wrote: > > 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_generator > > and 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 > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060718/e5100edf/attachment.html
Apparently Analagous Threads
- Javascript form validation for In place editting in scriptaculous ?
- Does Rails suppports XHTML for views for inline SVG''s?
- render not able to locate template in publisher
- Reports in Rails
- Facebooker::Session::SessionExpired (Session key invalid or no longer valid)