Class: Getch::Tree::FS

Inherits:
Object
  • Object
show all
Defined in:
lib/getch/tree.rb

Overview

call class depend on filesystem choosen.

Constant Summary collapse

FS_TREE =
{
  true => { # + encrypt
    true => { # + lvm
      ext4: FileSystem::Ext4::Hybrid
    },
    false => { # - lvm
      ext4: FileSystem::Ext4::Encrypt,
      zfs: FileSystem::Zfs::Encrypt
    }
  },
  false => { # - encrypt
    true => { # + lvm
      ext4: FileSystem::Ext4::Lvm
    },
    false => { # - lvm
      ext4: FileSystem::Ext4::Minimal,
      zfs: FileSystem::Zfs::Minimal
    }
  }
}.freeze

Instance Method Summary collapse

Constructor Details

#initializeFS

Returns a new instance of FS.



45
46
47
48
49
50
# File 'lib/getch/tree.rb', line 45

def initialize
  @encrypt = OPTIONS[:encrypt]
  @lvm = OPTIONS[:lvm]
  @fs = OPTIONS[:fs]
  @log = Log.new
end

Instance Method Details

#selectObject



52
53
54
# File 'lib/getch/tree.rb', line 52

def select
  FS_TREE[@encrypt][@lvm][@fs.to_sym] || @log.fatal('Error in FS_TREE or no comptatible options')
end