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

Replaced ap(object, options = {}) with ap(object, *options)

This commit is contained in:
Michael Dvorkin 2013-11-05 11:24:32 -08:00
parent f49bfd024c
commit e843081fed
2 changed files with 7 additions and 7 deletions

View file

@ -5,10 +5,10 @@
#------------------------------------------------------------------------------
module Kernel
def ai(options = {})
ap = AwesomePrint::Inspector.new(options)
def ai(*options)
ap = AwesomePrint::Inspector.new(*options)
awesome = ap.awesome self
if options[:html]
if ap.options[:html]
awesome = "<pre>#{awesome}</pre>"
awesome = awesome.html_safe if defined? ActiveSupport
end
@ -16,8 +16,8 @@ module Kernel
end
alias :awesome_inspect :ai
def ap(object, options = {})
puts object.ai(options)
def ap(object, *options)
puts object.ai(*options)
object unless AwesomePrint.console?
end
alias :awesome_print :ap

View file

@ -52,7 +52,7 @@ module AwesomePrint
AP = :__awesome_print__
def initialize(options = {})
def initialize(*options)
@options = {
:indent => 4, # Indent using 4 spaces.
:index => true, # Display array indices.
@ -87,7 +87,7 @@ module AwesomePrint
# Merge custom defaults and let explicit options parameter override them.
merge_custom_defaults!
merge_options!(options)
merge_options!(hashify(options))
@formatter = AwesomePrint::Formatter.new(self)
Thread.current[AP] ||= []