ruby/lib/rubygems/specification.rb
##
# Recursively walk dependencies of this spec, executing the +block+ for each
# hop.
Recursively walk dependencies of this spec, executing the +block+ for each
hop.
Recursively walk dependencies of this spec executing the + block + for each hop .
def traverse trail = [], visited = {}, &block
    trail.push(self)
    begin
      dependencies.each do |dep|
        next unless dep.runtime?
        dep.to_specs.each do |dep_spec|
          next if visited.has_key?(dep_spec)
          visited[dep_spec] = true
          trail.push(dep_spec)
          begin
            result = block[self, dep, dep_spec, trail]
          ensure
            trail.pop
          end
          unless result == :next
            spec_name = dep_spec.name
            dep_spec.traverse(trail, visited, &block) unless
              trail.any? { |s| s.name == spec_name }
          end
        end
      end
    ensure
      trail.pop
    end
  end
def traverse trail = [ ] , visited = { } , & block trail . push ( self ) begin dependencies . each do | dep | next unless dep . runtime? dep . to_specs . each do | dep_spec | next if visited . has_key? ( dep_spec ) visited [ dep_spec ] = true trail . push ( dep_spec ) begin result = block [ self , dep , dep_spec , trail ] ensure trail . pop end unless result == :next spec_name = dep_spec . name dep_spec . traverse ( trail , visited , & block ) unless trail . any? { | s | s . name == spec_name } end end end ensure trail . pop end end
Recursively walk dependencies of this spec, executing the +block+ for each
hop.
Recursively walk dependencies of this spec executing the + block + for each hop .
trail
<not_specific>
visited
<not_specific>
block
<not_specific>