Class: Diffcrypt::CLI
- Inherits:
-
Thor
- Object
- Thor
- Diffcrypt::CLI
- Defined in:
- lib/diffcrypt/cli.rb
Instance Method Summary collapse
Instance Method Details
#decrypt(path) ⇒ Object
11 12 13 14 15 |
# File 'lib/diffcrypt/cli.rb', line 11 def decrypt(path) file = File.new(path) ensure_file_exists(file) say file.decrypt(key) end |
#encrypt(path) ⇒ Object
20 21 22 23 24 |
# File 'lib/diffcrypt/cli.rb', line 20 def encrypt(path) file = File.new(path) ensure_file_exists(file) say file.encrypt(key, cipher: [:cipher]) end |
#generate_key ⇒ Object
28 29 30 |
# File 'lib/diffcrypt/cli.rb', line 28 def generate_key say Encryptor.generate_key([:cipher]) end |