Performs elliptic curve point multiplication.
The first form calculates bn1 * point + bn2 * G
, where G
is the generator of the group of point. bn2 may be omitted, and in that case, the result is just bn1 * point
.
The second form calculates bns[0] * point + bns[1] * points[0] + ... + bns[-1] * points[-1] + bn2 * G
. bn2 may be omitted. bns must be an array of OpenSSL::BN
. points must be an array of OpenSSL::PKey::EC::Point
. Please note that points[0]
is not multiplied by bns[0]
, but bns[1]
.
Is this tar entry a file?
Returns a string representation of lex_state.
Returns true for IPv6 multicast node-local scope address. It returns false otherwise.
Displays helpfile. The 1st argument specifies WIN32OLE_TYPE object or WIN32OLE_METHOD object or helpfile.
excel = WIN32OLE.new('Excel.Application') typeobj = excel.ole_type WIN32OLE.ole_show_help(typeobj)
Returns WIN32OLE
object for a specific dispatch or dual interface specified by iid.
ie = WIN32OLE.new('InternetExplorer.Application') ie_web_app = ie.ole_query_interface('{0002DF05-0000-0000-C000-000000000046}') # => WIN32OLE object for dispinterface IWebBrowserApp
Returns WIN32OLE_TYPE object.
excel = WIN32OLE.new('Excel.Application') tobj = excel.ole_type
Render a template on a new toplevel binding with local variables specified by a Hash
object.
Returns the value of the local variable symbol
.
def foo a = 1 binding.local_variable_get(:a) #=> 1 binding.local_variable_get(:b) #=> NameError end
This method is the short version of the following code:
binding.eval("#{symbol}")
Set
local variable named symbol
as obj
.
def foo a = 1 bind = binding bind.local_variable_set(:a, 2) # set existing local variable `a' bind.local_variable_set(:b, 3) # create new local variable `b' # `b' exists only in binding p bind.local_variable_get(:a) #=> 2 p bind.local_variable_get(:b) #=> 3 p a #=> 2 p b #=> NameError end
This method behaves similarly to the following code:
binding.eval("#{symbol} = #{obj}")
if obj
can be dumped in Ruby code.
Returns true
if a local variable symbol
exists.
def foo a = 1 binding.local_variable_defined?(:a) #=> true binding.local_variable_defined?(:b) #=> false end
This method is the short version of the following code:
binding.eval("defined?(#{symbol}) == 'local-variable'")
Breaks the buffer into lines that are shorter than maxwidth
Returns the value of a thread local variable that has been set. Note that these are different than fiber local values. For fiber local values, please see Thread#[]
and Thread#[]=
.
Thread
local values are carried along with threads, and do not respect fibers. For example:
Thread.new { Thread.current.thread_variable_set("foo", "bar") # set a thread local Thread.current["foo"] = "bar" # set a fiber local Fiber.new { Fiber.yield [ Thread.current.thread_variable_get("foo"), # get the thread local Thread.current["foo"], # get the fiber local ] }.resume }.join.value # => ['bar', nil]
The value “bar” is returned for the thread local, where nil is returned for the fiber local. The fiber is executed in the same thread, so the thread local values are available.
Sets a thread local with key
to value
. Note that these are local to threads, and not to fibers. Please see Thread#thread_variable_get
and Thread#[]
for more information.
For debugging the Ruby/OpenSSL library. Calls CRYPTO_mem_leaks_fp(stderr). Prints detected memory leaks to standard error. This cleans the global state up thus you cannot use any methods of the library after calling this.
Returns true
if leaks detected, false
otherwise.
This is available only when built with a capable OpenSSL
and –enable-debug configure option.
OpenSSL.mem_check_start NOT_GCED = OpenSSL::PKey::RSA.new(256) END { GC.start OpenSSL.print_mem_leaks # will print the leakage }
Safely loads the document contained in filename
. Returns the yaml contained in filename
as a Ruby object, or if the file is empty, it returns the specified fallback
return value, which defaults to false
. See safe_load
for options.
Securely removes the entry given by path
, which should be the entry for a regular file, a symbolic link, or a directory.
Argument path
should be interpretable as a path.
Avoids a local vulnerability that can exist in certain circumstances; see Avoiding the TOCTTOU Vulnerability.
Optional argument force
specifies whether to ignore raised exceptions of StandardError
and its descendants.
Related: methods for deleting.
Securely removes the entry given by path
, which should be the entry for a regular file, a symbolic link, or a directory.
Argument path
should be interpretable as a path.
Avoids a local vulnerability that can exist in certain circumstances; see Avoiding the TOCTTOU Vulnerability.
Optional argument force
specifies whether to ignore raised exceptions of StandardError
and its descendants.
Related: methods for deleting.
Decodes URL-encoded form data from given str
.
This decodes application/x-www-form-urlencoded data and returns an array of key-value arrays.
This refers url.spec.whatwg.org/#concept-urlencoded-parser, so this supports only &-separator, and doesn’t support ;-separator.
ary = URI.decode_www_form("a=1&a=2&b=3") ary #=> [['a', '1'], ['a', '2'], ['b', '3']] ary.assoc('a').last #=> '1' ary.assoc('b').last #=> '3' ary.rassoc('a').last #=> '2' Hash[ary] #=> {"a"=>"2", "b"=>"3"}
Returns a list of paths matching glob
from the latest gems that can be used by a gem to pick up features from other gems. For example:
Gem.find_latest_files('rdoc/discover').each do |path| load path end
if check_load_path
is true (the default), then find_latest_files
also searches $LOAD_PATH for files as well as gems.
Unlike find_files
, find_latest_files
will return only files from the latest version of a gem.
Register a Gem::Specification
for default gem.
Two formats for the specification are supported:
MRI 2.0 style, where spec.files contains unprefixed require names. The spec’s filenames will be registered as-is.
New style, where spec.files contains files prefixed with paths from spec.require_paths. The prefixes are stripped before registering the spec’s filenames. Unprefixed files are omitted.
Paths where RubyGems’ .rb files and bin files are installed
Deduce Ruby’s –program-prefix and –program-suffix from its install name
The default signing key path