Class: MarhanCli::TrueCrypt

Inherits:
Object
  • Object
show all
Defined in:
lib/marhan_cli/apps/true_crypt.rb

Instance Method Summary collapse

Constructor Details

#initialize(mount_folder = nil) ⇒ TrueCrypt

Returns a new instance of TrueCrypt.

Raises:

  • (ArgumentError)


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_folderObject

Raises:

  • (ArgumentError)


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_commandObject



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