# A code generator?

**URL:** <https://www.ruby-forum.com/t/a-code-generator/87097>\
**Category:** Ruby\
**Created:** [February 28, 2007, 3:42am UTC](https://www.ruby-forum.com/t/a-code-generator/87097 "2007-02-28T03:42:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@pedro](https://www.ruby-forum.com/u/pedro)\
**Post date:** [February 28, 2007, 3:42am UTC](https://www.ruby-forum.com/t/a-code-generator/87097/1 "2007-02-28T03:42:10Z")

</div>

Hi,  
I am in a not rails project. I want to generate some struct-dumb-code  
in ruby that is going to be heavily changed. Right now, i did it using  
rails script/generate.

My question is, is out there any good code-generator for ruby ?

Is there a good way to use the rails generator to build out-rails-code?

BTW we are thinking in create a house-code-generator. Any good  
article/video on this topic

Thanx

## PS: I think i made double posting everytime a mail to the list bur i dont know why ☹ Sorry for that

* * *

Pedro Del G.

Email : removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![pedro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@pedro](https://www.ruby-forum.com/u/pedro)\
**Post date:** [February 28, 2007, 4:40am UTC](https://www.ruby-forum.com/t/a-code-generator/87097/2 "2007-02-28T04:40:14Z")

</div>

> ## PS: I think i made double posting everytime a mail to the list bur i dont know why ☹ Sorry for that
> 
> * * *
> 
> Pedro Del G.

Double posting?

[http://www.ruby-forum.com/topic/32110#6789](http://www.ruby-forum.com/topic/32110#6789)

Harry

---

<div class="post-metadata">

**Author:** ![pedro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@pedro](https://www.ruby-forum.com/u/pedro)\
**Post date:** [February 28, 2007, 4:42am UTC](https://www.ruby-forum.com/t/a-code-generator/87097/3 "2007-02-28T04:42:15Z")

</div>

On Feb 27, 2007, at 9:41 PM, Pedro Del G. wrote:

> BTW we are thinking in create a house-code-generator. Any good  
> article/video on this topic

First, how about creating an in-house gem rather than code  
generation? If generated code has bugs, fixing it can be a pain.

But if you think it’s the best solution I recommend erb, which is  
what the rails generations are based on.

Hope that helps!  
Mat

---

<div class="post-metadata">

**Author:** ![pedro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@pedro](https://www.ruby-forum.com/u/pedro)\
**Post date:** [March 1, 2007, 10:05am UTC](https://www.ruby-forum.com/t/a-code-generator/87097/4 "2007-03-01T10:05:40Z")

</div>

> My question is, is out there any good code-generator for ruby  
> ?

Ruby itself is a good code-generator for Ruby…

Search on Google for “ruby meta programming”.

gegroet,  
Erik V. - [http://www.erikveen.dds.nl/](http://www.erikveen.dds.nl/)
