def run(dirname = nil, tree_node_visitor = nil, &block)

      #
      # args detection
      #
      if dirname and dirname.respond_to?(:enter_node)
        tree_node_visitor = dirname
        dirname           = nil
      end

      #
      # check dirname
      #
      if @dirname.nil? and dirname.nil?
        raise 'missing starting directory'
      end
      @dirname = dirname if dirname

      #
      # check visitor
      #
      if tree_node_visitor and block
        raise 'cannot use block and parameter together'
      end

      if tree_node_visitor
        @visitor = tree_node_visitor
      end

      if block
        @visitor = TreeNodeVisitor.new(&block)
      end

      unless @visitor
        raise 'missing visitor'
      end

      #
      # finally starts to process
      #
      process_directory(File.expand_path(@dirname))
      @visitor
    end
def run(dirname = nil, tree_node_visitor = nil, &block)

      #
      # args detection
      #
      if dirname and dirname.respond_to?(:enter_node)
        tree_node_visitor = dirname
        dirname           = nil
      end

      #
      # check dirname
      #
      if @dirname.nil? and dirname.nil?
        raise 'missing starting directory'
      end
      @dirname = dirname if dirname

      #
      # check visitor
      #
      if tree_node_visitor and block
        raise 'cannot use block and parameter together'
      end

      if tree_node_visitor
        @visitor = tree_node_visitor
      end

      if block
        @visitor = TreeNodeVisitor.new(&block)
      end

      unless @visitor
        raise 'missing visitor'
      end

      #
      # finally starts to process
      #
      process_directory(File.expand_path(@dirname))
      @visitor
    end
Run the visitor through the directory tree

 @overload run

 @overload run(dirname)
   @param [String] dirname
   @yield define TreeNodeVisitor

 @overload run(tree_node_visitor)
   @param [TreeNodeVisitor]
   @yield define TreeNodeVisitor

 @overload run(dirname, tree_node_visitor)
   @param [String] dirname
   @param [TreeNodeVisitor]
   @yield define TreeNodeVisitor

 @return [TreeNodeVisitor] the visitor

 @example Print the contents of tmp directory
   w = DirTreeWalker.new
   w.run("/tmp") do
     on_visit_leaf_node { |pathname| puts pathname }
   end.run