Class: ICSP::Commands::Certificate::Delete

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/commands/certificate/delete.rb

Instance Attribute Summary

Attributes inherited from BaseCommand

#arguments, #config, #options, #prompt

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Constructor Details

This class inherits a constructor from ICSP::Commands::BaseCommand

Instance Method Details

#available_storesObject



19
20
21
# File 'lib/commands/certificate/delete.rb', line 19

def available_stores
  %w[uMy root ca]
end

#certmgrObject



7
8
9
# File 'lib/commands/certificate/delete.rb', line 7

def certmgr
  @certmgr ||= @config.certmgr
end

#executeObject



11
12
13
14
15
16
17
# File 'lib/commands/certificate/delete.rb', line 11

def execute
  store = prompt.select('Select store:', available_stores)
  result = ::ICSP::Shell.new("#{certmgr} -delete -store #{store}", fork: false).execute
  exit(result.exit_code) unless result.ok

  puts result
end