class Gem::Dependency

def matches_spec?(spec)

Backport of performance enhancement added to RubyGems 1.4
def matches_spec?(spec)
  # name can be a Regexp, so use ===
  return false unless name === spec.name
  return true  if requirement.none?
  requirement.satisfied_by?(spec.version)
end unless allocate.respond_to?(:matches_spec?)