Class: Haconiwa::MountPoint
- Inherits:
-
Object
- Object
- Haconiwa::MountPoint
- Defined in:
- lib/haconiwa/mount_point.rb
Instance Method Summary collapse
- #apply! ⇒ Object
-
#initialize(point, options) ⇒ MountPoint
constructor
A new instance of MountPoint.
- #to_command ⇒ Object
Constructor Details
#initialize(point, options) ⇒ MountPoint
Returns a new instance of MountPoint.
3 4 5 6 7 8 9 |
# File 'lib/haconiwa/mount_point.rb', line 3 def initialize(point, ) @src = point @dest = .delete(:to) @readonly = .delete(:readonly) @fs = .delete(:fs) @options = end |
Instance Method Details
#apply! ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/haconiwa/mount_point.rb', line 19 def apply! STDERR.puts to_command system to_command if @readonly STDERR.puts "mount --bind -o remount,ro #{@dest}" system "mount --bind -o remount,ro #{@dest}" end end |
#to_command ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/haconiwa/mount_point.rb', line 11 def to_command if @fs "mount -t #{@fs} #{@src} #{@dest}" else "mount --bind #{@src} #{@dest}" end end |