class Convoy::Formatter::Terminal

Constants

DEFAULT_WIDTH

Public Class Methods

width() click to toggle source
# File lib/convoy/formatter/terminal.rb, line 7
def width
    tput_width
end

Private Class Methods

tput_cols_command_error_callback() click to toggle source
# File lib/convoy/formatter/terminal.rb, line 21
def tput_cols_command_error_callback
    lambda do |command, e|
        error_logger.debug { e }
        error_logger.info { "Unable to find terminal width via '#{command}', using default of #{DEFAULT_WIDTH}" }
    end
end
tput_cols_command_success_callback() click to toggle source
# File lib/convoy/formatter/terminal.rb, line 17
def tput_cols_command_success_callback
    lambda { |command, result| result.to_i }
end
tput_width() click to toggle source
# File lib/convoy/formatter/terminal.rb, line 13
def tput_width
    ShellCommandExecutor.new('/usr/bin/env tput cols').execute_in_current_shell(tput_cols_command_success_callback, tput_cols_command_error_callback) || DEFAULT_WIDTH
end