Skip to content

Latest commit

 

History

History
272 lines (214 loc) · 14.1 KB

TODO.org

File metadata and controls

272 lines (214 loc) · 14.1 KB

R0.7.0

Start using signed tags from R0.7.0

Add a check in the Tree::TreeNode.add method to prevent addition of nil child nodes

Fix the edge condition for Tree::TreeNode.isOnlyChild? when the root node is the receiver.

There really is no good default to this situation. We will return ‘true’ simply because there is no other sibling to a root. However, a good case can be made that a root node does not have any parent either.

Add a convenience ‘level’ method to the TreeNode class (will be an alias to nodeDepth)

Add a API-CHANGES file to document the various API changes made till date

Add new methods to return the degree counts of the receiver node (in-degree and out-degree)

R0.8.0

Convert all method names to the canonical ^[_a-z<>=\[|+-\\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/ pattern

See Roodi report at http://getcaliper.com/caliper/tool?tool=roodi&repo=git://github.com/evolve75/RubyTree.git

Integrate the subtree cloning patch submitted by Vincenzo Farrugia.

R0.8.1

Fix bug #28613 which was affecting the `leftChild=’ and `rightChild=’ methods for binary trees.

R0.8.3

This is a bugfix release.

Make Rubytree compatible with Bundler

Make Rubytree compatible wth gem-testers

Remove the dependency on Hoe

Resolve the tree.rb file conflict with the netaddr gem

Issue #8

Update documentation to be more explicit about duplicate node names

Issue #7 Update documentation for :name attribute in tree.rb. There is no specific code fix needed.

Allow integers to be used as node names (clarify the scenario). Fixed issue #6.

Issue #6 We will need to warn the user when an Integer is used as a name for the node (but still allow the usage), and also add an optional flag to the TreeNode#[] method to allow the user to explicitly indicate use of the Integer parameter as a literal name, and not as an index to the children array.

Clarify (or fix) the scenario whether a root node without children is a leaf

Issue http://rubyforge.org/tracker/index.php?func=detail&aid=29549&group_id=1215&atid=4793
tree.each_leaf do |tree_leaf|
  tree_leaf_parent = tree_leaf.parent
  tree_leaf.remove_from_parent!
  puts tree_leaf_parent.is_leaf?
end

will return false, while technically tree_leaf_parent becomes leaf itself when tree_leaf is removed.

The problem here is that the code above is trying to concurrently modify the collection over which the each_leaf iterator is looping, which has unpredicable results. As an example, try this with an array:

a = Array(1..5)
a.each do |e|
  a.delete(e)
end
a

The result is surprising, as not all elements are being deleted. A good explanation is available in this thread on Ruby-Talk @ Google.

The correct way to handle the original need is:

leafs = @root.each_leaf
parents = leafs.collect {|leaf| leaf.parent }
leafs.each {|leaf| leaf.remove_from_parent!}
parents.each {|parent| assert(parent.is_leaf?) if not parent.has_children?}

Basically, the parent removal is done in a separate block, and then the check for the parents becoming leafs is done.

Fix the first_sibling and last_sibling for the root

The current behavior is correct, and has been left as is.

Fix the siblings method to return an empty array for root

Fix the TreeNode#root method to return nil for root’s root.

Left the code as-is, since we need some way to un-ambiguously find the root, regardless of the node given.

R0.9.0

This release contains the following features and fixes:

  1. Ability to merge in another tree at a chosen node
  2. Support for the Comparable mixin module
  3. Ability to export the tree to a hash, and create a new tree from another existing hash
  4. Fix (partial) for preventing cyclic graphs in the tree
  5. Refactored each method to prevent stack errors while navigating deep trees
  6. Check to ensure that the added node’s name is unique to the destination tree
  7. Fix for the issue where tree traversal would fail if the binary-tree’s left child was nil
  8. Fixed the return type for the iterator methods (each, postordered_each, breadth_each, etc.). They now return an Enumerator if no block is provided, or else return the receiver node itself, if a block was provided. This is consistent with how Ruby’s standard collections work
  9. Structural changes in the code to refactor out the non-core functions into modules
  10. Massive documentation updates
  11. Addition of the examples directory (only a bare-bones placeholder for now, with the basic example code)
  12. Ability to run the examples from the Rakefile
  13. Various bundler and travis-ci related changes

Fix the stack exhaustion issue due to deep recursion on very large unbalanced trees

See Issue #12. The following methods need fixes:

Extract non-essential methods from Tree::TreeNode into separate files.

  • [X] Handling of CamelCase methods
  • [X] Convertion to and from JSON
  • [X] The merge feature
  • [X] The metrics measurements

Fix the documentation strings for the methods (the Yard attributes)

Implement an `inordered_each` method for the BinaryTree

Add some example code to the Gem

Pull in the unique node name validation from ysf

Will need to make this configurable.

Pull in the tree merge feature from Dazoakley

Rename the COPYING.rdoc file to LICENSING.rdoc

Fix the inconsistency of returning root as its first sibling, and returning a nil instead. Ditto for last sibling.

This is actually consistent.

fix the inconsistency of returning nil for the root, and an empty array for nodes which have no siblings.

Already fixed in R0.8.3.

We should perhaps return nil as root’s root. (Scrapped).

This proposed change does make sense at one level (since the root node does not have any parent), but returning root as root’s root (no pun intended) makes accessing the root from anywhere in the tree much easier.

R0.9.5

Add the `#get_path_as_string` method from feature request #48

Fix Issue #32 and enable move semantics on the TreeNode#add method.

Check the lazy initialization of @node_depth and changes in parent nodes

Pull the performance improvements from Aidan #37

Pull the hash converter code from Mark Thomas (Issue #13).

This was contributed by @jhamon.

Misc. bug fixes

R2.0.0

This is primarily a modernization of the library, with removal of deprecated methods, the much-hated dependency on structured_warnings, and cleanup of other cruft.

In addition, the CI pipeline has been moved from https://travis.ci to Github Actions.

  • [X] Merge the modernization PR from @jmortlock (multiple changes).
  • [X] Update the documentation to reflect the modernization changes.

Unplanned / Not assigned to any release

Convert all documentation to markdown mode.

[#A] Resolve the infinite loop bug if a node is added to itself as a child

Issue #5.

This is a subtle problem to resolve. The specific case of a node being added to itself is trivial to resolve, and the fix has been put in for 0.8.3.

However, the general problem is that in the current code, a node can be added as a child to any portion of the tree down the hierarchy (e.g., as a grandchild), which will need a more thorough detection code in the TreeNode#add method, if it is to be done at runtime.

The issue is really to prevent the tree becoming a graph. Note that the issue is with duplicate nodes, not duplicated content.

A few options exist:

  1. Perform a runtime check in the TreeNode#add method. This will cause a performance hit as the tree becomes larger.
  2. Allow the additions to go through, but create a new validate method that checks for such cycles.
  3. Create separate configuration object which can be attached to the root of the tree, which allows per-tree configuration of the behavior - this does allow for the user to take control, but also introduces complications during tree mergers and spitting subtrees.
  4. Create a registry (to be maintained at the root?) of all nodes, and use this for validating the node additions (and preventing duplicates). This needs to be a hash (to allow O(1) access), and will sacrifice memory. There might be a need to restructure the internals to make better use of memory.

Expand the examples section, and add supporting documentation

Create a cycle-detection/validation mechanism to prevent cyclic graphs of nodes.

Create a generic validation method to check for various issues in the created tree.

Add a FAQ document to the project.

The semantic of length is probably unclear. Should return the node_depth instead (or remove the method)

The current equivalence of length to size should also be removed.

Create the basic UML diagrams and upload to the Site

Add a YAML export method to the TreeNode class.

marshal_load method probably should be a class method. It currently clobbers self.

Revert the forced install of rubygem 2.1.11 from .travis.yml

The issue seems to have been resolved with the 2.2.1 release of Rubygems.

[#A] Migrate the website and references from http://rubyforge.org/

Fix bug # 22535: The method Tree::TreeNode#depth is a misnomer. The current definition actually provides the height function.

Get the version control moved from CVS to Subversion (request submitted to RubyForge)

Add logic in Rakefile to read the file list from Manifest.txt file.