Returns true if the contents of a file a
and a file b
are identical.
FileUtils.compare_file('somefile', 'somefile') #=> true FileUtils.compare_file('/dev/null', '/dev/urandom') #=> false
Returns true if the contents of a stream a
and b
are identical.
Returns true if the contents of a stream a
and b
are identical.
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.
Glob pattern for require-able path suffixes.
Use the home
and paths
values for Gem.dir
and Gem.path
. Used mainly by the unit tests to provide environment isolation.
The home directory for the user.
Path for gems in the user’s home directory
Array
of the currently loaded libraries.
Returns the names of all available ciphers in an array.
returns the socket option name as an integer.
p Socket::Option.new(:INET6, :IPV6, :RECVPKTINFO, [1].pack("i!")).optname #=> 2
Calls String#unpack
on sockopt.data.
sockopt = Socket::Option.new(:INET, :SOCKET, :KEEPALIVE, [1].pack("i")) p sockopt.unpack("i") #=> [1] p sockopt.data.unpack("i") #=> [1]
Convert 64-bit FILETIME integer into Time
object.
Changes the parameters of the deflate stream to allow changes between different types of data that require different types of compression. Any unprocessed data is flushed before changing the params.
See Zlib::Deflate.new
for a description of level
and strategy
.
Returns a new Tms
object obtained by memberwise operation op
of the individual times for this Tms
object with those of the other Tms
object (x
).
op
can be a mathematical operation such as +
, -
, *
, /
A set of tasks to prepare the file in order to parse it
Returns the headers for this row:
source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n" table = CSV.parse(source, headers: true) row = table.first row.headers # => ["Name", "Value"]
Returns a new Array containing the String headers for the table.
If the table is not empty, returns the headers from the first row:
rows = [ CSV::Row.new(['Foo', 'Bar'], []), CSV::Row.new(['FOO', 'BAR'], []), CSV::Row.new(['foo', 'bar'], []), ] table = CSV::Table.new(rows) table.headers # => ["Foo", "Bar"] table.delete(0) table.headers # => ["FOO", "BAR"] table.delete(0) table.headers # => ["foo", "bar"]
If the table is empty, returns a copy of the headers in the table itself:
table.delete(0) table.headers # => ["Foo", "Bar"]