Module: Sys

Module | Sys
In: | lib/rake/contrib/sys.rb

Sys provides a number of file manipulation tools for the convenience of writing Rakefiles. All commands in this module will announce their activity on standard output if the $verbose flag is set ($verbose = true is the default). You can control this by globally setting $verbose or by using the `verbose` and `quiet` methods.

Sys has been deprecated in favor of the FileUtils module available in Ruby 1.8.

### Methods

copy copy_files delete delete_all for_files indir install link link_files log makedirs quiet ruby run split_all symlink symlink_files verbose

### Constants

RUBY | = | Config::CONFIG['ruby_install_name']

### Public Instance methods

copy(file_name, dest_file)

Copy a single file from `file_name` to `dest_file`.

copy_files(wildcard, dest_dir)

Copy all files matching `wildcard` into the directory `dest_dir`.

delete(*wildcards)

Remove all files matching `wildcard`. If a matching file is a directory, it must be empty to be removed. used `delete_all` to recursively delete directories.

delete_all(*wildcards)

Recursively delete all files and directories matching `wildcard`.

for_files(*wildcards) {|fn| ...}

Perform a block with each file matching a set of wildcards.

indir(dir) {|| ...}

Make `dir` the current working directory for the duration of executing the given block.

install(wildcard, dest_dir, mode)

Install all the files matching `wildcard` into the `dest_dir` directory. The permission mode is set to `mode`.

link(file_name, dest_file)

Link `file_name` to `dest_file`.

link_files(wildcard, dest_dir)

Link all files matching `wildcard` into the directory `dest_dir`.

log(msg)

Write a message to standard out if $verbose is enabled.

makedirs(*dirs)

Make the directories given in `dirs`.

quiet(&block)

Perform a block with $verbose disabled.

ruby(*args)

Run a Ruby interpreter with the given arguments.

run(cmd)

Run the system command `cmd`.

split_all(path)

Split a file path into individual directory names.

For example:

      split_all("a/b/c") =>  ['a', 'b', 'c']

symlink(file_name, dest_file)

Symlink `file_name` to `dest_file`.

symlink_files(wildcard, dest_dir)

Symlink all files matching `wildcard` into the directory `dest_dir`.

verbose(&block)

Perform a block with $verbose enabled.

[Validate]