Documentation for Psych to_yaml options?

前端 未结 2 1173
广开言路
广开言路 2021-01-01 11:10

Ruby 1.9.3 defaults to using Psych for YAML. While the ruby-doc documentation for it is completely lacking, I was able to find one external piece of documentation

相关标签:
2条回答
  • 2021-01-01 11:25

    Deep in the guts of ruby-1.9.3-p125/ext/psych/emitter.c I found three options:

    • indentation - The level must be less than 10 and greater than 1.
    • line_width - Set the preferred line width.
    • canonical - Set the output style to canonical, or not (true/false).

    And they work!

    0 讨论(0)
  • 2021-01-01 11:40

    When you want to disable line wrap, use this option:

    line_width: -1
    
    0 讨论(0)
提交回复
热议问题