Module: Deployment::Methods::Fileops

Defined in:
lib/depengine/dsl/fileops.rb

Instance Method Summary collapse

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, options={})
  Processor.chmod(File.join($recipe_config[:deploy_home], file), \
                  mode, options)
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, options={})
  Processor.copy(File.join($recipe_config[:deploy_home], source), \
                 File.join($recipe_config[:deploy_home], target), \
                 options)
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

Creates a link from a given file to a given target.
The target be prefixed with the recipes :deploy_home.



39
40
41
# File 'lib/depengine/dsl/fileops.rb', line 39

def mklink(source, target)
  Processor.mklink(source, File.join($recipe_config[:deploy_home], target))
end

#remove(file) ⇒ Object

Removes a given name/path.
The path will be prefixed with the recipes :deploy_home.



33
34
35
# File 'lib/depengine/dsl/fileops.rb', line 33

def remove(file)
  Processor.remove(File.join($recipe_config[:deploy_home], file))
end