Class: Lxc::OverlayDirectory
- Inherits:
-
Object
- Object
- Lxc::OverlayDirectory
- Defined in:
- lib/elecksee/storage/overlay_directory.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tmp_dir ⇒ Object
readonly
Returns the value of attribute tmp_dir.
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
-
#initialize(name, args = {}) ⇒ OverlayDirectory
constructor
A new instance of OverlayDirectory.
- #overlay_path ⇒ Object (also: #target_path)
Constructor Details
#initialize(name, args = {}) ⇒ OverlayDirectory
Returns a new instance of OverlayDirectory.
9 10 11 12 13 |
# File 'lib/elecksee/storage/overlay_directory.rb', line 9 def initialize(name, args={}) @name = name @tmp_dir = args[:tmp_dir] || '/tmp/lxc/ephemerals' create end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/elecksee/storage/overlay_directory.rb', line 6 def name @name end |
#tmp_dir ⇒ Object (readonly)
Returns the value of attribute tmp_dir.
7 8 9 |
# File 'lib/elecksee/storage/overlay_directory.rb', line 7 def tmp_dir @tmp_dir end |
Instance Method Details
#create ⇒ Object
20 21 22 23 24 |
# File 'lib/elecksee/storage/overlay_directory.rb', line 20 def create unless(File.directory?()) FileUtils.mkdir_p() end end |
#destroy ⇒ Object
26 27 28 |
# File 'lib/elecksee/storage/overlay_directory.rb', line 26 def destroy FileUtils.rm_rf() if File.directory?() end |
#overlay_path ⇒ Object Also known as: target_path
15 16 17 |
# File 'lib/elecksee/storage/overlay_directory.rb', line 15 def File.join(tmp_dir, 'virt-overlays', name) end |