Patterns used to parse URI’s
Indicates no such domain was found.
Domain Name
resource abstract class.
An error caused by searching for a dependency that is completely unknown, i.e. has no versions available whatsoever.
A state that encapsulates a set of {#requirements} with an {Array} of possibilities
A state that encapsulates a single possibility to fulfill the given {#requirement}
@!visibility private
Provides information about specifications and dependencies to the resolver, allowing the {Resolver} class to remain generic while still providing power and flexibility.
This module contains the methods that users of Gem::Resolver::Molinillo
must to implement, using knowledge of their own model classes.
@!visibility private @see DependencyGraph#detach_vertex_named
Delegates
all {Gem::Resolver::Molinillo::ResolutionState} methods to a ‘#state` property.
Delegates
all {Gem::Resolver::Molinillo::SpecificationProvider} methods to a ‘#specification_provider` property.
Returns a MatchData object (or nil
) based on self
and the given pattern
.
Note: also updates Special global variables at Regexp
.
Computes regexp
by converting pattern
(if not already a Regexp).
regexp = Regexp.new(pattern)
Computes matchdata
, which will be either a MatchData object or nil
(see Regexp#match
):
matchdata = <tt>regexp.match(self)
With no block given, returns the computed matchdata
:
'foo'.match('f') # => #<MatchData "f"> 'foo'.match('o') # => #<MatchData "o"> 'foo'.match('x') # => nil
If Integer argument offset
is given, the search begins at index offset
:
'foo'.match('f', 1) # => nil 'foo'.match('o', 1) # => #<MatchData "o">
With a block given, calls the block with the computed matchdata
and returns the block’s return value:
'foo'.match(/o/) {|matchdata| matchdata } # => #<MatchData "o"> 'foo'.match(/x/) {|matchdata| matchdata } # => nil 'foo'.match(/f/, 1) {|matchdata| matchdata } # => nil
Returns true
or false
based on whether a match is found for self
and pattern
.
Note: does not update Special global variables at Regexp
.
Computes regexp
by converting pattern
(if not already a Regexp).
regexp = Regexp.new(pattern)
Returns true
if self+.match(regexp)
returns a MatchData object, false
otherwise:
'foo'.match?(/o/) # => true 'foo'.match?('o') # => true 'foo'.match?(/x/) # => false
If Integer argument offset
is given, the search begins at index offset
:
'foo'.match?('f', 1) # => false 'foo'.match?('o', 1) # => true
Return the matchee associated with this NoMatchingPatternKeyError
exception.
With no block given, returns the MatchData
object that describes the match, if any, or nil
if none; the search begins at the given character offset
in string
:
/abra/.match('abracadabra') # => #<MatchData "abra"> /abra/.match('abracadabra', 4) # => #<MatchData "abra"> /abra/.match('abracadabra', 8) # => nil /abra/.match('abracadabra', 800) # => nil string = "\u{5d0 5d1 5e8 5d0}cadabra" /abra/.match(string, 7) #=> #<MatchData "abra"> /abra/.match(string, 8) #=> nil /abra/.match(string.b, 8) #=> #<MatchData "abra">
With a block given, calls the block if and only if a match is found; returns the block’s value:
/abra/.match('abracadabra') {|matchdata| p matchdata } # => #<MatchData "abra"> /abra/.match('abracadabra', 4) {|matchdata| p matchdata } # => #<MatchData "abra"> /abra/.match('abracadabra', 8) {|matchdata| p matchdata } # => nil /abra/.match('abracadabra', 8) {|marchdata| fail 'Cannot happen' } # => nil
Output (from the first two blocks above):
#<MatchData "abra"> #<MatchData "abra"> /(.)(.)(.)/.match("abc")[2] # => "b" /(.)(.)/.match("abc", 1)[2] # => "c"
Returns true
or false
to indicate whether the regexp is matched or not without updating $~ and other related variables. If the second parameter is present, it specifies the position in the string to begin the search.
/R.../.match?("Ruby") # => true /R.../.match?("Ruby", 1) # => false /P.../.match?("Ruby") # => false $& # => nil
Equivalent to self.to_s.match
, including possible updates to global variables; see String#match
.