Class: UICov::Gather

Inherits:
Command show all
Defined in:
lib/uicov/commands/gather.rb

Constant Summary collapse

DEFAULT_FILENAME =
'coverage.uic'
OPTIONS =
{
  '--coverage-file=FILE' => "File to store coverage info [default is '#{DEFAULT_FILENAME}']",
  '--pattern-file=FILE' => 'Path to pattern file to override default patterns',
  # '--no-transitions' => 'Do not gather transitions coverage',
  # '--no-actions    ' => 'Do not gather actions coverage',
  # '--no-checks     ' => 'Do not gather checks coverage',
  # '--no-elements   ' => 'Do not gather elements coverage'
}
USAGE_INFO =

‘–no-transitions’ => ‘Do not gather transitions coverage’, ‘–no-actions ’ => ‘Do not gather actions coverage’, ‘–no-checks ’ => ‘Do not gather checks coverage’, ‘–no-elements ’ => ‘Do not gather elements coverage’

%Q^[options] file1.log [file2.log ... fileN.log]
  \n\rWhere options are:
  #{OPTIONS.inject([]){|a, e| a << "\r\t#{e[0]}\t- #{e[1]}"; a}.join("\n")}
^

Constants inherited from Command

Command::COMMAND_PREFIX

Instance Method Summary collapse

Methods inherited from Command

#usage

Constructor Details

#initializeGather

Returns a new instance of Gather.



41
42
43
# File 'lib/uicov/commands/gather.rb', line 41

def initialize
  @coverage_file = DEFAULT_FILENAME
end

Instance Method Details

#do_job(args) ⇒ Object



45
46
47
48
49
50
51
52
53
# File 'lib/uicov/commands/gather.rb', line 45

def do_job(args)
  usage 'Missed log file', USAGE_INFO if args.empty?
  @cd = CovData.new
  log_files = process_args args
  parse_logs log_files
  @cd.set_processing_date
  @cd.type = CoverageDataType::COVERAGE
  @cd.save(@coverage_file)
end