Allows setting the gem path searcher. This method is available when requiring ‘rubygems/test_case’
Returns true if new
is newer than all old_list
. Non-existent files are older than any file.
FileUtils.uptodate?('hello.o', %w(hello.c hello.h)) or \ system 'make hello.o'
Returns true if new
is newer than all old_list
. Non-existent files are older than any file.
FileUtils.uptodate?('hello.o', %w(hello.c hello.h)) or \ system 'make hello.o'
Changes permission bits on the named files (in list
) to the bit pattern represented by mode
.
mode
is the symbolic and absolute mode can be used.
Absolute mode is
FileUtils.chmod 0755, 'somecommand' FileUtils.chmod 0644, %w(my.rb your.rb his.rb her.rb) FileUtils.chmod 0755, '/usr/bin/ruby', verbose: true
Symbolic mode is
FileUtils.chmod "u=wrx,go=rx", 'somecommand' FileUtils.chmod "u=wr,go=rr", %w(my.rb your.rb his.rb her.rb) FileUtils.chmod "u=wrx,go=rx", '/usr/bin/ruby', verbose: true
is user, group, other mask.
is user’s mask.
is group’s mask.
is other’s mask.
is write permission.
is read permission.
is execute permission.
is execute permission for directories only, must be used in conjunction with “+”
is uid, gid.
is sticky bit.
is added to a class given the specified mode.
Is removed from a given class given mode.
Is the exact nature of the class will be given a specified mode.
Changes permission bits on the named files (in list
) to the bit pattern represented by mode
.
mode
is the symbolic and absolute mode can be used.
Absolute mode is
FileUtils.chmod 0755, 'somecommand' FileUtils.chmod 0644, %w(my.rb your.rb his.rb her.rb) FileUtils.chmod 0755, '/usr/bin/ruby', verbose: true
Symbolic mode is
FileUtils.chmod "u=wrx,go=rx", 'somecommand' FileUtils.chmod "u=wr,go=rr", %w(my.rb your.rb his.rb her.rb) FileUtils.chmod "u=wrx,go=rx", '/usr/bin/ruby', verbose: true
is user, group, other mask.
is user’s mask.
is group’s mask.
is other’s mask.
is write permission.
is read permission.
is execute permission.
is execute permission for directories only, must be used in conjunction with “+”
is uid, gid.
is sticky bit.
is added to a class given the specified mode.
Is removed from a given class given mode.
Is the exact nature of the class will be given a specified mode.
Changes permission bits on the named files (in list
) to the bit pattern represented by mode
.
FileUtils.chmod_R 0700, "/tmp/app.#{$$}" FileUtils.chmod_R "u=wrx", "/tmp/app.#{$$}"
Changes permission bits on the named files (in list
) to the bit pattern represented by mode
.
FileUtils.chmod_R 0700, "/tmp/app.#{$$}" FileUtils.chmod_R "u=wrx", "/tmp/app.#{$$}"
Changes owner and group on the named files (in list
) to the user user
and the group group
. user
and group
may be an ID (Integer/String) or a name (String
). If user
or group
is nil, this method does not change the attribute.
FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby' FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), verbose: true
Changes owner and group on the named files (in list
) to the user user
and the group group
. user
and group
may be an ID (Integer/String) or a name (String
). If user
or group
is nil, this method does not change the attribute.
FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby' FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), verbose: true
Changes owner and group on the named files (in list
) to the user user
and the group group
recursively. user
and group
may be an ID (Integer/String) or a name (String
). If user
or group
is nil, this method does not change the attribute.
FileUtils.chown_R 'www', 'www', '/var/www/htdocs' FileUtils.chown_R 'cvs', 'cvs', '/var/cvs', verbose: true
Changes owner and group on the named files (in list
) to the user user
and the group group
recursively. user
and group
may be an ID (Integer/String) or a name (String
). If user
or group
is nil, this method does not change the attribute.
FileUtils.chown_R 'www', 'www', '/var/www/htdocs' FileUtils.chown_R 'cvs', 'cvs', '/var/cvs', verbose: true
Updates modification time (mtime) and access time (atime) of file(s) in list
. Files are created if they don’t exist.
FileUtils.touch 'timestamp' FileUtils.touch Dir.glob('*.c'); system 'make'
Updates modification time (mtime) and access time (atime) of file(s) in list
. Files are created if they don’t exist.
FileUtils.touch 'timestamp' FileUtils.touch Dir.glob('*.c'); system 'make'
Returns an Array
of names of high-level methods that accept any keyword arguments.
p FileUtils.commands #=> ["chmod", "cp", "cp_r", "install", ...]
Set
the changed state of this object. Notifications will be sent only if the changed state
is true
.
state
Boolean indicating the changed state of this Observable
.
Returns true if this object’s state has been changed since the last notify_observers
call.
Computes the arc tangent given y
and x
. Returns a Float
in the range -PI..PI. Return value is a angle in radians between the positive x-axis of cartesian plane and the point given by the coordinates (x
, y
) on it.
Domain: (-INFINITY, INFINITY)
Codomain: [-PI, PI]
Math.atan2(-0.0, -1.0) #=> -3.141592653589793 Math.atan2(-1.0, -1.0) #=> -2.356194490192345 Math.atan2(-1.0, 0.0) #=> -1.5707963267948966 Math.atan2(-1.0, 1.0) #=> -0.7853981633974483 Math.atan2(-0.0, 1.0) #=> -0.0 Math.atan2(0.0, 1.0) #=> 0.0 Math.atan2(1.0, 1.0) #=> 0.7853981633974483 Math.atan2(1.0, 0.0) #=> 1.5707963267948966 Math.atan2(1.0, -1.0) #=> 2.356194490192345 Math.atan2(0.0, -1.0) #=> 3.141592653589793 Math.atan2(INFINITY, INFINITY) #=> 0.7853981633974483 Math.atan2(INFINITY, -INFINITY) #=> 2.356194490192345 Math.atan2(-INFINITY, INFINITY) #=> -0.7853981633974483 Math.atan2(-INFINITY, -INFINITY) #=> -2.356194490192345