why does psych yaml interpreter add line breaks around 80 characters?

前端 未结 3 1614

Psych is the default yaml engine since ruby 1.9.3

Why, oh why does psych add a line break in its output? Check the example below.

ruby -v # => ruby 1.         


        
3条回答
  •  别跟我提以往
    2021-02-07 13:28

    You'll have to configure psych’s #to_yaml options. You'll most likely find it here:

    ruby-1.9.3-p125/ext/psych/emitter.c
    

    And then you can do something like this:

    yaml.to_yaml(options = {:line_width => -1})
    

提交回复
热议问题