Formats and writes to the stream converting parameters under control of the format string.
See Kernel#sprintf
for format string details.
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 (Integer
)
offset: Current byte offset (Integer
)
header length: Combined length in bytes of the Tag and Length headers. (Integer
)
length: The overall remaining length of the entire data (Integer
)
constructed: Whether this value is constructed or not (Boolean)
tag_class: Current tag class (Symbol
)
tag: The current tag number (Integer
)
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
Return true
if the PRNG has been seeded with enough data, false
otherwise.
Start streaming using encoding
Returns whether the form contained multipart/form-data
Adds a separated list. The list is separated by comma with breakable space, by default.
seplist
iterates the list
using iter_method
. It yields each object to the block given for seplist
. The procedure separator_proc
is called between each yields.
If the iteration is zero times, separator_proc
is not called at all.
If separator_proc
is nil or not given, +lambda { comma_breakable
}+ is used. If iter_method
is not given, :each is used.
For example, following 3 code fragments has similar effect.
q.seplist([1,2,3]) {|v| xxx v } q.seplist([1,2,3], lambda { q.comma_breakable }, :each) {|v| xxx v } xxx 1 q.comma_breakable xxx 2 q.comma_breakable xxx 3
Returns the last node of the given list of nodes.
This is entirely Mike Stok’s beast
UNTESTED
If a doctype includes an ATTLIST declaration, it will cause this method to be called. The content is the declaration itself, unparsed. EG, <!ATTLIST el attr CDATA REQUIRED> will come to this method as “el attr CDATA REQUIRED”. This is the same for all of the .*decl methods.
If a doctype includes an ATTLIST declaration, it will cause this method to be called. The content is the declaration itself, unparsed. EG, <!ATTLIST el attr CDATA REQUIRED> will come to this method as “el attr CDATA REQUIRED”. This is the same for all of the .*decl methods.
Writes pemmable
, which must respond to to_pem
to path
with the given permissions
. If passed cipher
and passphrase
those arguments will be passed to to_pem
.
The host to connect to either from the RUBYGEMS_HOST environment variable or from the user’s configuration
Zlib::GzipReader
wrapper that unzips data
.
Zlib::GzipWriter
wrapper that zips data
.
SecureRandom.alphanumeric generates a random alphanumeric string.
The argument n specifies the length, in characters, of the alphanumeric string to be generated.
If n is not specified or is nil, 16 is assumed. It may be larger in the future.
The result may contain A-Z, a-z and 0-9.
require 'securerandom' SecureRandom.alphanumeric #=> "2BuBuLf3WfSKyQbR" SecureRandom.alphanumeric(10) #=> "i6K93NdqiH"
If a secure random number generator is not available, NotImplementedError
is raised.
Set
the real user ID of the calling process to user. Not available on all platforms.
Set
the real group ID of the calling process to group. Not available on all platforms.