Class: Mutant::Reporter::CLI::Tput Private

Inherits:
Object
  • Object
show all
Includes:
Adamantium
Defined in:
lib/mutant/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



19
20
21
22
23
24
25
# File 'lib/mutant/reporter/cli/tput.rb', line 19

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