ruby-win32/lib/ruby/site_ruby/1.8/rubygems/dependency_list.rb
# Return a list of the specifications in the dependency list,
# sorted in order so that no spec in the list depends on a gem
# earlier in the list.
#
# This is useful when removing gems from a set of installed gems.
# By removing them in the returned order, you don't get into as
# many dependency issues.
#
# If there are circular dependencies (yuck!), then gems will be
# returned in order until only the circular dependents and anything
# they reference are left.  Then arbitrary gemspecs will be returned
# until the circular dependency is broken, after which gems will be
# returned in dependency order again.
Return a list of the specifications in the dependency list,
sorted in order so that no spec in the list depends on a gem
earlier in the list.

This is useful when removing gems from a set of installed gems.
By removing them in the returned order, you don't get into as
many dependency issues.

If there are circular dependencies (yuck!), then gems will be
returned in order until only the circular dependents and anything
they reference are left.  Then arbitrary gemspecs will be returned
until the circular dependency is broken, after which gems will be
returned in dependency order again.
Return a list of the specifications in the dependency list sorted in order so that no spec in the list depends on a gem earlier in the list . This is useful when removing gems from a set of installed gems . By removing them in the returned order you don ' t get into as many dependency issues . If there are circular dependencies ( yuck! ) then gems will be returned in order until only the circular dependents and anything they reference are left . Then arbitrary gemspecs will be returned until the circular dependency is broken after which gems will be returned in dependency order again .
def dependency_order
    sorted = strongly_connected_components.flatten
    result = []
    seen = {}
    sorted.each do |spec|
      if index = seen[spec.name] then
        if result[index].version < spec.version then
          result[index] = spec
        end
      else
        seen[spec.name] = result.length
        result << spec
      end
    end
    result.reverse
  end
def dependency_order sorted = strongly_connected_components . flatten result = [ ] seen = { } sorted . each do | spec | if index = seen [ spec . name ] then if result [ index ] . version < spec . version then result [ index ] = spec end else seen [ spec . name ] = result . length result << spec end end result . reverse end
Return a list of the specifications in the dependency list,
sorted in order so that no spec in the list depends on a gem
earlier in the list.
Return a list of the specifications in the dependency list sorted in order so that no spec in the list depends on a gem earlier in the list .