logo       
Bookmark and Share

Re: [Q] questions about Syck: msg#00004

text.yaml.general

Subject: Re: [Q] questions about Syck

Makoto Kuwata wrote:

Q1.
How to add original data type and data pattern?
For example:
- to get 'on'/'off' to be parsed as true/false.
- to get '/^[A-Z]+$/' to be parsed as regular expression.

These are called 'implicit' types. Libsyck supports them. See lib/implicit.re for details.

If you are writing a Syck extension, you can add implicits in your node handler for your parser.

There is no API for adding these types through Ruby, Python, PHP, etc.

Q2.
Ruby 1.8.3 has just released.
Which version of Syck is included in Ruby 1.8.3 and 1.8.2?
What changes are there between them?

Ruby 1.8.2 has Syck 0.45. Ruby 1.8.3 has Syck 0.60. Many, many, many changes.

See CHANGELOG. <http://rubyforge.org/cgi-bin/viewcvs.cgi/syck/CHANGELOG?rev=1.15&cvsroot=syck&content-type=text/vnd.viewcvs-markup>

Q3.
The following options are defined in 'yaml/constants.rb':
:Indent => 2, :UseHeader => false, :UseVersion => false, :Version => '1.0',
:SortKeys => false, :AnchorFormat => 'id%03d', :ExplicitTypes => false,
:WidthType => 'absolute', :BestWidth => 80,
:UseBlock => false, :UseFold => false, :Encoding => :None
These options are intended to be used witch Object#to_yaml(),
YAML::Stream.new(), and YAML::Store.new().
But all except :Indent, :SortKeys, :ExplicitTypes and :UseBlock are not
available when I tried on Ruby 1.8.2.
What options are available in Ruby 1.8.2 and 1.8.3?

Most of these constants are now singleton methods in Ruby. I need to update documentation and remove the constants from yaml/constants.rb.

Q4.
Object#to_yaml or YAML.dump() always prints document separator '---'.
Is there a way to suppress document separator?
There were ':Separator otpion' in the YAML4r document, but it is not
found in Syck.

1.8.2 defaulted to doc separator. 1.8.3 defaults to headless (no doc sep.) Unfortunately, I am totally stupid and forgot to add this to my TODO for 1.8.3. I hope this will be in 1.8.3.1. And definitely in 1.8.4.

Could you give me any advice?

Never wear two haircuts at the same time. Thankyou.

_why


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise