Class: CloudFlock::App::Common::Cleanup
- Inherits:
-
PlatformAction
- Object
- PlatformAction
- CloudFlock::App::Common::Cleanup
- Defined in:
- lib/cloudflock/app/common/cleanup.rb,
lib/cloudflock/app/common/cleanup/unix.rb
Overview
Public: The Cleanup Class allows for building tasks leading up to, during and following chrooting into a staged post-migration environment to perform cleanup tasks.
Defined Under Namespace
Modules: Unix
Instance Attribute Summary
Attributes inherited from PlatformAction
Instance Method Summary collapse
-
#chroot_s ⇒ Object
Public: Return all chroot steps separated by newlines.
-
#chroot_step(step) ⇒ Object
Public: Define a step to be performed in a chroot environment.
-
#initialize(cpe) ⇒ Cleanup
constructor
Public: Initialize the internal state, then find suitable tasks for the detected platform.
-
#post_s ⇒ Object
Public: Return all post-chroot steps separated by newlines.
-
#post_step(step) ⇒ Object
Public: Define a step to be performed after leaving the chroot environment.
-
#pre_s ⇒ Object
Public: Return all pre-chroot steps separated by newlines.
-
#pre_step(step) ⇒ Object
Public: Define a step to be performed prior to chrooting.
Methods inherited from PlatformAction
#each_platform, #load_each, #map_platforms
Constructor Details
#initialize(cpe) ⇒ Cleanup
Public: Initialize the internal state, then find suitable tasks for the detected platform.
cpe - CPE object.
12 13 14 15 16 |
# File 'lib/cloudflock/app/common/cleanup.rb', line 12 def initialize(cpe) super define_steps end |
Instance Method Details
#chroot_s ⇒ Object
Public: Return all chroot steps separated by newlines.
Returns a String.
56 57 58 |
# File 'lib/cloudflock/app/common/cleanup.rb', line 56 def chroot_s chroot.join("\n") end |
#chroot_step(step) ⇒ Object
Public: Define a step to be performed in a chroot environment.
step - String containing a command to be performed.
Returns nothing.
32 33 34 |
# File 'lib/cloudflock/app/common/cleanup.rb', line 32 def chroot_step(step) chroot << step end |
#post_s ⇒ Object
Public: Return all post-chroot steps separated by newlines.
Returns a String.
63 64 65 |
# File 'lib/cloudflock/app/common/cleanup.rb', line 63 def post_s post.join("\n") end |
#post_step(step) ⇒ Object
Public: Define a step to be performed after leaving the chroot environment.
step - String containing a command to be performed.
Returns nothing.
42 43 44 |
# File 'lib/cloudflock/app/common/cleanup.rb', line 42 def post_step(step) post << step end |
#pre_s ⇒ Object
Public: Return all pre-chroot steps separated by newlines.
Returns a String.
49 50 51 |
# File 'lib/cloudflock/app/common/cleanup.rb', line 49 def pre_s pre.join("\n") end |
#pre_step(step) ⇒ Object
Public: Define a step to be performed prior to chrooting.
step - String containing a command to be performed.
Returns nothing.
23 24 25 |
# File 'lib/cloudflock/app/common/cleanup.rb', line 23 def pre_step(step) pre << step end |