Class: Avmtrf1::Tools::Runner::Esosti

Inherits:
EacRubyUtils::Console::DocoptRunner
  • Object
show all
Includes:
EacRubyUtils::Console::Speaker, EacRubyUtils::SimpleCache
Defined in:
lib/avmtrf1/tools/runner/esosti.rb

Constant Summary collapse

DOC =
"Utilidades para e-Sosti (Control Desk).\n\n  Usage:\n  __PROGRAM__ [options] fetch <solicitacao_id>\n  __PROGRAM__ -h | --help\n\nOptions:\n  -h --help   Mostra esta ajuda.\n  -u --user   Usu\u00E1rio no e-Sosti.\n"

Instance Method Summary collapse

Instance Method Details

#fetchObject



37
38
39
40
41
42
# File 'lib/avmtrf1/tools/runner/esosti.rb', line 37

def fetch
  infom "Recuperando informações de #{options.fetch('<solicitacao_id>')}..."
  issue = ::Avmtrf1.default_esosti.issue(options.fetch('<solicitacao_id>'))
  fatal_error("Issue não encontrado: #{options.fetch('<solicitacao_id>')}") unless issue
  out issue.data.to_yaml
end

#runObject



29
30
31
32
33
34
35
# File 'lib/avmtrf1/tools/runner/esosti.rb', line 29

def run
  if options.fetch('fetch')
    fetch
  else
    fatal_error('Subcomando não mapeado (Isto é um defeito do software)')
  end
end