Class: MarhanCli::TrueCrypt
- Inherits:
-
Object
- Object
- MarhanCli::TrueCrypt
- Defined in:
- lib/marhan_cli/apps/true_crypt.rb
Instance Method Summary collapse
-
#initialize(mount_folder = nil) ⇒ TrueCrypt
constructor
A new instance of TrueCrypt.
- #mount_command(encrypted_device, mount_sub_folder) ⇒ Object
- #mount_folder ⇒ Object
- #unmount_all_command ⇒ Object
- #unmount_command(mount_sub_folder) ⇒ Object
Constructor Details
#initialize(mount_folder = nil) ⇒ TrueCrypt
Returns a new instance of TrueCrypt.
6 7 8 9 10 |
# File 'lib/marhan_cli/apps/true_crypt.rb', line 6 def initialize(mount_folder = nil) @binary = "/Applications/TrueCrypt.app/Contents/MacOS/TrueCrypt" raise ArgumentError, "No installation of TrueCrypt found!" unless File.exist? @binary @mount_folder = mount_folder end |
Instance Method Details
#mount_command(encrypted_device, mount_sub_folder) ⇒ Object
12 13 14 |
# File 'lib/marhan_cli/apps/true_crypt.rb', line 12 def mount_command(encrypted_device, mount_sub_folder) "#{@binary} --mount #{encrypted_device} #{@mount_folder}/#{mount_sub_folder}" end |
#mount_folder ⇒ Object
20 21 22 23 |
# File 'lib/marhan_cli/apps/true_crypt.rb', line 20 def mount_folder raise ArgumentError, "No mount folder defined! Don't know where to mount!" unless @mount_folder @mount_folder end |
#unmount_all_command ⇒ Object
25 26 27 |
# File 'lib/marhan_cli/apps/true_crypt.rb', line 25 def unmount_all_command() "#{@binary} -d" end |
#unmount_command(mount_sub_folder) ⇒ Object
16 17 18 |
# File 'lib/marhan_cli/apps/true_crypt.rb', line 16 def unmount_command(mount_sub_folder) "#{@binary} -d #{@mount_folder}/#{mount_sub_folder}" end |