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.
On 3 September 2013 13:15, Marc Heiler <lists@ruby-forum.com> wrote:
Hi,
Are there alternatives to yaml files?
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.
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:
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
···
On Sep 3, 2013, at 8:31 AM, Peter Hickman wrote:
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 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.
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?"
···
Am 03.09.2013 um 15:34 schrieb Wayne Brissette <wbrisett@att.net>:
On Sep 3, 2013, at 8:31 AM, Peter Hickman wrote:
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.