Class: ConfigCurator::Component

Inherits:
Unit
  • Object
show all
Defined in:
lib/config_curator/units/component.rb

Overview

A component is a folder that should be copied. The Unit#destination will become a mirror of the Unit#source. The contents of the Unit#destination_path is completely replaced by the contents of the Unit#source_path.

Constant Summary

Constants inherited from Unit

Unit::DEFAULT_OPTIONS

Instance Attribute Summary collapse

Attributes inherited from Unit

#destination, #hosts, #logger, #packages, #source

Instance Method Summary collapse

Methods inherited from Unit

#allowed_host?, #destination_path, #initialize, #options, #package_lookup, #packages_installed?, #source_path

Constructor Details

This class inherits a constructor from ConfigCurator::Unit

Instance Attribute Details

#dmodeObject

Returns the value of attribute dmode.



11
12
13
# File 'lib/config_curator/units/component.rb', line 11

def dmode
  @dmode
end

#fmodeObject

Returns the value of attribute fmode.



11
12
13
# File 'lib/config_curator/units/component.rb', line 11

def fmode
  @fmode
end

#groupObject

Returns the value of attribute group.



11
12
13
# File 'lib/config_curator/units/component.rb', line 11

def group
  @group
end

#ownerObject

Returns the value of attribute owner.



11
12
13
# File 'lib/config_curator/units/component.rb', line 11

def owner
  @owner
end

Instance Method Details

#installObject

Installs the unit.



14
15
16
17
18
19
20
21
# File 'lib/config_curator/units/component.rb', line 14

def install
  s = super
  return s unless s
  install_component
  set_mode
  set_owner
  true
end

#install?Boolean

Checks if the unit should be installed.

Returns:

  • (Boolean)

    if the unit should be installed



24
25
26
27
28
29
30
31
# File 'lib/config_curator/units/component.rb', line 24

def install?
  s = super
  return s unless s
  fail InstallFailed, "No component source path specified." if source_path.nil?
  fail InstallFailed, "No component install path specified." if destination_path.nil?
  fail InstallFailed, "Source path does not exist: #{source}" unless Dir.exists? source_path
  true
end