@return [Array] specs of default gems that are ‘==` to the given `spec`.
Does this dependency request match spec
?
NOTE: match?
only matches prerelease versions when dependency
is a prerelease dependency.
Return all files in this gem that match for glob
.
@return true if the specs of any default gems are ‘==` to the given `spec`.
Formats time
as an IMAP-style date.
Formats time
as an IMAP-style date-time.
Downloads uri
and returns it as a String
.
A recommended version for use with a ~> Requirement.
@api private
Does this dependency request match spec
?
NOTE: matches_spec?
matches prerelease versions. See also match?
Returns the contents of this Tms
object as a formatted string, according to a format
string like that passed to Kernel.format
. In addition, format
accepts the following extensions:
%u
Replaced by the user CPU time, as reported by Tms#utime
.
%y
Replaced by the system CPU time, as reported by stime
(Mnemonic: y of “s*y*stem”)
%U
Replaced by the children’s user CPU time, as reported by Tms#cutime
%Y
Replaced by the children’s system CPU time, as reported by Tms#cstime
%t
Replaced by the total CPU time, as reported by Tms#total
%r
Replaced by the elapsed real time, as reported by Tms#real
%n
Replaced by the label string, as reported by Tms#label
(Mnemonic: n of “*n*ame”)
If format
is not given, FORMAT
is used as default value, detailing the user, system and real elapsed time.
Returns the field value as specified by header
.
With the single argument header
, returns the field value for that header (first found):
source = "Name,Name,Name\nFoo,Bar,Baz\n" table = CSV.parse(source, headers: true) row = table[0] row.fetch('Name') # => "Foo"
Raises exception KeyError
if the header does not exist.
With arguments header
and default
given, returns the field value for the header (first found) if the header exists, otherwise returns default
:
source = "Name,Name,Name\nFoo,Bar,Baz\n" table = CSV.parse(source, headers: true) row = table[0] row.fetch('Name', '') # => "Foo" row.fetch(:nosuch, '') # => ""
With argument header
and a block given, returns the field value for the header (first found) if the header exists; otherwise calls the block and returns its return value:
source = "Name,Name,Name\nFoo,Bar,Baz\n" table = CSV.parse(source, headers: true) row = table[0] row.fetch('Name') {|header| fail 'Cannot happen' } # => "Foo" row.fetch(:nosuch) {|header| "Header '#{header} not found'" } # => "Header 'nosuch not found'"
Sends a FETCH command to retrieve data associated with a message in the mailbox.
The set
parameter is a number or a range between two numbers, or an array of those. The number is a message sequence number, where -1 represents a ‘*’ for use in range notation like 100..-1 being interpreted as ‘100:*’. Beware that the exclude_end?
property of a Range
object is ignored, and the contents of a range are independent of the order of the range endpoints as per the protocol specification, so 1…5, 5..1 and 5…1 are all equivalent to 1..5.
attr
is a list of attributes to fetch; see the documentation for Net::IMAP::FetchData
for a list of valid attributes.
The return value is an array of Net::IMAP::FetchData
or nil (instead of an empty array) if there is no matching message.
For example:
p imap.fetch(6..8, "UID") #=> [#<Net::IMAP::FetchData seqno=6, attr={"UID"=>98}>, \\ #<Net::IMAP::FetchData seqno=7, attr={"UID"=>99}>, \\ #<Net::IMAP::FetchData seqno=8, attr={"UID"=>100}>] p imap.fetch(6, "BODY[HEADER.FIELDS (SUBJECT)]") #=> [#<Net::IMAP::FetchData seqno=6, attr={"BODY[HEADER.FIELDS (SUBJECT)]"=>"Subject: test\r\n\r\n"}>] data = imap.uid_fetch(98, ["RFC822.SIZE", "INTERNALDATE"])[0] p data.seqno #=> 6 p data.attr["RFC822.SIZE"] #=> 611 p data.attr["INTERNALDATE"] #=> "12-Oct-2000 22:40:59 +0900" p data.attr["UID"] #=> 98
Fetches item k
from the tuple.
Fetches key
from the tuple.
Cached RemoteFetcher
instance.
Default fetcher instance. Use this instead of ::new
to reduce object allocation.
Return value associated with key
.
If there is no value for key
and no block is given, returns ifnone
.
Otherwise, calls block passing in the given key
.
See ::DBM#fetch
for more information.
Returns the header field corresponding to the case-insensitive key. Returns the default value args
, or the result of the block, or raises an IndexError
if there’s no header field named key
See Hash#fetch