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 =
<<~DOCOPT
  Utilidades para e-Sosti (Control Desk).

    Usage:
    __PROGRAM__ [options] fetch <solicitacao_id>
    __PROGRAM__ -h | --help

  Options:
    -h --help   Mostra esta ajuda.
    -u --user   Usuário no e-Sosti.
DOCOPT

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