module Ripl::Rocket

Constants

COLORS
TPUT
VERSION

Public Class Methods

get_height(data) click to toggle source
# File lib/ripl/rocket.rb, line 40
def get_height(data)
  lines      = data.to_s.count("\n")
  long_lines = data.to_s.split("\n").inject(0){ |sum, line|
    sum + (line.display_size / `tput cols`.to_i)
  }
  lines + long_lines
end
output_height() click to toggle source
# File lib/ripl/rocket.rb, line 53
def output_height
  1 + ( @height_counter == [0] ? 0 : @height_counter.reduce(:+) || 0 )
end
reset_output_height() click to toggle source
# File lib/ripl/rocket.rb, line 36
def reset_output_height
  @height_counter = []
end
track_output_height(data) click to toggle source
# File lib/ripl/rocket.rb, line 48
def track_output_height(data)
  @height_counter ||= []
  @height_counter << get_height(data)
end