Method: Interactive#initialize

Defined in:
lib/interactive.rb

#initializeInteractive



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/interactive.rb', line 15

def initialize
  @term_width = `/usr/bin/env tput cols`.to_i
  @formatter = TaskFormatter.new

  if @term_width < @formatter.max_width
    message = " Your terminal must be at least #{@formatter.max_width} columns wide "
    STDERR.puts('<' + message.
                  rjust(@formatter.max_width + 1 - message.length / 2, '-').
                  ljust(@formatter.max_width - 2, '-') + '>')
    exit(1)
  end
end