This project is archived and is in readonly mode.

#1645 ✓wontfix
Dr Nic

Use rubigen as framework for rails_generator

Reported by Dr Nic | December 27th, 2008 @ 12:32 PM | in 2.x

RubiGen ( was an extraction of rails_generator to provide an awesome generator mechanism for any framework, not just Rails. It was created in 2007, and presented at RubyConf 2007 (

Jeremy Kemper asked for it to patched back into Rails. This ticket is for that patch request.

The patch is found in the branch (built off edge rails from 27/12/2008)

All generator-related tests are passing.

The following sample usage demonstrates it working via the "rails" and "script/generate" commands:

git clone git://
cd rubigen
rake install_gem
cd ..
git clone git:// 
cd rails
git checkout -b merge_rubigen --track
gl origin merge_rubigen
ruby railties/bin/rails test_app
cd test_app
ln -s ../.. vendor/rails
script/generate model Person name:string
script/generate model

The two last commands will show the discovery mechanism of generators as per the current rails mechanism (gems, plugins, ~/.rails/generators, lib/generators, etc)

This patch also includes the inclusion of "script/update" in the rails app scaffold. I personally don't get the point of it, and in 4 years have never wondered why it was never included. But there is "rails_generator/scripts/update.rb" code, so I figure at some stage someone thought it was a good idea.

If script/update is a bad idea, then let's remove all references to it.

I have not frozen rubigen into the rails source yet, though the vendor.rb place for it is ready. This ticket may spark some discussion about rubigen/rails_generator leading to some refactorings prior the inclusion of this patch/branch into edge rails.

Comments and changes to this ticket

  • Dr Nic

    Dr Nic December 27th, 2008 @ 01:01 PM

    There is still a fair few files left in railties/lib/rails_generators folder. Perhaps half were removed.

  • Dr Nic

    Dr Nic December 27th, 2008 @ 01:30 PM

    There is a now a rake task to run tests associated with rails' generators:

    cd railties
    rake test_generators
  • Pratik

    Pratik March 8th, 2009 @ 05:05 PM

    • State changed from “new” to “hold”

    I think it might be better to discuss this in the mailing list as the ticket has been inactive for like 2-3 months now. I'll keep this on "hold" until there's any further progress.

  • Dr Nic

    Dr Nic March 19th, 2009 @ 12:20 PM

    I am such an idiot. I think I destroyed my rails repo weeks later assuming I didn't need it anymore. Fuc!$#@#$

  • Dr Nic

    Dr Nic March 19th, 2009 @ 12:24 PM

    Ooh, when I get back to Oz in a week's time I'll restore my local rails repo from Time Machine. Yay for backups.

  • José Valim

    José Valim August 8th, 2009 @ 12:21 PM

    • State changed from “hold” to “wontfix”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>