# Loading, CGI and some aother questions

**URL:** <https://www.ruby-forum.com/t/loading-cgi-and-some-aother-questions/75618>\
**Category:** Ruby\
**Created:** [November 11, 2006, 3:57pm UTC](https://www.ruby-forum.com/t/loading-cgi-and-some-aother-questions/75618 "2006-11-11T15:57:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gambler\_Gluck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8491ac/32.png) [@Gambler\_Gluck](https://www.ruby-forum.com/u/Gambler_Gluck)\
**Post date:** [November 11, 2006, 3:57pm UTC](https://www.ruby-forum.com/t/loading-cgi-and-some-aother-questions/75618/1 "2006-11-11T15:57:32Z")

</div>

Hello.

I’m learning Ruby right now, and I have couple of questions about it.

1. What is the best way to store configs for ruby programs? Is there a  
way to include an rb file with data structure so that it is assigned to  
some variable in the including code? If there is such a way, would it be  
worse than using YAML serialization or better?

2. What is the most “universal” way to work with web environments? Will  
CGI work well if used under mod\_ruby or in other non-cgi environments?

---

<div class="post-metadata">

**Author:** ![Gambler\_Gluck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8491ac/32.png) [@Gambler\_Gluck](https://www.ruby-forum.com/u/Gambler_Gluck)\
**Post date:** [November 11, 2006, 4:05pm UTC](https://www.ruby-forum.com/t/loading-cgi-and-some-aother-questions/75618/2 "2006-11-11T16:05:33Z")

</div>

Gambler Gluck wrote:

> Hello.
> 
> I’m learning Ruby right now, and I have couple of questions about it.
> 
> 1. What is the best way to store configs for ruby programs? Is there a way to include an rb file with data structure so that it is assigned to some variable in the including code? If there is such a way, would it be worse than using YAML serialization or better?

The sourcing a .rb file is more flexible, however you risk code  
injection that way. Usual considerations apply.

David V.

---

<div class="post-metadata">

**Author:** ![Gambler\_Gluck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8491ac/32.png) [@Gambler\_Gluck](https://www.ruby-forum.com/u/Gambler_Gluck)\
**Post date:** [November 11, 2006, 6:00pm UTC](https://www.ruby-forum.com/t/loading-cgi-and-some-aother-questions/75618/3 "2006-11-11T18:00:04Z")

</div>

On Nov 11, 2006, at 8:57 AM, Gambler Gluck wrote:

> 1. What is the best way to store configs for ruby programs? Is  
> there a way to include an rb file with data structure so that it is  
> assigned to some variable in the including code? If there is such a  
> way, would it be worse than using YAML serialization or better?

I really believe YAML was made for configuration files. It’s my  
first choice, for sure.

James Edward G. II
