class Gem::Dependency

def encode_with(coder)

def encode_with(coder)
  to_yaml_properties.each do |ivar|
    coder[ivar.to_s.sub(/^@/, '')] = instance_variable_get(ivar)
  end
end

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?)

def required_by

def required_by
  @required_by ||= []
end

def requirement

def requirement
  version_requirements
end

def to_lock

def to_lock
  out = "  #{name}"
  unless requirement == Gem::Requirement.default
    reqs = requirement.requirements.map{|o,v| "#{o} #{v}" }.sort.reverse
    out << " (#{reqs.join(', ')})"
  end
  out
end

def to_yaml_properties

def to_yaml_properties
  instance_variables.reject { |p| ["@source", "@groups"].include?(p.to_s) }
end