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? return print "\n" if objs.empty?
objs.each do |obj| objs.each do |obj|
if obj.is_a?(Array) if ary = Array.try_convert(obj)
puts(*obj) puts(*ary)
else else
print "#{obj.to_s.chomp}\n" print "#{obj.to_s.chomp}\n"
end end
end end
nil
end end
def print(str) def print(*objs)
_pry_.config.output.print decolorize_maybe(str) objs.each do |obj|
_pry_.config.output.print decolorize_maybe(obj.to_s)
end
nil
end end
alias << print alias << print
alias write print alias write print