Load the document contained in filename
. Returns the yaml contained in filename
as a Ruby object, or if the file is empty, it returns the specified fallback
return value, which defaults to false
.
Delete text between start and end in the current line.
See GNU Readline’s rl_delete_text function.
Raises NotImplementedError
if the using readline library does not support.
Combine two Adler-32 check values in to one. alder1
is the first Adler-32 value, adler2
is the second Adler-32 value. len2
is the length of the string used to generate adler2
.
Returns the table for calculating CRC checksum as an array.
Returns true
if the named file is readable by the real user and group id of this process. See access(3).
Note that some OS-level security features may cause this to return true even though the file is not readable by the real user/group.
If file_name is readable by others, returns an integer representing the file permission bits of file_name. Returns nil
otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2)
.
file_name can be an IO
object.
File.world_readable?("/etc/passwd") #=> 420 m = File.world_readable?("/etc/passwd") sprintf("%o", m) #=> "644"
Returns true
if the named file is writable by the real user and group id of this process. See access(3).
Note that some OS-level security features may cause this to return true even though the file is not writable by the real user/group.
If file_name is writable by others, returns an integer representing the file permission bits of file_name. Returns nil
otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2)
.
file_name can be an IO
object.
File.world_writable?("/tmp") #=> 511 m = File.world_writable?("/tmp") sprintf("%o", m) #=> "777"
Returns true
if the named file is executable by the real user and group id of this process. See access(3).
Windows does not support execute permissions separately from read permissions. On Windows, a file is only considered executable if it ends in .bat, .cmd, .com, or .exe.
Note that some OS-level security features may cause this to return true even though the file is not executable by the real user/group.
Returns the Base64-decoded version of str
. This method complies with “Base 64 Encoding
with URL and Filename Safe Alphabet” in RFC 4648. The alphabet uses ‘-’ instead of ‘+’ and ‘_’ instead of ‘/’.
The padding character is optional. This method accepts both correctly-padded and unpadded input. Note that it still rejects incorrectly-padded input.
Reset the dir
and path
values. The next time dir
or path
is requested, the values will be calculated from scratch. This is mainly used by the unit tests to provide test isolation.
Returns a list of paths matching glob
that can be used by a gem to pick up features from other gems. For example:
Gem.find_files('rdoc/discover').each do |path| load path end
if check_load_path
is true (the default), then find_files
also searches $LOAD_PATH for files as well as gems.
Note that find_files
will return all files even if they are from different versions of the same gem. See also find_latest_files
An Array
of the default sources that come with RubyGems
Default home directory path to be used if an alternate value is not specified in the environment
Default gem load path
The default directory for binaries
Default options for gem commands for Ruby implementers.
The options here should be structured as an array of string “gem” command names as keys and a string of the default options as values.
Example:
def self.platform_defaults
{ 'install' => '--no-rdoc --no-ri --env-shebang', 'update' => '--no-rdoc --no-ri --env-shebang' }
end
Removes server
from the list of registered servers.
Removes server
from the list of registered servers.
Copies file contents of src
to dest
. Both of src
and dest
must be a path name.
Copies file contents of src
to dest
. Both of src
and dest
must be a path name.
This method removes a file system entry path
. path
might be a regular file, a directory, or something. If path
is a directory, remove it recursively.
See also remove_entry_secure.
This method removes a file system entry path
. path
might be a regular file, a directory, or something. If path
is a directory, remove it recursively.
See also remove_entry_secure.
Removes a directory dir
and its contents recursively. This method ignores StandardError
if force
is true.
Removes a directory dir
and its contents recursively. This method ignores StandardError
if force
is true.