# RProperties 0.0.1 Released

**URL:** <https://www.ruby-forum.com/t/rproperties-0-0-1-released/159384>\
**Category:** Ruby\
**Created:** [February 4, 2009, 2:43am UTC](https://www.ruby-forum.com/t/rproperties-0-0-1-released/159384 "2009-02-04T02:43:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![twgnunes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b3f665/32.png) [@twgnunes](https://www.ruby-forum.com/u/twgnunes)\
**Post date:** [February 4, 2009, 2:43am UTC](https://www.ruby-forum.com/t/rproperties-0-0-1-released/159384/1 "2009-02-04T02:43:17Z")

</div>

Hello everybody!  
The first release of RProperties is on the RubyForge now on  
[http://rubyforge.org/projects/rproperties/](http://rubyforge.org/projects/rproperties/) !  
RProperties is a simple (very simple) implementation of the Java  
Properties feature.  
In this first release i just put the VERY basic functionality but i´m  
working to do more things on it.

Just to exemplify a use of RProperties :

1. Imagine that you have a .properties file containing :  
site\_name = My Crazy Blog About Ruby  
site\_author = Barack Obama  
author\_email = removed\_email\_address@domain.invalid

2. Using RProperties :

require ‘r\_properties’  
rp = RProperties.new(“my\_file.properties”);  
rp.load\_p;  
puts “The name of my site is #{rp.get\_p(“site\_name”)}”

That´s All! I know that i have too much work to do and i hope that  
everybody help on it.

- tiago

---

<div class="post-metadata">

**Author:** ![twgnunes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b3f665/32.png) [@twgnunes](https://www.ruby-forum.com/u/twgnunes)\
**Post date:** [February 4, 2009, 1:21pm UTC](https://www.ruby-forum.com/t/rproperties-0-0-1-released/159384/2 "2009-02-04T13:21:59Z")

</div>

> Hello everybody!  
> The first release of RProperties is on the RubyForge now on  
> [http://rubyforge.org/projects/rproperties/](http://rubyforge.org/projects/rproperties/) !

Great! But I don’t really get the advantage of RProperties over built in  
yaml+hash for example (or yaml+struct, or… whatever):

store:

props = {:site\_name =\> “My Crazy Blog About Ruby”,  
:site\_author =\> “Barack Obama”,  
:author\_email =\> “removed\_email\_address@domain.invalid”}  
open(‘my\_props.yml’,‘w’) {|f| f.write props.to\_yaml}

load:

rp = YAML::load(open(‘my\_props.yml’))  
puts rp[:site\_name]  
puts rp[:site\_author]  
etc.

the yaml file almost looks like the java properties file:

* * *

:site\_name: " My Crazy Blog About Ruby"  
:site\_author: Barack Obama  
:author\_email: removed\_email\_address@domain.invalid

Peter

* * *

[http://www.rubyrailways.com](http://www.rubyrailways.com)  
[http://scrubyt.org](http://scrubyt.org)

---

<div class="post-metadata">

**Author:** ![twgnunes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b3f665/32.png) [@twgnunes](https://www.ruby-forum.com/u/twgnunes)\
**Post date:** [February 4, 2009, 1:43pm UTC](https://www.ruby-forum.com/t/rproperties-0-0-1-released/159384/3 "2009-02-04T13:43:12Z")

</div>

You are completly right Peter!

But my intention to make rproperties is to mantain the java way and ,  
with  
this, convence more java users  
here in brazil to migrate to ruby, and migrating , they will be  
completly  
free to use the ruby ways and discover this wonderfull language , that i  
prefer too! Peter , here in Brazil i am finding a hard resistence with  
the  
java users to migrate to Ruby. I guess that in a group of 100 developers  
here , 10 are tendencious to migrate to ruby,15 says that will take a  
look  
but always says : tomorrow , tomorrow i’ll see some and 75 just will  
change  
when ruby pays more that java.

- tiago

---

<div class="post-metadata">

**Author:** ![twgnunes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b3f665/32.png) [@twgnunes](https://www.ruby-forum.com/u/twgnunes)\
**Post date:** [February 4, 2009, 4:39pm UTC](https://www.ruby-forum.com/t/rproperties-0-0-1-released/159384/4 "2009-02-04T16:39:14Z")

</div>

Dominik,  
I just put the ideas on the air and i’m open to sugestions etc…  
This is the first release and i know that i have too much work to do and  
if  
somebody  
have other ideas please , lets talk!

- tiago

On Wed, 4 Feb 2009 23:33:21 +0900, Dominik H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![twgnunes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b3f665/32.png) [@twgnunes](https://www.ruby-forum.com/u/twgnunes)\
**Post date:** [February 4, 2009, 3:34pm UTC](https://www.ruby-forum.com/t/rproperties-0-0-1-released/159384/5 "2009-02-04T15:34:36Z")

</div>

> But my intention to make rproperties is to mantain the java way and , with  
> this, convence more java users  
> here in brazil to migrate to ruby, and migrating , they will be completly  
> free to use the ruby ways and discover this wonderfull language , that i  
> prefer too!

I doubt that people coming from Java will discover the beauty of Ruby  
if they are able to use things like RProperties. And in my opinion,  
something like #get\_p(…) is not Ruby-like at all.

The proper way would be to actually show them how it is done in Ruby’s  
way.

> site\_name = My Crazy Blog About Ruby  
> site\_author = Barack Obama  
> author\_email = removed\_email\_address@domain.invalid

By simply adding “” around the values, you could even use this kind of  
format with, e.g., instance\_eval and provide an interface like the  
following:

Properties.site\_name

to get the value of site\_name, which is way nicer than  
get\_p(‘site\_name’)

---

<div class="post-metadata">

**Author:** ![twgnunes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b3f665/32.png) [@twgnunes](https://www.ruby-forum.com/u/twgnunes)\
**Post date:** [February 4, 2009, 4:45pm UTC](https://www.ruby-forum.com/t/rproperties-0-0-1-released/159384/6 "2009-02-04T16:45:08Z")

</div>

Dominik, you said:  
“…  
By simply adding “” around the values, you could even use this kind of  
format with, e.g., instance\_eval and provide an interface like the  
following: Properties.site\_name to get the value of site\_name, which is  
way  
nicer than get\_p(‘site\_name’)  
…”

And i was think thats can be a good way.

- tiago
