Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example code for YAMLTree is broken for Ruby 2.5+ #84

Open
movermeyer opened this issue Jan 8, 2019 · 0 comments
Open

Example code for YAMLTree is broken for Ruby 2.5+ #84

movermeyer opened this issue Jan 8, 2019 · 0 comments

Comments

@movermeyer
Copy link

What is the problem?

On this page, It shows the following example code:

builder = Psych::Visitors::YAMLTree.new
builder << { :foo => 'bar' }
builder.tree # => #<Psych::Nodes::Stream .. }

This seems to work up until 2.4.0. In 2.5.0+, it seems that the optional parameters for new became mandatory:

pry(main)> builder = Psych::Visitors::YAMLTree.new
ArgumentError: wrong number of arguments (given 0, expected 3)

What was the expected behaviour?

I expected that the sample code on a docs page should be valid for the particular version of Ruby I'm looking at.

If you have an idea for a potential fix, list it here

IDK

@movermeyer movermeyer changed the title Example code for YAMLTree#new is broken fro 2.5+ Example code for YAMLTree#new is broken for 2.5+ Jan 8, 2019
@movermeyer movermeyer changed the title Example code for YAMLTree#new is broken for 2.5+ Example code for YAMLTree#new is broken for Ruby 2.5+ Jan 8, 2019
@movermeyer movermeyer changed the title Example code for YAMLTree#new is broken for Ruby 2.5+ Example code for YAMLTree is broken for Ruby 2.5+ Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant