Add file name
with permissions mode
size
bytes long. Yields an IO
to write the file to.
Creates a digest object and reads a given file, name. Optional arguments are passed to the constructor of the digest class.
p Digest::SHA256.file("X11R6.8.2-src.tar.bz2").hexdigest # => "f02e3c85572dc9ad7cb77c2a638e3be24cc1b5bea9fdbb0b0299c9668475c534"
Array of the currently loaded libraries.
Returns true
if this is a null pointer.
It is only necessary to run cleanup when engines are loaded via OpenSSL::Engine.load
. However, running cleanup before exit is recommended.
Note that this is needed and works only in OpenSSL
< 1.1.0.
The file name of the input.
returns the cmsg level as an integer.
p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").level #=> 41
returns the socket level as an integer.
p Socket::Option.new(:INET6, :IPV6, :RECVPKTINFO, [1].pack("i!")).level #=> 41
Returns the adler-32 checksum.
Returns compression level.
Returns true
if stat is readable by the effective user id of this process.
File.stat("testfile").readable? #=> true
Returns true
if stat is writable by the effective user id of this process.
File.stat("testfile").writable? #=> true
Returns true
if stat is executable or if the operating system doesn’t distinguish executable files from nonexecutable files. The tests are made using the effective owner of the process.
File.stat("testfile").executable? #=> false
Returns true
if stat is a regular file (not a device file, pipe, socket, etc.).
File.stat("testfile").file? #=> true
Returns the instruction sequence as a String
in human readable form.
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
Produces:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>========== 0000 trace 1 ( 1) 0002 putobject 1 0004 putobject 2 0006 opt_plus <ic:1> 0008 leave
Takes source
, a String of Ruby code and compiles it to an InstructionSequence
.
Optionally takes file
, path
, and line
which describe the filename, absolute path and first line number of the ruby code in source
which are metadata attached to the returned iseq
.
options
, which can be true
, false
or a Hash
, is used to modify the default behavior of the Ruby iseq compiler.
For details regarding valid compile options see ::compile_option=
.
RubyVM::InstructionSequence.compile("a = 1 + 2") #=> <RubyVM::InstructionSequence:<compiled>@<compiled>>
Takes body
, a Method
or Proc
object, and returns a String with the human readable instructions for body
.
For a Method
object:
# /tmp/method.rb def hello puts "hello, world" end puts RubyVM::InstructionSequence.disasm(method(:hello))
Produces:
== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============ 0000 trace 8 ( 1) 0002 trace 1 ( 2) 0004 putself 0005 putstring "hello, world" 0007 send :puts, 1, nil, 8, <ic:0> 0013 trace 16 ( 3) 0015 leave ( 2)
For a Proc:
# /tmp/proc.rb p = proc { num = 1 + 2 } puts RubyVM::InstructionSequence.disasm(p)
Produces:
== disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>=== == catch table | catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000 | catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012 |------------------------------------------------------------------------ local table (size: 2, argc: 0 [opts: 0, rest: -1, post: 0, block: -1] s1) [ 2] num 0000 trace 1 ( 1) 0002 putobject 1 0004 putobject 2 0006 opt_plus <ic:1> 0008 dup 0009 setlocal num, 0 0012 leave
Delete the session from storage. Also closes the storage.
Note that the session’s data is not automatically deleted upon the session expiring.
Used to remove a pair from the row by header
or index
. The pair is located as described in CSV::Row.field()
. The deleted pair is returned, or nil
if a pair could not be found.
Removes and returns the indicated column or row. In the default mixed mode indices refer to rows and everything else is assumed to be a column header. Use by_col
!() or by_row
!() to force the lookup.