class Pry::Output
Attributes
_pry_[R]
Public Class Methods
new(_pry_)
click to toggle source
# File lib/pry/output.rb, line 4 def initialize(_pry_) @_pry_ = _pry_ @boxed_io = _pry_.config.output end
Public Instance Methods
decolorize_maybe(str)
click to toggle source
# File lib/pry/output.rb, line 43 def decolorize_maybe(str) if _pry_.config.color str else Pry::Helpers::Text.strip_color str end end
method_missing(name, *args, &block)
click to toggle source
# File lib/pry/output.rb, line 35 def method_missing(name, *args, &block) @boxed_io.__send__(name, *args, &block) end
print(*objs)
click to toggle source
# File lib/pry/output.rb, line 22 def print(*objs) objs.each do |obj| @boxed_io.print decolorize_maybe(obj.to_s) end nil end
puts(*objs)
click to toggle source
# File lib/pry/output.rb, line 9 def puts(*objs) return print "\n" if objs.empty? objs.each do |obj| if (ary = Array.try_convert(obj)) puts(*ary) else print "#{obj.to_s.chomp}\n" end end nil end
respond_to_missing?(m, include_all = false)
click to toggle source
# File lib/pry/output.rb, line 39 def respond_to_missing?(m, include_all = false) @boxed_io.respond_to?(m, include_all) end
tty?()
click to toggle source
# File lib/pry/output.rb, line 31 def tty? @boxed_io.respond_to?(:tty?) and @boxed_io.tty? end