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
-
#backend ⇒ Object
Returns the value of attribute backend.
-
#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 ⇒ Boolean
Installs the unit.
-
#install? ⇒ Boolean
Checks if the unit should be installed.
-
#uninstall(*args) ⇒ Boolean
Uninstalls the unit.
Methods inherited from Unit
#allowed_host?, #destination_path, #initialize, #options, #package_lookup, #packages_installed?, #source_path, #uninstall?
Constructor Details
This class inherits a constructor from ConfigCurator::Unit
Instance Attribute Details
#backend ⇒ Object
Returns the value of attribute backend.
9 10 11 |
# File 'lib/config_curator/units/component.rb', line 9 def backend @backend end |
#dmode ⇒ Object
Returns the value of attribute dmode.
9 10 11 |
# File 'lib/config_curator/units/component.rb', line 9 def dmode @dmode end |
#fmode ⇒ Object
Returns the value of attribute fmode.
9 10 11 |
# File 'lib/config_curator/units/component.rb', line 9 def fmode @fmode end |
#group ⇒ Object
Returns the value of attribute group.
9 10 11 |
# File 'lib/config_curator/units/component.rb', line 9 def group @group end |
#owner ⇒ Object
Returns the value of attribute owner.
9 10 11 |
# File 'lib/config_curator/units/component.rb', line 9 def owner @owner end |
Instance Method Details
#install ⇒ Boolean
Installs the unit.
20 21 22 23 24 25 26 27 |
# File 'lib/config_curator/units/component.rb', line 20 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.
30 31 32 33 34 35 36 37 |
# File 'lib/config_curator/units/component.rb', line 30 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.exist? source_path true end |
#uninstall(*args) ⇒ Boolean
Uninstalls the unit.
12 13 14 15 16 17 |
# File 'lib/config_curator/units/component.rb', line 12 def uninstall(*args) s = super(*args) return s unless s uninstall_component true end |