Class: ICSP::Commands::VerifyHash

Inherits:
BaseCommand show all
Defined in:
lib/commands/verify_hash.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

#cryptcpObject



6
7
8
# File 'lib/commands/verify_hash.rb', line 6

def cryptcp
  @cryptcp ||= @config.cryptcp
end

#executeObject



10
11
12
13
14
15
16
# File 'lib/commands/verify_hash.rb', line 10

def execute
  input_file = arguments.first
  result = ::ICSP::Shell.new("#{cryptcp} -vhash -hex #{input_file}", convert_to_utf8: false).execute
  exit(result.exit_code) unless result.ok

  puts result
end