2012-08-16 04:10:54 +02:00
|
|
|
module Mutant
|
|
|
|
class Reporter
|
|
|
|
# Reporter that reports in human readable format
|
|
|
|
class CLI < self
|
2014-05-11 13:47:29 +00:00
|
|
|
include Concord.new(:output)
|
2012-08-29 13:36:29 +02:00
|
|
|
|
2013-06-21 17:52:53 +02:00
|
|
|
NL = "\n".freeze
|
|
|
|
|
2014-05-12 13:48:15 +00:00
|
|
|
# Report progress object
|
|
|
|
#
|
|
|
|
# @param [Object] object
|
|
|
|
#
|
|
|
|
# @return [self]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def progress(object)
|
|
|
|
Progress.run(output, object)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
2014-06-30 13:19:47 +00:00
|
|
|
# Report warning
|
|
|
|
#
|
|
|
|
# @param [String] message
|
|
|
|
#
|
|
|
|
# @return [self]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def warn(message)
|
|
|
|
output.puts(message)
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
2013-04-21 02:20:18 +02:00
|
|
|
# Report object
|
|
|
|
#
|
|
|
|
# @param [Object] object
|
|
|
|
#
|
|
|
|
# @return [self]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def report(object)
|
2014-05-12 13:48:15 +00:00
|
|
|
Report.run(output, object)
|
2013-04-21 02:20:18 +02:00
|
|
|
self
|
|
|
|
end
|
|
|
|
|
2013-06-14 20:54:02 +02:00
|
|
|
end # CLI
|
|
|
|
end # Reporter
|
|
|
|
end # Mutant
|