Class: ConfigCurator::Component
- 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
Instance Attribute Summary collapse
-
#dmode ⇒ Object
Returns the value of attribute dmode.
-
#fmode ⇒ Object
Returns the value of attribute fmode.
-
#group ⇒ Object
Returns the value of attribute group.
-
#owner ⇒ Object
Returns the value of attribute owner.
Attributes inherited from Unit
#destination, #hosts, #logger, #packages, #source
Instance Method Summary collapse
-
#install ⇒ Object
Installs the unit.
-
#install? ⇒ Boolean
Checks if the unit should be installed.
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
#dmode ⇒ Object
Returns the value of attribute dmode.
11 12 13 |
# File 'lib/config_curator/units/component.rb', line 11 def dmode @dmode end |
#fmode ⇒ Object
Returns the value of attribute fmode.
11 12 13 |
# File 'lib/config_curator/units/component.rb', line 11 def fmode @fmode end |
#group ⇒ Object
Returns the value of attribute group.
11 12 13 |
# File 'lib/config_curator/units/component.rb', line 11 def group @group end |
#owner ⇒ Object
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
#install ⇒ Object
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.
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 |