From 8cf350436e62e2d7e49180d94b9d4ca21da717f6 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Mon, 5 May 2014 23:19:15 -0700 Subject: [PATCH] More compatibility changes for Pry::Output If it quacks like a duck, it should waddle like a duck too. --- lib/pry/output.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/pry/output.rb b/lib/pry/output.rb index f8d382cf..b5f6bb3e 100644 --- a/lib/pry/output.rb +++ b/lib/pry/output.rb @@ -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