RProperties 0.0.1 Released

T

Tiago Nogueira

Hello everybody!
The first release of RProperties is on the RubyForge now on
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 = (e-mail address removed)

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
 
P

peter

Hello everybody!
The first release of RProperties is on the RubyForge now on
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 => "(e-mail address removed)"}
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: (e-mail address removed)

Peter
___
http://www.rubyrailways.com
http://scrubyt.org
 
T

tjnogueira

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



Hello everybody!
The first release of RProperties is on the RubyForge now on
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 => "(e-mail address removed)"}
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: (e-mail address removed)

Peter
___
http://www.rubyrailways.com
http://scrubyt.org
 
T

tjnogueira

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
 
T

tjnogueira

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,968
Members
47,517
Latest member
TashaLzw39

Latest Threads

Top