Class: ICSP::Commands::EncryptFile
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- ICSP::Commands::EncryptFile
- Defined in:
- lib/commands/encrypt_file.rb
Instance Attribute Summary
Attributes inherited from BaseCommand
#arguments, #config, #options, #prompt
Instance Method Summary collapse
Methods inherited from BaseCommand
Constructor Details
This class inherits a constructor from ICSP::Commands::BaseCommand
Instance Method Details
#cryptcp ⇒ Object
6 7 8 |
# File 'lib/commands/encrypt_file.rb', line 6 def cryptcp @cryptcp ||= @config.cryptcp end |
#execute ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/commands/encrypt_file.rb', line 10 def execute input_file = arguments.first output_file = arguments.last result = ::ICSP::Shell.new( "#{cryptcp} -encr -thumbprint '#{[:certificate_file]}' #{input_file} #{output_file}", convert_to_utf8: false ).execute exit(result.exit_code) unless result.ok puts result end |