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/runtime_reporter.rb,
lib/tapout/reporters/markdown_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, Markdown, Outline, PrettyReporter, ProgressReporter, RuntimeReporter, TapReporter, TurnReporter

Constant Summary collapse

DEAFULT_REPORTER =

Default 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.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/tapout/reporters/abstract.rb', line 21

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

.indexObject

Returns a Hash of name to reporter class.



15
16
17
# File 'lib/tapout/reporters/abstract.rb', line 15

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