class SmoothTerminalPrint

Public Class Methods

new() click to toggle source
# File lib/smooth_terminal_print.rb, line 7
def initialize
        update_screen_dimensions

        trap('SIGINT')   { stop_smooth_printing_mode; exit }
        trap('SIGWINCH') { update_screen_dimensions }
        at_exit          { stop_smooth_printing_mode }
end

Public Instance Methods

print_smoothly(io=nil) { || ... } click to toggle source
stop_smooth_printing_mode() click to toggle source
# File lib/smooth_terminal_print.rb, line 31
def stop_smooth_printing_mode
        print(move_to_bottom)
        print(show_cursor)
end

Private Instance Methods

print_text(io) click to toggle source
update_screen_dimensions() click to toggle source
# File lib/smooth_terminal_print.rb, line 37
def update_screen_dimensions
        @num_lines = `tput lines`.strip.to_i - 2
        @columns   = `tput cols`.strip.to_i - 5
end