lib/ruby/shared/rubygems/dependency_list.rb
##
# Return a hash of predecessors.  <tt>result[spec]</tt> is an Array of
# gemspecs that have a dependency satisfied by the named gemspec.
Return a hash of predecessors. result[spec] is an Array of
gemspecs that have a dependency satisfied by the named gemspec.
Return a hash of predecessors . result [ spec ] is an Array of gemspecs that have a dependency satisfied by the named gemspec .
def spec_predecessors
    result = Hash.new { |h,k| h[k] = [] }
    specs = @specs.sort.reverse
    specs.each do |spec|
      specs.each do |other|
        next if spec == other
        other.dependencies.each do |dep|
          if spec.satisfies_requirement? dep then
            result[spec] << other
          end
        end
      end
    end
    result
  end
def spec_predecessors result = Hash . new { | h , k | h [ k ] = [ ] } specs = @specs . sort . reverse specs . each do | spec | specs . each do | other | next if spec == other other . dependencies . each do | dep | if spec . satisfies_requirement? dep then result [ spec ] << other end end end end result end
Return a hash of predecessors.
Return a hash of predecessors .