Class: Mutant::Reporter::CLI
- Inherits:
-
Mutant::Reporter
- Object
- Mutant::Reporter
- Mutant::Reporter::CLI
- Defined in:
- lib/mutant/reporter/cli.rb,
lib/mutant/reporter/cli/tput.rb,
lib/mutant/reporter/cli/format.rb,
lib/mutant/reporter/cli/printer.rb
Overview
Reporter that reports in human readable format
Defined Under Namespace
Classes: Format, Printer, Tput
Class Method Summary collapse
-
.build(output) ⇒ Reporter::CLI
private
Build reporter.
Instance Method Summary collapse
-
#progress(collector) ⇒ self
private
Report progress object.
-
#report(env) ⇒ self
private
Report env.
-
#start(env) ⇒ Object
private
Report start.
-
#warn(message) ⇒ self
private
Report warning.
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
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mutant/reporter/cli.rb', line 15 def self.build(output) tty = output.respond_to?(:tty?) && output.tty? format = if !Mutant.ci? && tty && Tput::INSTANCE.available Format::Framed.new(tty: tty, tput: Tput::INSTANCE) else Format::Progressive.new(tty: tty) end new(output, format) end |
Instance Method Details
#progress(collector) ⇒ 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
46 47 48 49 50 |
# File 'lib/mutant/reporter/cli.rb', line 46 def progress(collector) write(format.progress(collector)) 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
73 74 75 76 |
# File 'lib/mutant/reporter/cli.rb', line 73 def report(env) write(format.report(env)) self end |
#start(env) ⇒ Object
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
33 34 35 36 |
# File 'lib/mutant/reporter/cli.rb', line 33 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
60 61 62 63 |
# File 'lib/mutant/reporter/cli.rb', line 60 def warn() output.puts() self end |