<commit_before># Closure Tree [![Build Status](https://secure.travis-ci.org/mceachen/closure_tree.png?branch=master)](http://travis-ci.org/mceachen/closure_tree)

Closure Tree is a mostly-API-compatible replacement for the
[ancestry](https://github.com/stefankroes/ancestry),
[acts_as_tree](https://github.com/amerine/acts_as_tree) and
[awesome_nested_set](https://github.com/collectiveidea/awesome_nested_set/) gems, giving you:

* Much better mutation performance thanks to the Closure Tree storage algorithm
* Very efficient select performance (again, thanks to Closure Tree)
* Efficient subtree selects
* Support for polymorphism [STI](#sti) within the hierarchy
* [```find_or_create_by_path```](#find_or_create_by_path) for building out hierarchies quickly
* Support for [deterministic ordering](#deterministic-ordering) of children
* Excellent [test coverage](#testing) in a variety of environments

## Installation
<commit_msg>return Karwin's presentation/explanation of closure trees<commit_after># Closure Tree [![Build Status](https://secure.travis-ci.org/mceachen/closure_tree.png?branch=master)](http://travis-ci.org/mceachen/closure_tree)

Closure Tree is a mostly-API-compatible replacement for the
[ancestry](https://github.com/stefankroes/ancestry),
[acts_as_tree](https://github.com/amerine/acts_as_tree) and
[awesome_nested_set](https://github.com/collectiveidea/awesome_nested_set/) gems, giving you:

* Much better mutation performance thanks to the Closure Tree storage algorithm
* Very efficient select performance (again, thanks to Closure Tree)
* Efficient subtree selects
* Support for polymorphism [STI](#sti) within the hierarchy
* [```find_or_create_by_path```](#find_or_create_by_path) for building out hierarchies quickly
* Support for [deterministic ordering](#deterministic-ordering) of children
* Excellent [test coverage](#testing) in a variety of environments

See [<NAME>](http://karwin.blogspot.com/)'s excellent
[Models for hierarchical data presentation](http://www.slideshare.net/billkarwin/models-for-hierarchical-data)
for a description of different tree storage algorithms.

## Installation

{'fraction_non_alphanumeric': 0.1134020618556701, 'fraction_numerical': 0.0, 'mean_word_length': 6.936802973977695, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 8, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6377225', 'n_tokens_mistral': 669, 'n_tokens_neox': 619, 'n_words': 163}