Creates a new package that will read or write to the file gem
.
True if the requirement will not always match the latest version.
Replaces this SourceList
with the sources in other
See <<
for acceptable items in other
.
Normalize the list of files so that:
All file lists have redundancies removed.
Files referenced in the extra_rdoc_files
are included in the package file list.
Checks that the specification contains all required fields, and does a very basic sanity check.
Raises InvalidSpecificationException if the spec does not pass the checks..
Does a sanity check on the specification.
Raises InvalidSpecificationException if the spec does not pass the checks.
It also performs some validations that do not raise but print warning messages instead.
Normalize the URI
by adding “http://” if it is missing.
Prints a formatted backtrace to the errors stream if backtraces are enabled.
Checks the gem directory for the following potential inconsistencies/problems:
Checksum gem itself
For each file in each gem, check consistency of installed versions
Check for files that aren’t part of the gem but are in the gems directory
1 cache - 1 spec - 1 directory.
returns a hash of ErrorData objects, keyed on the problem gem’s name.
Returns the lines matched by the current scan as an array of CodeLines
Return an array of CodeLines in the document
Replaces self by other URI
object.
Returns true if URI
is hierarchical.
URI
has components listed in order of decreasing significance from left to right, see RFC3986 www.rfc-editor.org/rfc/rfc3986 1.2.3.
require 'uri' uri = URI.parse("http://my.example.com/") uri.hierarchical? #=> true uri = URI.parse("mailto:joe@example.com") uri.hierarchical? #=> false
Returns normalized URI
.
require 'uri' URI("HTTP://my.EXAMPLE.com").normalize #=> #<URI::HTTP http://my.example.com/>
Normalization here means:
scheme and host are converted to lowercase,
an empty path component is set to “/”.
Destructive version of normalize
.
Attempts to parse other URI
oth
, returns [parsed_oth, self].
require 'uri' uri = URI.parse("http://my.example.com") uri.coerce("http://foo.com") #=> [#<URI::HTTP http://foo.com>, #<URI::HTTP http://my.example.com>]
Returns a split URI
against regexp[:ABS_URI]
.
Replaces the contents of the database with the contents of the specified object. Takes any object which implements the each_pair
method, including Hash
and DBM
objects.
Returns:
true
if the process has completed successfully and exited.
false
if the process has completed unsuccessfully and exited.
nil
if the process has not exited.
Receive a message to the port (which was sent there by Port#send
).
port = Ractor::Port.new r = Ractor.new port do |port| port.send('message1') end v1 = port.receive puts "Received: #{v1}" r.join # Here will be printed: "Received: message1"
The method blocks if the message queue is empty.
port = Ractor::Port.new r = Ractor.new port do |port| wait puts "Still not received" port.send('message1') wait puts "Still received only one" port.send('message2') end puts "Before first receive" v1 = port.receive puts "Received: #{v1}" v2 = port.receive puts "Received: #{v2}" r.join
Output:
Before first receive Still not received Received: message1 Still received only one Received: message2
If close_incoming was called on the ractor, the method raises Ractor::ClosedError
if there are no more messages in the message queue:
port = Ractor::Port.new port.close port.receive #=> raise Ractor::ClosedError
Releases the lock and sleeps timeout
seconds if it is given and non-nil or forever. Raises ThreadError
if mutex
wasn’t locked by the current thread.
When the thread is next woken up, it will attempt to reacquire the lock.
Note that this method can wakeup without explicit Thread#wakeup
call. For example, receiving signal and so on.
Returns the slept time in seconds if woken up, or nil
if timed out.