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?
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue