Type:
Module
Constants:
OPT_TABLE : {}

This hash table holds command options.

LOW_METHODS : singleton_methods(false) - collect_method(:noop).map(&:intern)
METHODS : singleton_methods() - [:private_module_function, :commands, :options, :have_option?, :options_of, :collect_method]
RUBY : ENV['RUBY'] || File.join( RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']). sub(/.*\s.*/m, '"\&"')

Path to the currently running Ruby program

LN_SUPPORTED : [true]

fileutils.rb

Copyright © 2000-2007 Minero Aoki

This program is free software. You can distribute/modify this program under the same terms of ruby.

module FileUtils

Namespace for several file utility methods for copying, moving, removing, etc.

Module Functions

cd(dir, options)
cd(dir, options) {|dir| .... }
pwd()
mkdir(dir, options)
mkdir(list, options)
mkdir_p(dir, options)
mkdir_p(list, options)
rmdir(dir, options)
rmdir(list, options)
ln(old, new, options)
ln(list, destdir, options)
ln_s(old, new, options)
ln_s(list, destdir, options)
ln_sf(src, dest, options)
cp(src, dest, options)
cp(list, dir, options)
cp_r(src, dest, options)
cp_r(list, dir, options)
mv(src, dest, options)
mv(list, dir, options)
rm(list, options)
rm_r(list, options)
rm_rf(list, options)
install(src, dest, mode = <src's>, options)
chmod(mode, list, options)
chmod_R(mode, list, options)
chown(user, group, list, options)
chown_R(user, group, list, options)
touch(list, options)

The options parameter is a hash of options, taken from the list :force, :noop, :preserve, and :verbose. :noop means that no changes are made. The other two are obvious. Each method documents the options that it honours.

All methods that have the concept of a “source” file or directory can take either one file or a list of files in that argument. See the method documentation for examples.

There are some `low level' methods, which do not accept any option:

copy_entry(src, dest, preserve = false, dereference = false)
copy_file(src, dest, preserve = false, dereference = true)
copy_stream(srcstream, deststream)
remove_entry(path, force = false)
remove_entry_secure(path, force = false)
remove_file(path, force = false)
compare_file(path_a, path_b)
compare_stream(stream_a, stream_b)
uptodate?(file, cmp_list)

module FileUtils::Verbose

This module has all methods of FileUtils module, but it outputs messages before acting. This equates to passing the :verbose flag to methods in FileUtils.

module FileUtils::NoWrite

This module has all methods of FileUtils module, but never changes files/directories. This equates to passing the :noop flag to methods in FileUtils.

module FileUtils::DryRun

This module has all methods of FileUtils module, but never changes files/directories. This equates to passing the :noop and :verbose flags to methods in FileUtils.

sh

sh(*cmd, &block) Instance Public methods Run the system command cmd

2015-04-06 20:54:34
compare_stream

compare_stream(a, b) Class Public methods Returns true if the contents of a

2015-04-06 18:29:23
copy_file

copy_file(src, dest, preserve = false, dereference = true) Class Public methods Copies

2015-04-06 18:43:11
chown

chown(user, group, list, options = {}) Class Public methods Options: noop verbose

2015-04-06 18:04:53
chdir

chdir(dir, options = {}) Class Public methods Alias for:

2015-04-06 17:53:27
safe_ln

safe_ln(*args) Instance Public methods Attempt to do a normal file link, but

2015-04-06 20:51:40
ln_s

ln_s(src, dest, options = {}) Class Public methods Options: force noop verbose

2015-04-06 19:15:45
chown_R

chown_R(user, group, list, options = {}) Class Public methods Options: noop

2015-04-06 18:11:20
rm_rf

rm_rf(list, options = {}) Class Public methods Options: noop verbose secure

2015-04-06 20:23:14
install

install(src, dest, options = {}) Class Public methods Options: mode preserve

2015-04-06 19:03:23