Hi,
i have a ruby script that should be controlled via
configfile, similar as a propertyfile or config.xml in java.
What’s the ruby equivalent for that ?
Gilbert
Hi,
i have a ruby script that should be controlled via
configfile, similar as a propertyfile or config.xml in java.
What’s the ruby equivalent for that ?
Gilbert
On 23/02/07, Rebhan, Gilbert [email protected] wrote:
Your best bet is probably YAML which is part of the standard library.
Farrel
Farrel L. wrote:
Your best bet is probably YAML which is part of the standard library.
Farrel
Or just a ruby file…
module Config
DATABASE = {:adapter => ‘foo’ …}
FROBNICATOR = :fozzbangle
LOCATION = :coozbain
end
On 2/23/07, Rebhan, Gilbert [email protected] wrote:
i have a ruby script that should be controlled via
configfile, similar as a propertyfile or config.xml in java.What’s the ruby equivalent for that ?
YAML is what you want, though parsing properties files into ruby
hashes is straightforward.
Even in java, XML files for configuration are overkill.
YAML is what you want, though parsing properties files into ruby
hashes is straightforward.
I wondered whether some features of Apache Jakarta Commons Configuration
format are available with YAML (or another Ruby gismo):
Two interesting features:
user.name = miles
first_file = /home/${user.name}/first
app_title = ${user.name}'s homepage
I think variable expansion is done on reference (“lazy”). YAML has
aliases, but can’t concatenate strings (which is OK, because YAML is for
object (de)serialization…).
Best,
Dov.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs