Options to Psych.dump are undocumented #52

Closed
Phrogz opened this Issue Mar 23, 2012 · 7 comments

Comments

6 participants

Phrogz commented Mar 23, 2012

http://stackoverflow.com/questions/9759302/documentation-for-psych-to-yaml-options

Are the functions in emitter.c the only options supported? Can documentation for these options be moved into the rb for dump so they're accessible? And then get any reasonably documented version described on ruby-doc.org?

Owner

tenderlove commented Mar 23, 2012

options is kind of overloaded, as it's also used when building the tree. If you send a documentation pull request, I'll be happy to apply it.

Unfortunately I have no control over the documentation posted on ruby-doc.org. :(

Member

zzak commented Oct 11, 2012

@tenderlove Should these be documented on psych/emitter.c?

Owner

tenderlove commented Oct 11, 2012

Well, emitter.c doesn't actually take hash parameters as options. You have to give it a configuration object.

If you do an ri Psych.dump the options do show up:

ri info

All of the options on Psych::Emitter should be documented as well. I'm closing this ticket since I have no control over the documentation available on ruby-doc.org, but any documentation patches would be gladly accepted!

tenderlove closed this Oct 11, 2012

@tenderlove that is not appropriate documentation for "options" as it only shows the indentation... What other options are there?

I'm really just looking for a way to output it with filled in variables (verbose if you will). I have a lot of reused information in my auto-generated yaml file, and seeing *1, *2, *3 means I have to dig through the rest of the file to know what i'm looking at.

Where are the options documented? They don't have to be on ruby-doc.org, but I'd like to know where they are.

dankohn commented Jun 29, 2017

See: https://stackoverflow.com/a/9759344/1935918

.to_yaml(line_width: 80) was particularly helpful for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment