Sha256: 2fe6987c1e5b5f4f4f02a450dc9cfbf2de36107d1bd2b23c04fd441ed29e9122

Contents?: true

Size: 884 Bytes

Versions: 20

Compression:

Stored size: 884 Bytes

Contents

class Pry::Output
  attr_reader :_pry_

  def initialize(_pry_)
    @_pry_ = _pry_
    @boxed_io = _pry_.config.output
  end

  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

  def print(*objs)
    objs.each do |obj|
      @boxed_io.print decolorize_maybe(obj.to_s)
    end
    nil
  end
  alias << print
  alias write print

  def tty?
    @boxed_io.respond_to?(:tty?) and @boxed_io.tty?
  end

  def method_missing(name, *args, &block)
    @boxed_io.__send__(name, *args, &block)
  end

  def respond_to_missing?(m, include_all=false)
    @boxed_io.respond_to?(m, include_all)
  end

  def decolorize_maybe(str)
    if _pry_.config.color
      str
    else
      Pry::Helpers::Text.strip_color str
    end
  end
end

Version data entries

20 entries across 20 versions & 8 rubygems

Version Path
dadapush_client-1.0.1 vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/output.rb
xaiml-0.1.3 vendor/bundle/ruby/2.5.0/gems/pry-0.11.3/lib/pry/output.rb
xaiml-0.1.2 vendor/bundle/ruby/2.5.0/gems/pry-0.11.3/lib/pry/output.rb
xaiml-0.1.1 vendor/bundle/ruby/2.5.0/gems/pry-0.11.3/lib/pry/output.rb
xaiml-0.1.0 vendor/bundle/ruby/2.5.0/gems/pry-0.11.3/lib/pry/output.rb
monero_wallet_gen-0.1.0 vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/output.rb
sb_prime_table-0.1.1 vendor/bundle/ruby/2.4.0/gems/pry-0.11.3/lib/pry/output.rb
sb_prime_table-0.1.0 vendor/bundle/ruby/2.4.0/gems/pry-0.11.3/lib/pry/output.rb
comiditaULL-0.1.1 vendor/bundle/ruby/2.3.0/gems/pry-0.11.2/lib/pry/output.rb
comidita_ull-0.1.1 vendor/bundle/ruby/2.3.0/gems/pry-0.11.2/lib/pry/output.rb
comidita_ull-0.1.0 vendor/bundle/ruby/2.3.0/gems/pry-0.11.2/lib/pry/output.rb
pry-0.11.3 lib/pry/output.rb
pry-0.11.3-java lib/pry/output.rb
pry-0.11.2 lib/pry/output.rb
pry-0.11.2-java lib/pry/output.rb
tdiary-5.0.6 vendor/bundle/gems/pry-0.11.0/lib/pry/output.rb
pry-0.11.1 lib/pry/output.rb
pry-0.11.1-java lib/pry/output.rb
pry-0.11.0 lib/pry/output.rb
pry-0.11.0-java lib/pry/output.rb