Module: Polytrix::Reporters

Included in:
Command::List, Command::Show
Defined in:
lib/polytrix/reporters.rb,
lib/polytrix/reporters/hash_reporter.rb,
lib/polytrix/reporters/json_reporter.rb,
lib/polytrix/reporters/yaml_reporter.rb,
lib/polytrix/reporters/markdown_reporter.rb

Defined Under Namespace

Classes: HashReporter, JSONReporter, MarkdownReporter, YAMLReporter

Constant Summary collapse

RESOURCES_DIR =
File.expand_path '../../../resources/', __FILE__
GENERATORS_DIR =
File.expand_path 'generators/', RESOURCES_DIR
ASSETS_DIR =
File.expand_path 'assets/', RESOURCES_DIR

Class Method Summary collapse

Class Method Details

.reporter(format, shell) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/polytrix/reporters.rb', line 12

def self.reporter(format, shell)
  case format
  when 'text'
    shell
  when 'markdown'
    MarkdownReporter.new
  when 'json'
    JSONReporter.new
  when 'yaml'
    YAMLReporter.new
  else
    fail "Unknown report format #{format}"
  end
end