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

Reduce verbosity of #inspect #39

Closed
paulvt opened this issue Feb 21, 2013 · 3 comments
Closed

Reduce verbosity of #inspect #39

paulvt opened this issue Feb 21, 2013 · 3 comments

Comments

@paulvt
Copy link

paulvt commented Feb 21, 2013

Currently, Node#inspect is way too verbose. When playing/testing with Ox documents in IRB or using p to debug some program, Ox produces pages and pages of text.
This is mainly due to the expansion of @nodes, maybe #inspect could be changed to print something like:

doc = Ox.load('<foo bar="baz"><quux>meh</quux><garply/></foo>')
#=> #<Ox::Element:0x00000001bbcaa0  2 nodes, value: "foo", attributes: {:bar=>"baz"}>

IMO #inspect doesn't have to dump the entire object, as there already is Ox.dump and it is also easy enough to do doc.nodes.inspect if you really want to know.

@ohler55
Copy link
Owner

ohler55 commented Feb 21, 2013

I would rather not change the current behavior as it is useful at times. What I can do though is add an option that can be used to control how verbose the output is. What's you opinion of that alternative?

@ohler55
Copy link
Owner

ohler55 commented Feb 22, 2013

The current inspect() method is the default method provided by Ruby. I can still add an option for changing the output but it will take a bit more time.

@ohler55
Copy link
Owner

ohler55 commented Mar 10, 2013

No response for more than 2 weeks. Closing issue.

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

2 participants