Class: GpgCommand
- Inherits:
-
Object
- Object
- GpgCommand
- Defined in:
- lib/gpg_encrypt_folder.rb
Instance Method Summary collapse
- #encrypted_filename ⇒ Object
- #filename_without_extension ⇒ Object
- #homedir ⇒ Object
- #keyring ⇒ Object
- #output_filename ⇒ Object
- #recipient ⇒ Object
-
#to_s ⇒ Object
Note we skip using a random seed file (normally created at var/ukrdc/gpgkey/random_seed) because we had problems at KCH where the file would become corrupt, breaking the export, and fixable only by deleting the random_seed file and letting gpg re-create one.
Instance Method Details
#encrypted_filename ⇒ Object
87 88 89 |
# File 'lib/gpg_encrypt_folder.rb', line 87 def encrypted_filename .destination_folder.join(output_filename) end |
#filename_without_extension ⇒ Object
79 80 81 |
# File 'lib/gpg_encrypt_folder.rb', line 79 def filename_without_extension File.basename(file, ".xml") end |
#homedir ⇒ Object
71 72 73 |
# File 'lib/gpg_encrypt_folder.rb', line 71 def homedir .homedir && "--homedir \"#{.homedir}\"" end |
#keyring ⇒ Object
75 76 77 |
# File 'lib/gpg_encrypt_folder.rb', line 75 def keyring "--keyring \"#{.keyring}\"" end |
#output_filename ⇒ Object
83 84 85 |
# File 'lib/gpg_encrypt_folder.rb', line 83 def output_filename "#{filename_without_extension}.gpg" end |
#recipient ⇒ Object
67 68 69 |
# File 'lib/gpg_encrypt_folder.rb', line 67 def recipient .recipient && "--recipient \"#{.recipient}\"" end |
#to_s ⇒ Object
Note we skip using a random seed file (normally created at var/ukrdc/gpgkey/random_seed) because we had problems at KCH where the file would become corrupt, breaking the export, and fixable only by deleting the random_seed file and letting gpg re-create one. Using the –no-random-seed-file option the file is not used so we avoid that problem.
60 61 62 63 64 65 |
# File 'lib/gpg_encrypt_folder.rb', line 60 def to_s "gpg --armor --no-default-keyring --trust-model always --no-random-seed-file "\ "#{keyring} #{homedir} #{recipient} "\ "-o \"#{encrypted_filename}\" "\ "--encrypt \"#{file}\"" end |