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
Instance Method Details
#encrypted_filename ⇒ Object
83 84 85 |
# File 'lib/gpg_encrypt_folder.rb', line 83 def encrypted_filename .destination_folder.join(output_filename) end |
#filename_without_extension ⇒ Object
75 76 77 |
# File 'lib/gpg_encrypt_folder.rb', line 75 def filename_without_extension File.basename(file, ".xml") end |
#homedir ⇒ Object
67 68 69 |
# File 'lib/gpg_encrypt_folder.rb', line 67 def homedir .homedir && "--homedir \"#{.homedir}\"" end |
#keyring ⇒ Object
71 72 73 |
# File 'lib/gpg_encrypt_folder.rb', line 71 def keyring "--keyring \"#{.keyring}\"" end |
#output_filename ⇒ Object
79 80 81 |
# File 'lib/gpg_encrypt_folder.rb', line 79 def output_filename "#{filename_without_extension}.gpg" end |
#recipient ⇒ Object
63 64 65 |
# File 'lib/gpg_encrypt_folder.rb', line 63 def recipient .recipient && "--recipient \"#{.recipient}\"" end |
#to_s ⇒ Object
56 57 58 59 60 61 |
# File 'lib/gpg_encrypt_folder.rb', line 56 def to_s "gpg --armor --no-default-keyring --trust-model always "\ "#{keyring} #{homedir} #{recipient} "\ "-o \"#{encrypted_filename}\" "\ "--encrypt \"#{file}\"" end |