I have just released version 0.8.0 of xml-configfile, a library for an
easy handling of XML configuration files. It allows you to access
configuration parameters stored in an XML file by using XPath.
Changes since last release:
Handling of attributes is configurable now. They will be
expanded by get_parameters, if the user wants them to.
[] is an alias for method get_parameter now.
Method get_parameter_array was added by Nigel Ball.
Changed method names to Ruby style (using underscores instead
of CamelCase). The old method names still work, but will be
removed in the future.
‘ruby install.rb config’ prints a warning now, if REXML
is not installed (pre-config.rb was added).
You know, this could be used for a lot more than just config files.
It could probably be extended to store any object as long as it’s data
contains strings only.
For instance, in my tutorial I am working on an addressbook application.
We create an AddressBook class which, internally, is an an array whose
entries are Person classes. The Person class is a hash with entries such
as “name” and “phone”.
It would be great if I could save and load this entire class with
something as simple as:
On Sat, Feb 22, 2003 at 01:42:34AM +0900, Maik Schmidt wrote:
Yo!
I have just released version 0.8.0 of xml-configfile, a library for an
easy handling of XML configuration files. It allows you to access
configuration parameters stored in an XML file by using XPath.
Changes since last release:
Handling of attributes is configurable now. They will be
expanded by get_parameters, if the user wants them to.
is an alias for method get_parameter now.
Method get_parameter_array was added by Nigel Ball.
Changed method names to Ruby style (using underscores instead
of CamelCase). The old method names still work, but will be
removed in the future.
‘ruby install.rb config’ prints a warning now, if REXML
is not installed (pre-config.rb was added).
One of the most important points in my TODO file is “allow write
access”. But this will really turn class XmlConfigFile into something
bigger. There is a Perl module called XML::Simple that provides exactly
the functionality you are looking for and I am currently trying to port
it to Ruby. XmlConfigFile will simply use this new class then.
If you want to serialize objects, YAML4R makes it quick and easy…
···
On Sat, Feb 22, 2003 at 02:04:36AM +0900, Daniel Carrera wrote:
You know, this could be used for a lot more than just config files.
It could probably be extended to store any object as long as it’s data
contains strings only.
For instance, in my tutorial I am working on an addressbook application.
We create an AddressBook class which, internally, is an an array whose
entries are Person classes. The Person class is a hash with entries such
as “name” and “phone”.
It would be great if I could save and load this entire class with
something as simple as:
If the Yaml module can gain some maturity, I’d like to make a run for
submitting a Yaml module for the 1.8 list. I don’t know what Matz’
thoughts on this are, but I believe the extension list is rather open
to additions for 1.8. I’ve finished designing a streamlined version in C,
based on ideas from Marshal.
I see Ruby’s API for C as being ideal for serialization. When loading
an element from YAML, I merely need to recast the structure into a Ruby
object. This should be incredibly efficient.
And I am fortunate that Racc and Yacc are so similiar. Porting the
tokenizer is the bigger struggle. And putting behind recent health
problems.
Anyways, thanks for suggesting Yaml to new users. Yaml hasn’t enjoyed
nearly the embrace in other communities.
_why
···
Joel VanderWerf (vjoel@PATH.Berkeley.EDU) wrote:
Yaml should be in the standard lib, IMHO. It gives you the same
functionality, but the dumped data is quite human readable and editable.
Bummer about your health, hope you are doing better.
As a key user of YAML (in FreeRIDE) I just want to thank you for this
module…its quite awesome.
To have something that works from a single file (yaml.rb) instead of
lots-o-files (xml parsing, etc) is really quite great when it comes to
deploying applications. I highly recommend YAML to all that need to
store configuration data (or data exchange…which should get more
press!!!).
-rich
···
On Saturday, February 22, 2003, at 02:54 PM, why the lucky stiff wrote:
Joel VanderWerf (vjoel@PATH.Berkeley.EDU) wrote:
Yaml should be in the standard lib, IMHO. It gives you the same
functionality, but the dumped data is quite human readable and
editable.
If the Yaml module can gain some maturity, I’d like to make a run for
submitting a Yaml module for the 1.8 list. I don’t know what Matz’
thoughts on this are, but I believe the extension list is rather open
to additions for 1.8. I’ve finished designing a streamlined version
in C,
based on ideas from Marshal.
I see Ruby’s API for C as being ideal for serialization. When loading
an element from YAML, I merely need to recast the structure into a Ruby
object. This should be incredibly efficient.
And I am fortunate that Racc and Yacc are so similiar. Porting the
tokenizer is the bigger struggle. And putting behind recent health
problems.
Anyways, thanks for suggesting Yaml to new users. Yaml hasn’t enjoyed
nearly the embrace in other communities.
In message “YAML in std lib (was Re: [ANN] xml-configfile 0.8.0)” on 03/02/23, why the lucky stiff ruby-talk@whytheluckystiff.net writes:
If the Yaml module can gain some maturity, I’d like to make a run for
submitting a Yaml module for the 1.8 list. I don’t know what Matz’
thoughts on this are, but I believe the extension list is rather open
to additions for 1.8. I’ve finished designing a streamlined version in C,
based on ideas from Marshal.
We are open. When you feel you’re prepared, feel free to tell us. We
will grant you CVS account.