Closed manur closed 12 years ago
We already had a discussion on this:
https://github.com/michaeldv/awesome_print/issues/32 https://github.com/michaeldv/awesome_print/commit/05726bfd9137e5802b474628473894a047142ffb
See README on how to integrate ap with irb so you won't need >> ap object
Michael
Thanks for the pointer @michaeldv. I did look through README.md, but I wasn't able to find an option to limit output by default. The only thing that seemed plausible is 'limit', but that didn't do it. Could you point me to what you were referring to?
:indent => 4, # Indent using 4 spaces.
:index => true, # Display array indices.
:html => false, # Use ANSI color codes rather than HTML.
:multiline => true, # Display in multiple lines.
:plain => false, # Use colors.
:sort_keys => false, # Do not sort hash keys.
:limit => false, # Limit large output for arrays and hashes. Set to a boolean or integer.
:color => {
:args => :pale,
:array => :white,
:bigdecimal => :blue,
:class => :yellow,
:date => :greenish,
:falseclass => :red,
:fixnum => :blue,
:float => :blue,
:hash => :pale,
:keyword => :cyan,
:method => :purpleish,
:nilclass => :red,
:string => :yellowish,
:struct => :pale,
:symbol => :cyanish,
:time => :greenish,
:trueclass => :green,
:variable => :cyanish
}
I love ap!
But, everytime I use it on a large object, I have to hack it to not return the object itself like so:
This commit swaps the convention of Kernel#ap to not return the object itself, in a way that's consistent with puts.
Bumped the version number by a minor release to differentiate from the earlier convention.