Class: Decidim::SevenZipWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/decidim/seven_zip_wrapper.rb

Class Method Summary collapse

Class Method Details

.compress_and_encrypt(filename:, password:, input_directory:) ⇒ Object



8
9
10
# File 'lib/decidim/seven_zip_wrapper.rb', line 8

def compress_and_encrypt(filename:, password:, input_directory:)
  run("cd #{escape(input_directory)} && 7z a -tzip -p#{escape(password)} -mem=AES256 #{escape(filename)} .")
end

.extract_and_decrypt(filename:, password:, output_directory:) ⇒ Object



12
13
14
# File 'lib/decidim/seven_zip_wrapper.rb', line 12

def extract_and_decrypt(filename:, password:, output_directory:)
  run("7z x -tzip #{escape(filename)} -o#{escape(output_directory)} -p#{escape(password)}")
end