Skip to content

Instantly share code, notes, and snippets.

@shadeslayer
Created August 12, 2015 22:47
Show Gist options
  • Save shadeslayer/bc9f3091d7e01a35ff84 to your computer and use it in GitHub Desktop.
Save shadeslayer/bc9f3091d7e01a35ff84 to your computer and use it in GitHub Desktop.
Mount things into other things
require 'tmpdir'
class Mount
def initialize
@mntdir = Dir.mktmpdir
end
def mount(path)
fail 'Mounting boot partition failed!' unless system('sudo',
'mount',
path,
@mntdir)
@mntdir
end
def SOMETHING
begin
ensure
system('sudo',
'umount',
@mntdir)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment