Specifically configuration formats that do not coerce the user into a
specific encoding format.
I need mostly:
key: value pairs
although the ability to load arrays directly into a .rb file would be
cool too.
Reason: I can no longer use yaml files in ruby 2.0 if they are not in
UTF. As I do not use UTF and never will, yet syck has been removed, I
need another way to load my configuration settings (I use several
hundred yaml files). Without that I would be forced to not use my
configuration settings (which is currently in yaml) so upgrading my ruby
version gives me only drawbacks and extra work and no benefit.
My current ruby in use is ruby 1.9.3p448 (2013-06-27 revision 41675)
[i686-linux]
The desire not to use UTF-8 seems to be a religious issue given the the OP has
not given any reason or described a problem that they are having with YAML
I’m wondering about that as well. UTF-8 imposes no penalty if you want
to restrict yourself to the basic ASCII character set. Seems like an odd
avoidance given the lack of any real penalty.
If the configuration settings are data structures in the Ruby program
then
you can convert them to and from JSON. The fact that they are encoded
with
UTF-8 is transparent and pretty irrelevant unless the data is in some
esoteric format (but then how would Ruby handle this anyway?).
The desire not to use UTF-8 seems to be a religious issue given the the
OP
has not given any reason or described a problem that they are having
with
YAML. If they are prepared to convert their current settings files from
YAML to some other, as yet unspecified, format they could just as easily
just convert the data to UTF-8 and be done with it.
The desire not to use UTF-8 seems to be a religious issue given the the OP has
not given any reason or described a problem that they are having with YAML
I’m wondering about that as well. UTF-8 imposes no penalty if you want to
restrict yourself to the basic ASCII character set. Seems like an odd avoidance
given the lack of any real penalty.
Wayne
Also, YAML is a unicode based format as well and handling other things
is a SYCK implementation detail. So, the true quesition is: “moving away
from SYCK, where to?”
although the ability to load arrays directly into a .rb file would be
cool too.
You could try to make CSV work for you.
Or just inspect/pp + eval if you want to live dangerously.
Reason: I can no longer use yaml files in ruby 2.0 if they are not in
UTF. As I do not use UTF and never will, yet syck has been removed, I
need another way to load my configuration settings (I use several
hundred yaml files). Without that I would be forced to not use my
configuration settings (which is currently in yaml) so upgrading my ruby
version gives me only drawbacks and extra work and no benefit.
YAML can store binary, too. It isn’t pretty, but you can continue
using whatever encoding you want: