Class: ConfigCurator::Symlink

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

Overview

A symlink is a symbolic link that should be created. The Unit#destination_path will be a link that points to the Unit#source_path.

Constant Summary

Constants inherited from Unit

Unit::DEFAULT_OPTIONS

Instance Attribute Summary

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 Method Details

#installObject

Installs the unit.


7
8
9
10
11
12
# File 'lib/config_curator/units/symlink.rb', line 7

def install
  s = super
  return s unless s
  install_symlink
  true
end

#install?Boolean

Checks if the unit should be installed.


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

def install?
  s = super
  return s unless s
  fail InstallFailed, 'No source file specified.' if source_path.nil?
  fail InstallFailed, 'No destination specified.' if destination_path.nil?
  true
end