Module: Helpema::GPG
Constant Summary
Constants included from Helpema
Class Attribute Summary collapse
-
.version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #decrypt(passphrase:, string: nil, output: nil, input: nil, ioin: nil, ioout: nil) ⇒ Object
- #encrypt(passphrase:, string: nil, output: nil, input: nil, ioin: nil, ioout: nil) ⇒ Object
Methods included from Helpema
define_command, requires, run_command, to_arg
Class Attribute Details
.version ⇒ Object
Returns the value of attribute version.
4 5 6 |
# File 'lib/helpema/gpg.rb', line 4 def version @version end |
Instance Method Details
#decrypt(passphrase:, string: nil, output: nil, input: nil, ioin: nil, ioout: nil) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/helpema/gpg.rb', line 65 def decrypt(passphrase:, string:nil, output:nil, input:nil, ioin:nil, ioout:nil) unless [string,input,ioin].count{_1} == 1 raise "Need only one of string, input, or ioin" end raise "Can't have both output and ioout" if output and ioout GPG.cryptor(decrypt: true, passphrase: passphrase, string: string, input: input, output: output, ioin: ioin, ioout: ioout) end |
#encrypt(passphrase:, string: nil, output: nil, input: nil, ioin: nil, ioout: nil) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/helpema/gpg.rb', line 46 def encrypt(passphrase:, string:nil, output:nil, input:nil, ioin:nil, ioout:nil) unless [string,input,ioin].count{_1} == 1 raise "Need only one of string, input, or ioin" end raise "Can't have both output and ioout" if output and ioout GPG.cryptor(symmetric: true, passphrase: passphrase, string: string, input: input, output: output, ioin: ioin, ioout: ioout) end |