Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Use rubigen as framework for rails_generator

#1645

RubiGen (http://rubigen.rubyforge.org) 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 (http://rubyconf2007.confreaks.co...

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

The patch is found in the branch http://github.com/drnic/rails/tr... (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://github.com/drnic/rubigen.git
cd rubigen
rake install_gem
cd ..
git clone git://github.com/drnic/rails.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
script/generate

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.

Reported by Dr Nic · December 27th, 2008 @ 12:32 PM

State: wontfix
Milestone: 2.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Dr Nic
    Dr Nic

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

    December 27th, 2008 @ 01:01 PM

  2. Dr Nic
    Dr Nic

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

    
    cd railties
    rake test_generators
    

    December 27th, 2008 @ 01:30 PM

  3. Pratik
    Pratik
    • 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.

    March 8th, 2009 @ 05:05 PM

  4. Dr Nic
    Dr Nic

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

    March 19th, 2009 @ 12:20 PM

  5. Dr Nic
    Dr Nic

    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.

    March 19th, 2009 @ 12:24 PM

  6. José Valim
    José Valim
    • State changed from hold to wontfix

    August 8th, 2009 @ 12:21 PM