[macruby-changes] [MacRuby/MacRuby] 29a5e8: String#to_yaml returns the string of yaml with lit...

noreply at github.com noreply at github.com
Mon Aug 15 20:19:02 PDT 2011


  Branch: refs/heads/master
  Home:   https://github.com/MacRuby/MacRuby

  Commit: 29a5e837c1bb422d6d829827018162b27d30c271
      https://github.com/MacRuby/MacRuby/commit/29a5e837c1bb422d6d829827018162b27d30c271
  Author: Watson <watson1978 at gmail.com>
  Date:   2011-08-15 (Mon, 15 Aug 2011)

  Changed paths:
    M ext/libyaml/rubyext.c
  M lib/yaml/rubytypes.rb

  Log Message:
  -----------
  String#to_yaml returns the string of yaml with literal style when includes the newlines.

Test Script:
{{{
require 'yaml'
require 'test/unit/assertions.rb'
include Test::Unit::Assertions

str = "hoge\nfoo"
def str.to_yaml_style
end

yaml = str.to_yaml
assert_match(/^--- \|-\n/, yaml)

puts :ok
}}}


  Commit: 54e77a51e1ee0a9839bb6571b22dec85011181c3
      https://github.com/MacRuby/MacRuby/commit/54e77a51e1ee0a9839bb6571b22dec85011181c3
  Author: Watson <watson1978 at gmail.com>
  Date:   2011-08-15 (Mon, 15 Aug 2011)

  Changed paths:
    M ext/libyaml/emitter.c

  Log Message:
  -----------
  Indentation is not required with literal and fold style.

Test Script:
{{{
require 'yaml'
require 'test/unit/assertions.rb'
include Test::Unit::Assertions

str = "hoge\nfoo"
yaml = str.to_yaml
assert_equal("--- |-\nhoge\nfoo\n", yaml)

str = "hoge\nfoo"
def str.to_yaml_style
  :fold
end
yaml = str.to_yaml
assert_equal("--- >-\nhoge\n\nfoo\n", yaml)

puts :ok
}}}


Compare: https://github.com/MacRuby/MacRuby/compare/ecde1c7...54e77a5


More information about the macruby-changes mailing list