Created
August 12, 2015 22:47
-
-
Save shadeslayer/bc9f3091d7e01a35ff84 to your computer and use it in GitHub Desktop.
Mount things into other things
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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