Is there a library class for handling common property files that have
the key=value syntax? Basically all I need to do is read some
properties from a properties file, perform succ! on some of them, and
write the property file back to disk. There were a couple of threads
about properties files earlier in December that mentioned use of
Config.rb but I’m having trouble finding documentation for this library,
if it is one. I’m using Ruby 1.8.0.
Is there a library class for handling common property files that have
the key=value syntax? Basically all I need to do is read some
properties from a properties file, perform succ! on some of them, and
write the property file back to disk. There were a couple of threads
about properties files earlier in December that mentioned use of
Config.rb but I’m having trouble finding documentation for this library,
if it is one. I’m using Ruby 1.8.0.
I made a posting some time ago, maybe that helps. The class can work with
nested names “foo.bar.baz=‘hello’”:
“Andre Nathan” andre@digirati.com.br schrieb im Newsbeitrag
news:1072439266.2265.4.camel@drake.mz.digirati.com.br…
def method_missing(sym,*args)
s = sym.to_s.freeze
Is there a need to freeze s here?
unfrozen Strings are dup’ed when put into a hash. That’s why I put the
freeze there. But the freeze should be done later, when it’s clear whether
it’s a setter or a getter.