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:
parent
68ad901a3a
commit
8cf350436e
1 changed files with 10 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue