Sha256: d4f4b6989ed74f070451dccced6ba4419a541875cb962c3d766d2246321150d7

Contents?: true

Size: 326 Bytes

Versions: 7

Compression:

Stored size: 326 Bytes

Contents

module Screen
  extend self

  def clear!
    print "\e[2J\e[f"
  end

  def hide_cursor
    print "\e[#{height};#{width}H"
  end

  def height
    `tput lines`.to_i
  end

  def suggest(x, y)
    y.times do |n|
      print "\n" if n.nonzero?
      print "\u2588" * x
    end
  end

  def width
    `tput cols`.to_i
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tp-0.6.2 lib/screen.rb
tp-0.6.2pre2 lib/screen.rb
tp-0.6.2pre1 lib/screen.rb
tp-0.6.1 lib/screen.rb
tp-0.6.0 lib/screen.rb
tp-0.5.1 lib/screen.rb
tp-0.5.0 lib/screen.rb