1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

More compatibility changes for Pry::Output

If it quacks like a duck, it should waddle like a duck too.
This commit is contained in:
Conrad Irwin 2014-05-05 23:19:15 -07:00
parent 68ad901a3a
commit 8cf350436e

View file

@ -10,16 +10,22 @@ class Pry
return print "\n" if objs.empty?
objs.each do |obj|
if obj.is_a?(Array)
puts(*obj)
if ary = Array.try_convert(obj)
puts(*ary)
else
print "#{obj.to_s.chomp}\n"
end
end
nil
end
def print(str)
_pry_.config.output.print decolorize_maybe(str)
def print(*objs)
objs.each do |obj|
_pry_.config.output.print decolorize_maybe(obj.to_s)
end
nil
end
alias << print
alias write print