Class: CloudFlock::App::Common::Exclusions

Inherits:
PlatformAction show all
Defined in:
lib/cloudflock/app/common/exclusions.rb,
lib/cloudflock/app/common/exclusions/unix.rb,
lib/cloudflock/app/common/exclusions/unix/centos.rb,
lib/cloudflock/app/common/exclusions/unix/redhat.rb

Overview

Public: The Exclusions Class allows for building exclusions lists suitable for migrating live hosts based upon the detected platform.

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) ⇒ Exclusions

Public: Initialize the internal state, then find suitable exclusions for the detected platform.

cpe - CPE object.



11
12
13
14
15
# File 'lib/cloudflock/app/common/exclusions.rb', line 11

def initialize(cpe)
  super

  find_exclusions
end

Instance Method Details

#exclude(location) ⇒ Object

Public: Add a location to the list of paths to exclude from a migration.

location - String containing a path.

Returns nothing.



22
23
24
# File 'lib/cloudflock/app/common/exclusions.rb', line 22

def exclude(location)
  exclusions << location
end

#to_sObject

Public: Return all exclusions separated by newlines.

Returns a String.



29
30
31
# File 'lib/cloudflock/app/common/exclusions.rb', line 29

def to_s
  exclusions.join("\n")
end