Creates a self-signed certificate with an issuer and subject from email
, a subject alternative name of email
and the given extensions
for the key
.
Turns email_address
into an OpenSSL::X509::Name
Deprecation method to deprecate Rubygems commands
Deprecation method to deprecate Rubygems commands
@return [String] a string suitable for debugging
Checks if ios
starts with a BOM, and then consumes it and sets the external encoding. Returns the result encoding if found, or nil. If ios
is not binmode or its encoding has been set already, an exception will be raised.
File.write("bom.txt", "\u{FEFF}abc") ios = File.open("bom.txt", "rb") ios.set_encoding_by_bom #=> #<Encoding:UTF-8> File.write("nobom.txt", "abc") ios = File.open("nobom.txt", "rb") ios.set_encoding_by_bom #=> nil
Returns value specified by the member name of VT_RECORD OLE object. If the member name is not correct, KeyError
exception is raised. If you can’t access member variable of VT_RECORD OLE object directly, use this method.
If COM server in VB.NET ComServer project is the following:
Imports System.Runtime.InteropServices Public Class ComClass Public Structure ComObject Public object_id As Ineger End Structure End Class
and Ruby Object
class has title attribute:
then accessing object_id of ComObject from Ruby is as the following:
srver = WIN32OLE.new('ComServer.ComClass') obj = WIN32OLE_RECORD.new('ComObject', server) # obj.object_id returns Ruby Object#object_id obj.ole_instance_variable_get(:object_id) # => nil
Sets value specified by the member name of VT_RECORD OLE object. If the member name is not correct, KeyError
exception is raised. If you can’t set value of member of VT_RECORD OLE object directly, use this method.
If COM server in VB.NET ComServer project is the following:
Imports System.Runtime.InteropServices Public Class ComClass <MarshalAs(UnmanagedType.BStr)> _ Public title As String Public cost As Integer End Class
then setting value of the ‘title’ member is as following:
srver = WIN32OLE.new('ComServer.ComClass') obj = WIN32OLE_RECORD.new('Book', server) obj.ole_instance_variable_set(:title, "The Ruby Book")
Register an event handler p
which is called every time a line in file_name
is executed.
Example:
Tracer.set_get_line_procs("example.rb", lambda { |line| puts "line number executed is #{line}" })
Re-composes a prime factorization and returns the product.
For the decomposition:
[[p_1, e_1], [p_2, e_2], ..., [p_n, e_n]],
it returns:
p_1**e_1 * p_2**e_2 * ... * p_n**e_n.
pd
Array
of pairs of integers. Each pair consists of a prime number – a prime factor – and a natural number – its exponent (multiplicity).
Prime.int_from_prime_division([[3, 2], [5, 1]]) #=> 45 3**2 * 5 #=> 45
Returns the last win32 socket Error
of the current executing Thread
or nil if none
Sets the last win32 socket Error
of the current executing Thread
to error
If the SOURCE_DATE_EPOCH environment variable is set, returns it’s value. Otherwise, returns the time that ‘Gem.source_date_epoch_string` was first called in the same format as SOURCE_DATE_EPOCH.
NOTE(@duckinator): The implementation is a tad weird because we want to:
1. Make builds reproducible by default, by having this function always return the same result during a given run. 2. Allow changing ENV['SOURCE_DATE_EPOCH'] at runtime, since multiple tests that set this variable will be run in a single process.
If you simplify this function and a lot of tests fail, that is likely due to #2 above.
Details on SOURCE_DATE_EPOCH: reproducible-builds.org/specs/source-date-epoch/
Find
a Gem::Specification
of default gem from path
Initializes this object from orig if it can be duplicated/cloned and returns it.
Rewinds the graph to the state tagged as ‘tag` @param [Object] tag the tag to rewind to @return [Void]