Module: TapOut::Reporters

Defined in:
lib/tapout/reporters/abstract.rb,
lib/tapout/reporters/dot_reporter.rb,
lib/tapout/reporters/tap_reporter.rb,
lib/tapout/reporters/html_reporter.rb,
lib/tapout/reporters/turn_reporter.rb,
lib/tapout/reporters/pretty_reporter.rb,
lib/tapout/reporters/outline_reporter.rb,
lib/tapout/reporters/progress_reporter.rb,
lib/tapout/reporters/breakdown_reporter.rb

Overview

Namespace for Report Formats.

Defined Under Namespace

Classes: Abstract, BreakdownReporter, DotReporter, Html, Outline, PrettyReporter, ProgressReporter, TapReporter, TurnReporter

Constant Summary collapse

DEAFULT_REPORTER =
'dot'

Class Method Summary collapse

Class Method Details

.factory(name) ⇒ Object

Returns a reporter class given it’s name or a unique abbreviation of it. If ‘name` is `nil` then the default dot reporter is returned.

Raises:

  • (ArgumentError)


19
20
21
22
23
24
# File 'lib/tapout/reporters/abstract.rb', line 19

def self.factory(name)
  list = index.keys.abbrev
  rptr = index[list[name || DEAFULT_REPORTER]]
  raise ArgumentError, "Unrecognized reporter -- #{name.inspect}" unless rptr
  rptr
end

.indexObject

Returns a Hash of name to reporter class.



13
14
15
# File 'lib/tapout/reporters/abstract.rb', line 13

def self.index
  @index ||= {}
end