1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Changed :limited to :limit, happy @injekt? ;)

This commit is contained in:
Andrew Horsman 2011-05-31 15:11:21 -04:00
parent a615d44d4f
commit 5877eee4fd
3 changed files with 6 additions and 6 deletions

View file

@ -26,7 +26,7 @@ Default options:
:multiline => true, # Display in multiple lines.
:plain => false, # Use colors.
:sort_keys => false, # Do not sort hash keys.
:limited => false, # Limit large output. Set to a boolean or integer.
:limit => false, # Limit large output. Set to a boolean or integer.
:color => {
:array => :white,
:bignum => :blue,
@ -141,7 +141,7 @@ Supported color names:
$ cat 7.rb
require "awesome_print"
some_array = (1..1000).to_a
ap some_array, :limited => true
ap some_array, :limit => true
^D
$ ruby 7.rb
[
@ -157,7 +157,7 @@ Supported color names:
$ cat 8.rb
require "awesome_print"
some_array = (1..1000).to_a
ap some_array, :limited => 5
ap some_array, :limit => 5
^D
$ ruby 8.rb
[

View file

@ -298,11 +298,11 @@ module AwesomePrint
# To support limited output.
#------------------------------------------------------------------------------
def should_be_limited?
@options[:limited] or (@options[:limited].class == Fixnum and @options[:limited] > 0)
@options[:limit] or (@options[:limit].class == Fixnum and @options[:limit] > 0)
end
def get_limit_size
return @options[:limited] if @options[:limited].class == Fixnum
return @options[:limit] if @options[:limit].class == Fixnum
return AwesomePrint::Inspector::DEFAULT_LIMIT_SIZE
end

View file

@ -23,7 +23,7 @@ module AwesomePrint
:multiline => true, # Display in multiple lines.
:plain => false, # Use colors.
:sort_keys => false, # Do not sort hash keys.
:limited => false, # Limit large output. Set to a boolean or integer.
:limit => false, # Limit large output. Set to a boolean or integer.
:color => {
:array => :white,
:bigdecimal => :blue,