Class: Mutant::Reporter::CLI Private

Inherits:
Mutant::Reporter show all
Defined in:
lib/mutant/reporter/cli.rb,
lib/mutant/reporter/cli/format.rb,
lib/mutant/reporter/cli/printer.rb,
lib/mutant/reporter/cli/printer/env.rb,
lib/mutant/reporter/cli/printer/test.rb,
lib/mutant/reporter/cli/progress_bar.rb,
lib/mutant/reporter/cli/printer/config.rb,
lib/mutant/reporter/cli/printer/mutation.rb,
lib/mutant/reporter/cli/printer/env_result.rb,
lib/mutant/reporter/cli/printer/env_progress.rb,
lib/mutant/reporter/cli/printer/subject_result.rb,
lib/mutant/reporter/cli/printer/coverage_result.rb,
lib/mutant/reporter/cli/printer/mutation_result.rb,
lib/mutant/reporter/cli/printer/isolation_result.rb,
lib/mutant/reporter/cli/printer/status_progressive.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, ProgressBar

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:



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

def self.build(output)
  tty = output.respond_to?(:tty?) && output.tty?

  new(
    format:         Format::Progressive.new(tty:, output_io: output),
    print_warnings: false,
    output:
  )
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

Returns:

  • (Float)


53
# File 'lib/mutant/reporter/cli.rb', line 53

def delay = format.delay

#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)


43
# File 'lib/mutant/reporter/cli.rb', line 43

def progress(status) = tap { write(format.progress(status)) }

#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)


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

def report(env)
  write_final_progress(env)
  Printer::EnvResult.call(output:, object: 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
# File 'lib/mutant/reporter/cli.rb', line 29

def start(env) = tap { write(format.start(env)) }

#test_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

Returns:

  • (self)


48
# File 'lib/mutant/reporter/cli.rb', line 48

def test_progress(status) = tap { write(format.test_progress(status)) }

#test_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)


78
79
80
81
82
# File 'lib/mutant/reporter/cli.rb', line 78

def test_report(env)
  write_final_test_progress(env)
  Printer::Test::EnvResult.call(output:, object: env)
  self
end

#test_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 test start

Parameters:

Returns:

  • (self)


36
# File 'lib/mutant/reporter/cli.rb', line 36

def test_start(env) = tap { write(format.test_start(env)) }

#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)


60
# File 'lib/mutant/reporter/cli.rb', line 60

def warn(message) = tap { output.puts(message) if print_warnings }