Class: CloudFlock::App::Common::Cleanup

Inherits:
PlatformAction show all
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

#platform, #prefix

Instance Method Summary collapse

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_sObject

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_sObject

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_sObject

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