Class: Mutest::Reporter::CLI Private

Inherits:
Mutest::Reporter show all
Defined in:
lib/mutest/reporter/cli.rb,
lib/mutest/reporter/cli/tput.rb,
lib/mutest/reporter/cli/format.rb,
lib/mutest/reporter/cli/printer.rb,
lib/mutest/reporter/cli/printer/config.rb,
lib/mutest/reporter/cli/printer/status.rb,
lib/mutest/reporter/cli/printer/env_result.rb,
lib/mutest/reporter/cli/printer/test_result.rb,
lib/mutest/reporter/cli/printer/env_progress.rb,
lib/mutest/reporter/cli/printer/subject_result.rb,
lib/mutest/reporter/cli/printer/mutation_result.rb,
lib/mutest/reporter/cli/printer/subject_progress.rb,
lib/mutest/reporter/cli/printer/status_progressive.rb,
lib/mutest/reporter/cli/printer/mutation_progress_result.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.

Reporter that reports in human readable format

Defined Under Namespace

Classes: Format, Printer, Tput

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(output) ⇒ Reporter::CLI

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.

Build reporter

Parameters:

  • output (IO)

Returns:



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/mutest/reporter/cli.rb', line 12

def self.build(output)
  tput = Tput.detect
  tty = output.respond_to?(:tty?) && output.tty?
  format =
    if !Mutest.ci? && tty && tput
      Format::Framed.new(tty:  tty, tput: tput)
    else
      Format::Progressive.new(tty: tty)
    end
  new(output, format)
end

Instance Method Details

#delayFloat

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.

Report delay in seconds

TODO: Move this to a callback registration

Returns:

  • (Float)


49
50
51
# File 'lib/mutest/reporter/cli.rb', line 49

def delay
  format.delay
end

#progress(status) ⇒ self

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.

Report progress object

Parameters:

Returns:

  • (self)


39
40
41
42
# File 'lib/mutest/reporter/cli.rb', line 39

def progress(status)
  write(format.progress(status))
  self
end

#report(env) ⇒ self

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.

Report env

Parameters:

Returns:

  • (self)


68
69
70
71
# File 'lib/mutest/reporter/cli.rb', line 68

def report(env)
  Printer::EnvResult.call(output, env)
  self
end

#start(env) ⇒ self

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.

Report start

Parameters:

Returns:

  • (self)


29
30
31
32
# File 'lib/mutest/reporter/cli.rb', line 29

def start(env)
  write(format.start(env))
  self
end

#warn(message) ⇒ self

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.

Report warning

Parameters:

  • message (String)

Returns:

  • (self)


58
59
60
61
# File 'lib/mutest/reporter/cli.rb', line 58

def warn(message)
  output.puts(message)
  self
end