# Ruby Static Code Generator (From Templates) - Any Links? Gems? What's the "State-of-the-Art"?

**URL:** <https://rubytalk.org/t/ruby-static-code-generator-from-templates-any-links-gems-whats-the-state-of-the-art/73183>\
**Category:** ruby-talk\
**Created:** [17 August 2015 18:25 UTC](https://rubytalk.org/t/ruby-static-code-generator-from-templates-any-links-gems-whats-the-state-of-the-art/73183 "2015-08-17T18:25:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladimir\_Kochnev](https://avatars.discourse-cdn.com/v4/letter/v/f08c70/32.png) [@Vladimir\_Kochnev](https://rubytalk.org/u/Vladimir_Kochnev)\
**Post date:** [17 August 2015 18:25 UTC](https://rubytalk.org/t/ruby-static-code-generator-from-templates-any-links-gems-whats-the-state-of-the-art/73183/1 "2015-08-17T18:25:36Z")

</div>

Are you sure you need an _engine_? Start with plain erb and see how it fits to your needs.

Also look at how rails generates scaffolds.

> **···**
>
> 21:10, 17 августа 2015 г., Gerald Bauer [gerald.bauer@gmail.com](mailto:gerald.bauer@gmail.com):
> 
> > Hello,
> > 
> > Before I start coding yet another static code generator (from  
> > templates) I’d appreciate any insight. Maybe I’m missing some gems,  
> > tools, etc.
> > 
> > Ideally there’s a generic tool like g8 in scala [1] that lets you  
> > host your template in a git repo and using
> > 
> > $ g8 new test/gem --name=Hola
> > 
> > will download the repo, ask for the configuration parameters and  
> > merge the templates to generate ready to use code.
> > 
> > I know hoe includes sow e.g.
> > 
> > $ sow Hola
> > 
> > or there’s the oldie newgem e.g.
> > 
> > $ newgem Hola
> > 
> > But sow and newgem, for example, are kind of “hard-coded”. You  
> > cannot reuse the “built-in” code generator or use a different (remote)  
> > template repo.
> > 
> > If found boilerplater [2] by Michal Fojtik but it looks it’s not  
> > even used by Michal any longer itself (only has one example sinatra  
> > example as a gist repo).
> > 
> > Anyways, if you have any comments or insight - greatly appreciated.
> > 
> > Cheers.
> > 
> > [1] [GitHub - foundweekends/giter8: a command line tool to apply templates defined on GitHub](https://github.com/n8han/giter8)  
> > [2] [GitHub - mfojtik/boilerplater: Simple boiler plate system to bootstrap dev of new applications](https://github.com/mfojtik/boilerplater)
> 
> –  
> Отправлено из мобильного приложения Яндекс.Почты

---

<div class="post-metadata">

**Author:** ![Gerald\_Bauer1](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/gerald_bauer1/32/1852_2.png) [@Gerald\_Bauer1](https://rubytalk.org/u/Gerald_Bauer1)\
**Post date:** [17 August 2015 21:07 UTC](https://rubytalk.org/t/ruby-static-code-generator-from-templates-any-links-gems-whats-the-state-of-the-art/73183/2 "2015-08-17T21:07:01Z")

</div>

Hello,

&nbsp;&nbsp;Thanks for your comments.

> Also look at how rails generates scaffolds.

&nbsp;&nbsp;&nbsp;That's the idea. Ideally there's something like rails application  
templates but more "generic", that is, that works for everything e.g.  
plain ruby etc. If anyone has any pointers, let us know.

&nbsp;&nbsp;Cheers.

PS: I've just put together an "engine" e.g. mrh/mrhyde [1] - that is,  
specific to static sites (e.g. jekyll). The idea is to make it more  
"generic" so it works for gem starter templates, sinatra starter  
templates, gli starter templates, etc.

[1] [GitHub - quikstart/mrhyde: mrhyde-tools gem - static site quick starter script wizard .:. jekyll command line tool](https://github.com/mrhydescripts/mrhyde)
