Stores value
in database with key
as the index. value
is converted to YAML before being stored.
Returns value
Override the inspection method.
system("false") p $?.inspect #=> "#<Process::Status: pid 12861 exit 1>"
Returns true
if this process is stopped. This is only returned if the corresponding wait
call had the WUNTRACED
flag set.
Returns the number of the signal that caused stat to stop (or nil
if self is not stopped).
Returns the least significant eight bits of the return code of stat. Only available if exited?
is true
.
fork { } #=> 26572 Process.wait #=> 26572 $?.exited? #=> true $?.exitstatus #=> 0 fork { exit 99 } #=> 26573 Process.wait #=> 26573 $?.exited? #=> true $?.exitstatus #=> 99
Returns the length of the queue.
Wakes up all threads waiting for this lock.
Returns a printable version of ec
ec = Encoding::Converter.new("iso-8859-1", "utf-8") puts ec.inspect #=> #<Encoding::Converter: ISO-8859-1 to UTF-8>
Finishes the converter. It returns the last part of the converted string.
ec = Encoding::Converter.new("utf-8", "iso-2022-jp") p ec.convert("\u3042") #=> "\e$B$\"" p ec.finish #=> "\e(B"
Finishes the digest and returns the resulting hash value.
This method is overridden by each implementation subclass and often made private, because some of those subclasses may leave internal data uninitialized. Do not call this method from outside. Use digest!()
instead, which ensures that internal data be reset for security reasons.
Creates a printable version of the digest object.
If none is given, returns the resulting hash value of the digest, keeping the digest’s state.
If a string is given, returns the hash value for the given string, resetting the digest to the initial state before and after the process.
Returns the resulting hash value and resets the digest to the initial state.
If none is given, returns the resulting hash value of the digest in a hex-encoded form, keeping the digest’s state.
If a string is given, returns the hash value for the given string in a hex-encoded form, resetting the digest to the initial state before and after the process.
Returns the resulting hash value in a hex-encoded form and resets the digest to the initial state.
Returns digest_obj.digest_length().
If none is given, returns the resulting hash value of the digest in a base64 encoded form, keeping the digest’s state.
If a string
is given, returns the hash value for the given string
in a base64 encoded form, resetting the digest to the initial state before and after the process.
In either case, the return value is properly padded with ‘=’ and contains no line feeds.
Returns the resulting hash value and resets the digest to the initial state.
Creates a global method from the given C signature
using the given opts
as bind parameters with the given block.
Reads a line from the stream which is separated by eol
.
Raises EOFError
if at end of file.
Pushes character c
back onto the stream such that a subsequent buffered character read will return it.
Unlike IO#getc
multiple bytes may be pushed back onto the stream.
Has no effect on unbuffered reads (such as sysread).
Writes s
to the stream. If the argument is not a string it will be converted using String#to_s
. Returns the number of bytes written.
If a block is given, it prints out each of the elements encountered. Block parameters are (in that order):
depth: The recursion depth, plus one with each constructed value being encountered (Number)
offset: Current byte offset (Number)
header length: Combined length in bytes of the Tag and Length headers. (Number)
length: The overall remaining length of the entire data (Number)
constructed: Whether this value is constructed or not (Boolean)
tag_class: Current tag class (Symbol
)
tag: The current tag (Number)
der = File.binread('asn1data.der') OpenSSL::ASN1.traverse(der) do | depth, offset, header_len, length, constructed, tag_class, tag| puts "Depth: #{depth} Offset: #{offset} Length: #{length}" puts "Header length: #{header_len} Tag: #{tag} Tag class: #{tag_class} Constructed: #{constructed}" end