Make sure the trust directory exists. If it does exist, make sure it’s actually a directory. If not, then create it with the appropriate permissions.
Returns the line number of this frame.
For example, using caller_locations.rb
from Thread::Backtrace::Location
loc = c(0..1).first loc.lineno #=> 2
Returns the same as calling inspect
on the string representation of to_str
@param [Conflict] conflict @return [Array] minimal array of requirements that would cause the passed
conflict to occur.
@param [String] name @return [Object] the requirement that led to a version of a possibility
with the given name being activated.
@return [Boolean] where the requirement of the state we’re unwinding
to directly caused the conflict. Note: in this case, it is impossible for the state we're unwinding to to be a parent of any of the other conflicting requirements (or we would have circularity)
The logical inverse of ‘capture_last_end_same_indent`
When there is an invalid block with an ‘end` missing a keyword right after another `end`, it is unclear where which end is missing the keyword.
Take this example:
class Dog # 1 puts "woof" # 2 end # 3 end # 4
the problem line will be identified as:
> end # 4
This happens because lines 1, 2, and 3 are technically valid code and are expanded first, deemed valid, and hidden. We need to un-hide the matching keyword on line 1. Also work backwards and if there’s a mis-matched end, show it too
Like Enumerable#select
, but chains operation to be lazy-evaluated.
If a block is given, returns a lazy enumerator that will iterate over the given block for each element with an index, which starts from offset
, and returns a lazy enumerator that yields the same values (without the index).
If a block is not given, returns a new lazy enumerator that includes the index, starting from offset
.
offset
the starting index to use
Return the block length of the digest in bytes.
Return the block length of the digest in bytes.
Digest::SHA256.new.block_length * 8 # => 512 Digest::SHA384.new.block_length * 8 # => 1024 Digest::SHA512.new.block_length * 8 # => 1024
Returns the Fiddle::Pointer
of this handle.
Get the underlying pointer for ruby object val
and return it as a Fiddle::Pointer
object.
Returns the integer memory location of this pointer.
Generates a cryptographically strong pseudo-random number in the range 0…range
.
See also the man page BN_rand_range(3).
Generates a random prime number of bit length bits. If safe is set to true
, generates a safe prime. If add is specified, generates a prime that fulfills condition p % add = rem
.