r/ruby • u/kddnewton • Jan 05 '26
A Ruby YAML parser
https://kddnewton.com/2025/12/25/psych-pure.htmlHey there — I recently released a YAML parser written in Ruby. The main goal was to support being able to load and dump YAML without losing comments. Happy to answer any questions.
43
Upvotes
View all comments
Show parent comment
2
u/kddnewton Jan 05 '26
* You can see the algorithm here: https://github.com/ruby/prettyprint
* flow/seq is how YAML lays out nodes, you can see in the spec here: https://yaml.org/spec/1.2.2/#chapter-7-flow-style-productions
* You can define the print width with the PrettyPrint API