class Getch::FileSystem::Ext4::Format

Public Class Methods

new() click to toggle source
Calls superclass method Getch::FileSystem::Ext4::Device::new
# File lib/getch/filesystem/ext4/format.rb, line 5
def initialize
  super
  @state = Getch::States.new
  format
end

Public Instance Methods

format() click to toggle source
# File lib/getch/filesystem/ext4/format.rb, line 11
def format
  return if STATES[:format]
  exec("mkfs.fat -F32 #{@dev_esp}") if @dev_esp
  exec("mkswap -f #{@dev_swap}")
  exec("mkfs.ext4 -F #{@dev_root}")
  exec("mkfs.ext4 -F #{@dev_home}") if @dev_home
  @state.format
end

Private Instance Methods

exec(cmd) click to toggle source
# File lib/getch/filesystem/ext4/format.rb, line 22
def exec(cmd)
  Getch::Command.new(cmd).run!
end