# File lib/r10k/semver.rb, line 96
  def matched_by?(pattern)
    # For the time being, this is restricted to exact version matches and
    # simple range patterns.  In the future, we should implement some or all of
    # the comparison operators here:
    # https://github.com/isaacs/node-semver/blob/d474801/semver.js#L340

    case pattern
    when SIMPLE_RANGE
      pattern = SIMPLE_RANGE.match(pattern).captures
      pattern[1] = @minor unless pattern[1] && pattern[1] !~ /x/i
      pattern[2] = @tiny  unless pattern[2] && pattern[2] !~ /x/i
      [@major, @minor, @tiny] == pattern.map { |x| x.to_i }
    when VERSION
      self == SemVer.new(pattern)
    else
      false
    end
  end