Class: Heirloom::Cipher::File

Inherits:
Object
  • Object
show all
Includes:
Shared
Defined in:
lib/heirloom/cipher/file.rb

Instance Method Summary collapse

Methods included from Shared

#gpg_in_path?

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