Module: Deployment::Methods::Fileops
- Defined in:
- lib/depengine/dsl/fileops.rb
Instance Method Summary collapse
-
#check_filelist(list, target) ⇒ Object
Check for the existence of all files in a given list in a given directory.
-
#chmod(file, mode, options = {}) ⇒ Object
Changes permission modes on a given name/path.
The path will be prefixed with the recipes:deploy_home
. -
#copy(source, target, options = {}) ⇒ Object
Copies a file or directory from a given source to a given target.
Both are prefixed with the recipes:deploy_home
. -
#mkdir(directory) ⇒ Object
Recursively creates a directory with a given name/path.
The path will be prefixed with the recipes:deploy_home
. -
#mklink(source, target) ⇒ Object
Creates a link from a given file to a given target.
The target be prefixed with the recipes:deploy_home
. -
#remove(file) ⇒ Object
Removes a given name/path.
The path will be prefixed with the recipes:deploy_home
.
Instance Method Details
#check_filelist(list, target) ⇒ Object
Check for the existence of all files in a given list in a given directory.
Parameters:
-
list
- a CSV list of filenames to check for -
target
- the directory to check in.
Both are prefixed with the recipes :deploy_home
.
49 50 51 52 |
# File 'lib/depengine/dsl/fileops.rb', line 49 def check_filelist(list, target) Processor.check_filelist(File.join($recipe_config[:deploy_home], list), \ File.join($recipe_config[:deploy_home], target)) end |
#chmod(file, mode, options = {}) ⇒ Object
Changes permission modes on a given name/path.
The path will be prefixed with the recipes :deploy_home
.
Parameters:
-
file
- the file to change mode on -
mode
- the new file permission mode (e.g. “644”) options
-
a hash with additional parameters. This is optional.
-
26 27 28 29 |
# File 'lib/depengine/dsl/fileops.rb', line 26 def chmod(file, mode, ={}) Processor.chmod(File.join($recipe_config[:deploy_home], file), \ mode, ) end |
#copy(source, target, options = {}) ⇒ Object
Copies a file or directory from a given source to a given target.
Both are prefixed with the recipes :deploy_home
.
7 8 9 10 11 |
# File 'lib/depengine/dsl/fileops.rb', line 7 def copy(source, target, ={}) Processor.copy(File.join($recipe_config[:deploy_home], source), \ File.join($recipe_config[:deploy_home], target), \ ) end |
#mkdir(directory) ⇒ Object
Recursively creates a directory with a given name/path.
The path will be prefixed with the recipes :deploy_home
.
15 16 17 |
# File 'lib/depengine/dsl/fileops.rb', line 15 def mkdir(directory) Processor.mkdir(File.join($recipe_config[:deploy_home], directory)) end |