Ticket #19 (new defect)

Opened 2 years ago

Last modified 12 months ago

The options hash to to_yaml doesn't seem to have effect.

Reported by: ola@… Owned by: somebody
Priority: major Milestone:
Component: component1 Version:
Keywords: options, to_yaml Cc:

Description

From the yaml4 document, this code:

puts [[ 'Crispin', 'Glover' ]].to_yaml( :Indent => 4, :UseHeader => true, :UseVersion => true )

should result in this output:

--- %YAML:1.0
-
    - Crispin
    - Glover

but what I get in "ruby 1.8.4 (2005-12-24) [i386-mswin32]"

is this:

--- 
- - Crispin
  - Glover

The to_yaml call seems to totally ignore the options specified.

Change History

in reply to: ↑ description   Changed 12 months ago by agnewtj

  • priority changed from minor to major

There is a good post that diagnoses the problem here: http://www.arkanis-development.de/weblog/2007/6/20/options-for-rubys-%40to_yaml%40-method

Replying to ola@ologix.se:

From the yaml4 document, this code: {{{ puts [[ 'Crispin', 'Glover' ]].to_yaml( :Indent => 4, :UseHeader? => true, :UseVersion? => true ) }}} should result in this output: {{{ --- %YAML:1.0 - - Crispin - Glover }}} but what I get in "ruby 1.8.4 (2005-12-24) [i386-mswin32]" is this: {{{ --- - - Crispin - Glover }}} The to_yaml call seems to totally ignore the options specified.

Note: See TracTickets for help on using tickets.