Class: UICov::Gentpl

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

Constant Summary collapse

DEFAULT_FILENAME =
'template.uic'
OPTIONS =
{
  '--template-file=FILE' => "File to store coverage template [default is '#{DEFAULT_FILENAME}']",
  # '--puml=DIR      ' => 'Folder where Plant UML model files are',
  # '--no-transitions' => 'Do not include transitions templates',
  # '--no-actions    ' => 'Do not include actions templates',
  # '--no-checks     ' => 'Do not include checks templates',
  # '--no-elements   ' => 'Do not include elements templates'
}
USAGE_INFO =

‘–puml=DIR ’ => ‘Folder where Plant UML model files are’, ‘–no-transitions’ => ‘Do not include transitions templates’, ‘–no-actions ’ => ‘Do not include actions templates’, ‘–no-checks ’ => ‘Do not include checks templates’, ‘–no-elements ’ => ‘Do not include elements templates’

%Q^[options] model-file1.puml [model-file2.puml ... model-fileN.puml]
  \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

#initializeGentpl

or

\r\t#{COMMAND_PREFIX} [options] --puml=DIR


36
37
38
# File 'lib/uicov/commands/gentpl.rb', line 36

def initialize
  @template_file = DEFAULT_FILENAME
end

Instance Method Details

#do_job(args) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/uicov/commands/gentpl.rb', line 40

def do_job(args)
  @cd = CovData.new
  model_files = process_args args
  usage 'Missed model file', USAGE_INFO if model_files.empty?
  parse_models model_files
  @cd.set_processing_date
  @cd.type = CoverageDataType::TEMPLATE
  @cd.save(@template_file)
end