Class: Heirloom::Cipher::File
- Inherits:
-
Object
- Object
- Heirloom::Cipher::File
- Includes:
- Shared
- Defined in:
- lib/heirloom/cipher/file.rb
Instance Method Summary collapse
- #encrypt_file(args) ⇒ Object
-
#initialize(args) ⇒ File
constructor
A new instance of File.
Methods included from Shared
Methods included from Utils::File
#path, #path_separator, #pathext, #which
Constructor Details
#initialize(args) ⇒ File
Returns a new instance of File.
10 11 12 13 |
# File 'lib/heirloom/cipher/file.rb', line 10 def initialize(args) @config = args[:config] @logger = @config.logger end |
Instance Method Details
#encrypt_file(args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/heirloom/cipher/file.rb', line 15 def encrypt_file(args) @file = args[:file] @secret = args[:secret] @encrypted_file = Tempfile.new('archive.tar.gz.enc') return false unless gpg_in_path? return false unless encrypt replace_file end |