def depth_first nodes
        nodes = [ nodes ] if not nodes.is_a?(Array)
        stack = [ [ nodes.shift, 0 ] ]
        Enumerator.new do |yielder|
          while not stack.empty?
            node, depth = stack.pop
            node = resolve_node(node)
            next if not node
            yielder << [ node, depth ]
            if node.folder?
              stack += node.children.reverse.map { |n| [ n, depth + 1 ] }
            end
            if stack.empty? and not nodes.empty?
              stack << [ nodes.shift, 0 ]
            end
          end
        end
      end
def depth_first nodes
        nodes = [ nodes ] if not nodes.is_a?(Array)
        stack = [ [ nodes.shift, 0 ] ]
        Enumerator.new do |yielder|
          while not stack.empty?
            node, depth = stack.pop
            node = resolve_node(node)
            next if not node
            yielder << [ node, depth ]
            if node.folder?
              stack += node.children.reverse.map { |n| [ n, depth + 1 ] }
            end
            if stack.empty? and not nodes.empty?
              stack << [ nodes.shift, 0 ]
            end
          end
        end
      end
:nodoc: