Class: TableBeet::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/table_beet/reporter.rb

Class Method Summary collapse

Class Method Details

.build(config = {}) ⇒ Object

Parameters:

  • config (Hash) (defaults to: {})

    :format => [Symbol] Output format

    :t or :text is plain text
    otherwise HTML
    

    :output => [String] Directory to output’



15
16
17
18
19
# File 'lib/table_beet/reporter.rb', line 15

def self.build(config = {})
  type   = config[:format]
  output = config[:output] || './stepdoc'
  formatter(type).new(TableBeet::World.scopes, output).flush
end

.formatter(type) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/table_beet/reporter.rb', line 21

def self.formatter(type)
  case type
  when :t, :text
    TableBeet::Formatters::TextFormatter
  else
    TableBeet::Formatters::HTMLFormatter
  end
end