header image

Update: Pratik covers rails templates in more detail here.

I hate to use uber-superlatives, but this is just plain frakkin awesome to the power of a Chuck Norris roundhouse-kick: Jeremy McAnally’s rg (don’t worry if you have no clue about rg - I heard about it 10 minutes ago myself (via Pratik)) made it to the rails core.

So what the hell is rg to begin with? rg is a rails generator, like the ‘rails’ command (the one used to create a blank Rails app) just way cooler. You think it has never been easier to create a skeleton app because we have bort? Well, then check this out:

bort_template.png (Eyes glazing over? Check it out (as well as other examples) on github).

It’s hard to believe, but the above template is able to generate a clean rails app which is basically bort (Or exactly bort. Or very similar to bort. Or similar to a bort lookalike. Or… I guess I leave this debate up to ruby lawyers, bort experts, rg zealots etc.) Anyway, it doesn’t really matter as rg was not invented to compete with bort - bort is merely used as an example because it’s probably the most popular Rails skeleton app nowadays - rg is far more general than that: an easy, concise, Rubyish way to describe your Rails app (including plugins, vendored gems, lib files, initializers and whatnot) in a very straightforward way.

There are a handful of base Rails apps out there - but the chance that one of them is exactly using the tools you are committed to is minimal. For example I prefer HAML to erb, SASS to CSS, jQuery to Prototype, somewhat undecided between Shoulda and rSpec, I’d like to give authlogic a spin the next time I need user authentication etc. and the list goes on and on - and it changes over time. With this addition to Rails this is no problem - it takes minutes to cook your own Rails skeleton app, and minutes to adjust it later.

If this is still not enough, check out the Jeremy’s TODO list: Save yourself the hassle of keeping your core components up to date (coming soon). OMG, I have been waiting for something like this for ages, and I doubt I am alone (though the ability to describe gems in environment.rb was a great leap forward) - this will really rock! Kudos Jeremy!



If you liked the article, subscribe to the feed   and follow me on twitter!.


      

12 Responses to “Hot in Edge Rails: Generate Rails Apps from Templates”

  1. Glenn Says:

    Woo! Great find Peter!! And thanks to Pratik too for passing it along.

  2. peter Says:

    @glenn: haha, thinking about switching back to rails? :)

  3. Jim Neath Says:

    That is awesome.

  4. Double Shot #344 « A Fresh Cup Says:

    [...] Hot in Edge Rails: Generate Rails Apps from Templates - This is indeed hot, and will largely replace the need to keep static template applications hanging around. [...]

  5. cs Says:

    The next step?

    framework(:foo) do
    ruby ‘rubinius’, :git => …
    dbengine ‘mysql’, :src => ….
    orm ‘active
    record’, :src => …
    controller ‘cells + apotomo”, :git =>…
    view ’sass, haml’, : …
    ….
    end

  6. peter Says:

    @cs well, that might be a bit far fetched… though who knows?

  7. Henrik N Says:

    @cs Looks a little like Merb ;)

  8. MJ Says:

    This is pretty sweet, I think we’ll give it a whirl with our stock Facebook application builds.

    Any idea on when the “keeping your core components up to date” would be complete?

  9. Integrate Ruby and Asterisk (Call Detail Record) Using … Says:

    [...] Ruby, Rails, Web2.0 » Blog Archive » Hot in Edge Rails: Generate … [...]

  10. peter Says:

    @MJ: No clue, just seen it on Jeremy’s TODO list (scroll to section FEAURES AND PROBLEMS). Now that it is in Rails core, I would assume as fast as possible…

  11. Glenn Says:

    @peter: Probably not, I’ll most likely stick with merb for new apps. This (like engines becoming core) just seems like another of the check list for feature-matching merb.

    aahh… how the apprentice has now become the master ;)

  12. Nome do Jogo » Blog Archive » Rails Podcast Brasil - Episódio 39 Says:

    [...] Hot in Edge Rails: Generate Rails Apps from Templates [...]

Leave a Reply




Bad Behavior has blocked 1031 access attempts in the last 7 days.