Class: Mutest::Reporter::CLI::Tput Private

Inherits:
Object
  • Object
show all
Includes:
Adamantium
Defined in:
lib/mutest/reporter/cli/tput.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Interface to the optionally present tput binary

Class Method Summary collapse

Class Method Details

.detectTput?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Detected tput support

Returns:

  • (Tput)

    if tput support is present

  • (nil)

    otherwise



17
18
19
20
21
22
23
# File 'lib/mutest/reporter/cli/tput.rb', line 17

def self.detect
  reset   = capture('tput reset')
  save    = capture('tput sc') if reset
  restore = capture('tput rc') if save
  clean   = capture('tput ed') || capture('tput cd') if restore
  new(reset + save, restore + clean) if clean
end