相关疑难解决方法(0)

为什么psych yaml interpreter会在80个字符左右添加换行符?

自从ruby 1.9.3以来,Psych是默认的yaml引擎

为什么,为什么心理在其输出中添加换行符?请查看以下示例.

ruby -v # => ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-linux]
require 'yaml'

"this absolutely normal sentence is more than eighty characters long because it IS".to_yaml
# => "--- this absolutely normal sentence is more than eighty characters long because it\n    IS\n...\n"

YAML::ENGINE.yamler = 'syck'

"this absolutely normal sentence is more than eighty characters long because it IS".to_yaml
# => "--- this absolutely normal sentence is more than eighty characters long because it IS\n"
Run Code Online (Sandbox Code Playgroud)

ruby yaml syck psych

13
推荐指数
2
解决办法
1990
查看次数

标签 统计

psych ×1

ruby ×1

syck ×1

yaml ×1