rubytree 0.9.5pre6 → 0.9.5pre7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/API-CHANGES.rdoc +11 -11
- data/Gemfile.lock +36 -24
- data/History.rdoc +46 -28
- data/LICENSE.md +1 -1
- data/README.md +31 -21
- data/Rakefile +11 -11
- data/TODO.org +2 -0
- data/gem_graph.png +0 -0
- data/lib/rubytree.rb +13 -13
- data/lib/tree.rb +127 -75
- data/lib/tree/binarytree.rb +48 -31
- data/lib/tree/tree_deps.rb +15 -14
- data/lib/tree/utils/camel_case_method_handler.rb +16 -15
- data/lib/tree/utils/hash_converter.rb +35 -21
- data/lib/tree/utils/json_converter.rb +18 -16
- data/lib/tree/utils/metrics_methods.rb +33 -24
- data/lib/tree/utils/path_methods.rb +92 -0
- data/lib/tree/utils/tree_merge_handler.rb +34 -23
- data/lib/tree/utils/utils.rb +14 -14
- data/lib/tree/version.rb +13 -13
- data/rubytree.gemspec +88 -0
- data/setup.rb +1585 -0
- data/test/test_subclassed_node.rb +5 -0
- data/test/test_tree.rb +73 -0
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bee880224e05a24bf0f7853707f7f6190b59bee3
|
4
|
+
data.tar.gz: 897dd026c0dee7fd529dce01f0f0d607c8848d03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06e226e8187831de6c887da00658722d10521eae1086e61378c03104476f619d77485ad2978e11d401ef839502cc0ea77c4eeda54a7f245c4f13ba45545605b8
|
7
|
+
data.tar.gz: cb29afc5b523d9d217e50f7286d3ee1878cc230ddff04faab0ab27d38d5e75a45f048dbe30e91b393ec7d5c59b3397d3a6dc30688615a8057cb5a801a473ce4f
|
data/API-CHANGES.rdoc
CHANGED
@@ -36,8 +36,8 @@ smooth transition to the new APIs.
|
|
36
36
|
- The traversal methods ({Tree::TreeNode#each},
|
37
37
|
{Tree::TreeNode#preordered_each}, {Tree::TreeNode#postordered_each} and
|
38
38
|
{Tree::TreeNode#breadth_each}) now correctly return an
|
39
|
-
{http://ruby-doc.org/core-1.8.7/Enumerable.html Enumerator} as the
|
40
|
-
|
39
|
+
{http://ruby-doc.org/core-1.8.7/Enumerable.html Enumerator} as the return
|
40
|
+
value when no block is given, and return the receiver node if a block was
|
41
41
|
provided. This is consistent with how the standard Ruby collections work.
|
42
42
|
|
43
43
|
== Release 0.8.3 Changes
|
@@ -67,12 +67,12 @@ smooth transition to the new APIs.
|
|
67
67
|
- {Tree::TreeNode#[]}
|
68
68
|
- {Tree::BinaryTreeNode#add}
|
69
69
|
|
70
|
-
- Added {Tree::Utils::TreeMetricsHandler#level Tree::TreeNode#level} as an alias
|
71
|
-
{Tree::Utils::TreeMetricsHandler#node_depth Tree::TreeNode#node_depth}
|
70
|
+
- Added {Tree::Utils::TreeMetricsHandler#level Tree::TreeNode#level} as an alias
|
71
|
+
for {Tree::Utils::TreeMetricsHandler#node_depth Tree::TreeNode#node_depth}
|
72
72
|
|
73
73
|
- Added new methods {Tree::Utils::TreeMetricsHandler#in_degree
|
74
|
-
Tree::TreeNode#in_degree} and {Tree::Utils::TreeMetricsHandler#out_degree
|
75
|
-
to report the node's degree stats
|
74
|
+
Tree::TreeNode#in_degree} and {Tree::Utils::TreeMetricsHandler#out_degree
|
75
|
+
Tree::TreeNode#out_degree} to report the node's degree stats
|
76
76
|
|
77
77
|
- {Tree::TreeNode#is_only_child?} now returns +true+ for a root node.
|
78
78
|
|
@@ -82,15 +82,15 @@ smooth transition to the new APIs.
|
|
82
82
|
- {Tree::TreeNode#add} and {Tree::TreeNode#<<} now throw an ArgumentError
|
83
83
|
exception if a +nil+ node is passed as an argument.
|
84
84
|
|
85
|
-
- Added new methods {Tree::Utils::JSONConverter#to_json Tree::TreeNode#to_json}
|
86
|
-
{Tree::Utils::JSONConverter::ClassMethods#json_create
|
87
|
-
convert to/from the JSON format. Thanks to
|
85
|
+
- Added new methods {Tree::Utils::JSONConverter#to_json Tree::TreeNode#to_json}
|
86
|
+
and {Tree::Utils::JSONConverter::ClassMethods#json_create
|
87
|
+
Tree::TreeNode#json_create} to convert to/from the JSON format. Thanks to
|
88
88
|
Dirk[http://github.com/railsbros-dirk] for this change.
|
89
89
|
|
90
90
|
== Release 0.6.1 Changes
|
91
91
|
|
92
|
-
- Deprecated the {Tree::Utils::TreeMetricsHandler#depth} method as it was
|
93
|
-
depth value. Have introduced a new replacement method
|
92
|
+
- Deprecated the {Tree::Utils::TreeMetricsHandler#depth} method as it was
|
93
|
+
returning an incorrect depth value. Have introduced a new replacement method
|
94
94
|
{Tree::Utils::TreeMetricsHandler#node_depth} which returns the correct result.
|
95
95
|
|
96
96
|
# Local Variables:
|
data/Gemfile.lock
CHANGED
@@ -1,43 +1,52 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rubytree (0.9.
|
4
|
+
rubytree (0.9.5pre7)
|
5
5
|
json (~> 1.8)
|
6
|
-
structured_warnings (~> 0.
|
6
|
+
structured_warnings (~> 0.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
coveralls (0.
|
12
|
-
|
13
|
-
rest-client (
|
14
|
-
simplecov (
|
15
|
-
term-ansicolor (
|
16
|
-
thor (
|
11
|
+
coveralls (0.8.1)
|
12
|
+
json (~> 1.8)
|
13
|
+
rest-client (>= 1.6.8, < 2)
|
14
|
+
simplecov (~> 0.10.0)
|
15
|
+
term-ansicolor (~> 1.3)
|
16
|
+
thor (~> 0.19.1)
|
17
17
|
docile (1.1.5)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
domain_name (0.5.24)
|
19
|
+
unf (>= 0.0.5, < 1.0.0)
|
20
|
+
http-cookie (1.0.2)
|
21
|
+
domain_name (~> 0.5)
|
22
|
+
json (1.8.2)
|
23
|
+
mime-types (2.6.1)
|
24
|
+
netrc (0.10.3)
|
25
|
+
power_assert (0.2.3)
|
22
26
|
rake (10.4.2)
|
23
27
|
rdoc (4.2.0)
|
24
|
-
rest-client (1.
|
25
|
-
|
28
|
+
rest-client (1.8.0)
|
29
|
+
http-cookie (>= 1.0.2, < 2.0)
|
30
|
+
mime-types (>= 1.16, < 3.0)
|
31
|
+
netrc (~> 0.7)
|
26
32
|
rtags (0.97)
|
27
33
|
rtagstask (0.0.4)
|
28
34
|
rtags (> 0.0.0)
|
29
|
-
simplecov (0.
|
35
|
+
simplecov (0.10.0)
|
30
36
|
docile (~> 1.1.0)
|
31
|
-
|
32
|
-
simplecov-html (~> 0.
|
33
|
-
simplecov-html (0.
|
34
|
-
structured_warnings (0.
|
35
|
-
term-ansicolor (1.
|
36
|
-
tins (~> 0
|
37
|
-
test-unit (3.
|
37
|
+
json (~> 1.8)
|
38
|
+
simplecov-html (~> 0.10.0)
|
39
|
+
simplecov-html (0.10.0)
|
40
|
+
structured_warnings (0.2.0)
|
41
|
+
term-ansicolor (1.3.0)
|
42
|
+
tins (~> 1.0)
|
43
|
+
test-unit (3.1.1)
|
38
44
|
power_assert
|
39
|
-
thor (0.
|
40
|
-
tins (
|
45
|
+
thor (0.19.1)
|
46
|
+
tins (1.5.2)
|
47
|
+
unf (0.1.4)
|
48
|
+
unf_ext
|
49
|
+
unf_ext (0.0.7.1)
|
41
50
|
yard (0.8.7.6)
|
42
51
|
|
43
52
|
PLATFORMS
|
@@ -52,3 +61,6 @@ DEPENDENCIES
|
|
52
61
|
rubytree!
|
53
62
|
test-unit (~> 3.0)
|
54
63
|
yard (~> 0.8)
|
64
|
+
|
65
|
+
BUNDLED WITH
|
66
|
+
1.10.2
|
data/History.rdoc
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
= History of Changes
|
4
4
|
|
5
|
+
=== 0.9.5pre7 / 2015-05-30
|
6
|
+
|
7
|
+
* Added new methods for getting the path of a node as a string. These have been
|
8
|
+
added as a new mixin {Tree::Utils::TreePathHandler}. Thanks to
|
9
|
+
{https://github.com/MZic Marco Ziccardi}.
|
10
|
+
|
5
11
|
=== 0.9.5pre5 / 2015-01-01
|
6
12
|
|
7
13
|
* Fixed {issue 32}[https://github.com/evolve75/RubyTree/issues/32] and enabled
|
@@ -12,7 +18,8 @@
|
|
12
18
|
=== 0.9.5pre4 / 2014-12-17
|
13
19
|
|
14
20
|
* Added performance improvements to {Tree::TreeNode#is_root?} and
|
15
|
-
{Tree::Utils::TreeMetricsHandler#node_depth}.
|
21
|
+
{Tree::Utils::TreeMetricsHandler#node_depth}.
|
22
|
+
Thanks to {https://github.com/aidansteele Aidan Steel}.
|
16
23
|
|
17
24
|
=== 0.9.5pre3 / 2014-12-16
|
18
25
|
|
@@ -65,8 +72,9 @@ This is a feature and bug-fix release.
|
|
65
72
|
|
66
73
|
==== The Features
|
67
74
|
|
68
|
-
* Rubytree now supports +postordered+ traversal via the
|
69
|
-
|
75
|
+
* Rubytree now supports +postordered+ traversal via the
|
76
|
+
{Tree::TreeNode#postordered_each} method. Thanks to
|
77
|
+
{https://github.com/pdecourcel Paul de Courcel} for this.
|
70
78
|
|
71
79
|
* The Binary tree now supports +inorder+ traversal via the
|
72
80
|
{Tree::BinaryTreeNode#inordered_each} method.
|
@@ -82,8 +90,9 @@ This is a feature and bug-fix release.
|
|
82
90
|
|
83
91
|
* (Partial) fix for preventing cyclic graphs in the tree
|
84
92
|
|
85
|
-
* Refactored the {Tree::TreeNode#each} method to prevent stack errors while
|
86
|
-
deep trees
|
93
|
+
* Refactored the {Tree::TreeNode#each} method to prevent stack errors while
|
94
|
+
navigating deep trees
|
95
|
+
({https://github.com/evolve75/RubyTree/issues/12 issue #12})
|
87
96
|
|
88
97
|
* Check to ensure that the added node's name is unique to the destination tree
|
89
98
|
({https://github.com/evolve75/RubyTree/pull/9 merge #9}). Thanks to
|
@@ -126,8 +135,9 @@ This is a primarily a bug-fix release, with some packaging changes.
|
|
126
135
|
|
127
136
|
* Included support for {Bundler}[http://gembundler.com/].
|
128
137
|
|
129
|
-
* Implemented the {Tree::Utils::JSONConverter#as_json} method to support Rails'
|
130
|
-
by pulling in the changes by Eric Cline
|
138
|
+
* Implemented the {Tree::Utils::JSONConverter#as_json} method to support Rails'
|
139
|
+
JSON encoding, by pulling in the changes by Eric Cline
|
140
|
+
(https://github.com/escline).
|
131
141
|
|
132
142
|
* Partial fix for {Github Bug
|
133
143
|
#5}[https://github.com/evolve75/RubyTree/issues/5]. This is to
|
@@ -135,14 +145,14 @@ This is a primarily a bug-fix release, with some packaging changes.
|
|
135
145
|
elsewhere in the tree.
|
136
146
|
|
137
147
|
* Fixed the issue with using +integers+ as node names, and its
|
138
|
-
interaction with the +Tree::TreeNode#[]+ access method as documented in
|
139
|
-
#6}[https://github.com/evolve75/RubyTree/issues/6].
|
148
|
+
interaction with the +Tree::TreeNode#[]+ access method as documented in
|
149
|
+
{Github Bug #6}[https://github.com/evolve75/RubyTree/issues/6].
|
140
150
|
|
141
151
|
* Clarified the need to have unique node names {Github Bug
|
142
152
|
#7}[https://github.com/evolve75/RubyTree/issues/7] (documentation).
|
143
153
|
|
144
|
-
* Fixed {Tree::TreeNode#siblings} method to return an empty array for the
|
145
|
-
well (it returned +nil+ earlier).
|
154
|
+
* Fixed {Tree::TreeNode#siblings} method to return an empty array for the
|
155
|
+
root node as well (it returned +nil+ earlier).
|
146
156
|
|
147
157
|
=== 0.8.2 / 2011-12-15
|
148
158
|
|
@@ -167,31 +177,36 @@ This is a primarily a bug-fix release, with some packaging changes.
|
|
167
177
|
* The subtree from the current node can now be cloned in its entirety
|
168
178
|
using the {Tree::TreeNode#detached_subtree_copy} method.
|
169
179
|
|
170
|
-
* A major bug-fix for {bug #28613}[http://rubyforge.org/tracker/index.php?func=detail&aid=28613&group_id=1215&atid=4793]
|
180
|
+
* A major bug-fix for {bug #28613}[http://rubyforge.org/tracker/index.php?func=detail&aid=28613&group_id=1215&atid=4793]
|
181
|
+
which impacted the Binarytree implementation.
|
171
182
|
|
172
|
-
* Minor code re-factoring driven by the code-smell checks using
|
183
|
+
* Minor code re-factoring driven by the code-smell checks using
|
184
|
+
{reek}[https://github.com/troessner/reek].
|
173
185
|
|
174
186
|
* Inclusion of the +reek+ code-smell detection tool in the Rakefile.
|
175
187
|
|
176
188
|
=== 0.8.0 / 2010-05-04
|
177
189
|
|
178
|
-
* Updated the {Tree::TreeNode#add} method to allow the optional specification
|
179
|
-
position in the child array.
|
190
|
+
* Updated the {Tree::TreeNode#add} method to allow the optional specification
|
191
|
+
of an insertion position in the child array.
|
180
192
|
|
181
|
-
* Added a new method {Tree::TreeNode#detached_subtree_copy} to allow cloning
|
182
|
-
(this method is also aliased as +dup+).
|
193
|
+
* Added a new method {Tree::TreeNode#detached_subtree_copy} to allow cloning
|
194
|
+
the entire tree (this method is also aliased as +dup+).
|
183
195
|
|
184
196
|
* Converted all +CamelCase+ method names to the canonical +ruby_method_names+
|
185
197
|
(underscore separated). The +CamelCase+ methods _can still_ be invoked, but will
|
186
|
-
throw a {http://rug-b.rubyforge.org/structured_warnings/rdoc/ Deprecated
|
187
|
-
|
188
|
-
|
198
|
+
throw a {http://rug-b.rubyforge.org/structured_warnings/rdoc/ Deprecated
|
199
|
+
warning}.
|
200
|
+
The support for old CamelCase methods will go away some time in the future,
|
201
|
+
so the user is advised to convert all current method invocations
|
202
|
+
to the new names.
|
189
203
|
|
190
204
|
=== 0.7.0 / 2010-05-03
|
191
205
|
|
192
206
|
* Added new methods to report the degree statistics of a node.
|
193
207
|
|
194
|
-
* Added a convenience method alias
|
208
|
+
* Added a convenience method alias
|
209
|
+
{Tree::Utils::TreeMetricsHandler#level Tree::TreeNode#level} to +nodeDepth+.
|
195
210
|
|
196
211
|
* Converted the exceptions thrown on invalid arguments to
|
197
212
|
{http://www.ruby-doc.org/core-2.0.0/ArgumentError.html ArgumentError}
|
@@ -199,15 +214,16 @@ This is a primarily a bug-fix release, with some packaging changes.
|
|
199
214
|
|
200
215
|
* Converted the documentation to {http://yardoc.org Yard} format.
|
201
216
|
|
202
|
-
* Added new methods for converting from/to {http://www.json.org JSON} formats.
|
203
|
-
Breuer[http://github.com/railsbros-dirk] for this
|
217
|
+
* Added new methods for converting from/to {http://www.json.org JSON} formats.
|
218
|
+
Thanks to Dirk Breuer[http://github.com/railsbros-dirk] for this
|
204
219
|
fork[http://github.com/galaxycats/].
|
205
220
|
|
206
221
|
* Added a separate {file:API-CHANGES.rdoc} documentation file.
|
207
222
|
|
208
223
|
* Added fixes for root related edge conditions to {Tree::TreeNode#is_only_child?
|
209
224
|
isOnlyChild?}, {Tree::TreeNode#next_sibling nextSibling},
|
210
|
-
{Tree::TreeNode#previous_sibling previousSibling} and
|
225
|
+
{Tree::TreeNode#previous_sibling previousSibling} and
|
226
|
+
{Tree::TreeNode#remove! remove!} methods.
|
211
227
|
|
212
228
|
* Removed the 'ChangeLog' file as this can now be generated from the git logs.
|
213
229
|
|
@@ -230,10 +246,11 @@ This is a primarily a bug-fix release, with some packaging changes.
|
|
230
246
|
|
231
247
|
* Fixed the
|
232
248
|
bug#22535[http://rubyforge.org/tracker/index.php?func=detail&aid=22535&group_id=1215&atid=4793]
|
233
|
-
where the {Tree::Utils::TreeMetricsHandler#depth Tree::TreeNode#depth} method
|
249
|
+
where the {Tree::Utils::TreeMetricsHandler#depth Tree::TreeNode#depth} method
|
250
|
+
was actually returning height+1 (not the depth).
|
234
251
|
|
235
|
-
* Marked the {Tree::Utils::TreeMetricsHandler#depth Tree::TreeNode#depth}
|
236
|
-
run-time dependency on
|
252
|
+
* Marked the {Tree::Utils::TreeMetricsHandler#depth Tree::TreeNode#depth}
|
253
|
+
method as *deprecated* (and introduced the run-time dependency on
|
237
254
|
structured-warnings[http://github.com/schmidt/structured_warnings] gem).
|
238
255
|
|
239
256
|
=== 0.5.3 / 2009-12-31
|
@@ -244,7 +261,8 @@ This is a primarily a bug-fix release, with some packaging changes.
|
|
244
261
|
|
245
262
|
=== 0.5.2 / 2007-12-21
|
246
263
|
|
247
|
-
* Added more test cases and enabled
|
264
|
+
* Added more test cases and enabled
|
265
|
+
{https://github.com/seattlerb/zentest ZenTest} compatibility for the test case
|
248
266
|
names.
|
249
267
|
|
250
268
|
=== 0.5.1 / 2007-12-20
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<!--
|
2
2
|
README.md
|
3
3
|
|
4
|
-
Copyright (C)
|
4
|
+
Copyright (C) 2006-2015 Anupam Sengupta (anupamsg@gmail.com)
|
5
5
|
|
6
6
|
-->
|
7
7
|
# **RubyTree** #
|
@@ -24,18 +24,18 @@ The implementation is *node-centric*, where individual nodes in the tree are the
|
|
24
24
|
primary structural elements. All common tree-traversal methods ([pre-order][],
|
25
25
|
[post-order][], and [breadth-first][]) are supported.
|
26
26
|
|
27
|
-
The library mixes in the [Enumerable][] and [Comparable][] modules to allow
|
28
|
-
to the tree as a standard collection (iteration, comparison, etc.).
|
27
|
+
The library mixes in the [Enumerable][] and [Comparable][] modules to allow
|
28
|
+
access to the tree as a standard collection (iteration, comparison, etc.).
|
29
29
|
|
30
30
|
A [Binary tree][] is also provided, which provides the [in-order][] traversal in
|
31
31
|
addition to the other methods.
|
32
32
|
|
33
|
-
**RubyTree** supports importing from, and exporting to [JSON][], and also
|
34
|
-
the Ruby's standard object [marshaling][].
|
33
|
+
**RubyTree** supports importing from, and exporting to [JSON][], and also
|
34
|
+
supports the Ruby's standard object [marshaling][].
|
35
35
|
|
36
36
|
This is a [BSD licensed][BSD] open source project, and is hosted at
|
37
|
-
[github.com/evolve75/RubyTree][rt@github], and is available as a standard gem
|
38
|
-
[rubygems.org/gems/rubytree][rt_gem].
|
37
|
+
[github.com/evolve75/RubyTree][rt@github], and is available as a standard gem
|
38
|
+
from [rubygems.org/gems/rubytree][rt_gem].
|
39
39
|
|
40
40
|
The home page for **RubyTree** is at [rubytree.anupamsg.me][rt_site].
|
41
41
|
|
@@ -79,32 +79,38 @@ See the [API][rt_doc] documentation for more details.
|
|
79
79
|
# ..... Example starts.
|
80
80
|
require 'tree' # Load the library
|
81
81
|
|
82
|
-
# ..... Create the root node first.
|
82
|
+
# ..... Create the root node first.
|
83
|
+
# ..... Note that every node has a name and an optional content payload.
|
83
84
|
root_node = Tree::TreeNode.new("ROOT", "Root Content")
|
84
85
|
root_node.print_tree
|
85
86
|
|
86
|
-
# ..... Now insert the child nodes.
|
87
|
+
# ..... Now insert the child nodes.
|
88
|
+
# Note that you can "chain" the child insertions to any depth.
|
87
89
|
root_node << Tree::TreeNode.new("CHILD1", "Child1 Content") << Tree::TreeNode.new("GRANDCHILD1", "GrandChild1 Content")
|
88
90
|
root_node << Tree::TreeNode.new("CHILD2", "Child2 Content")
|
89
91
|
|
90
|
-
# ..... Lets print the representation to stdout.
|
92
|
+
# ..... Lets print the representation to stdout.
|
93
|
+
# ..... This is primarily used for debugging purposes.
|
91
94
|
root_node.print_tree
|
92
95
|
|
93
|
-
# ..... Lets directly access children and grandchildren of the root.
|
96
|
+
# ..... Lets directly access children and grandchildren of the root.
|
97
|
+
# ..... The can be "chained" for a given path to any depth.
|
94
98
|
child1 = root_node["CHILD1"]
|
95
99
|
grand_child1 = root_node["CHILD1"]["GRANDCHILD1"]
|
96
100
|
|
97
|
-
# ..... Now
|
101
|
+
# ..... Now retrieve siblings of the current node as an array.
|
98
102
|
siblings_of_child1 = child1.siblings
|
99
103
|
|
100
|
-
# .....
|
104
|
+
# ..... Retrieve immediate children of the root node as an array.
|
101
105
|
children_of_root = root_node.children
|
102
106
|
|
103
107
|
# ..... This is a depth-first and L-to-R pre-ordered traversal.
|
104
108
|
root_node.each { |node| node.content.reverse }
|
105
109
|
|
106
|
-
# .....
|
110
|
+
# ..... Remove a child node from the root node.
|
107
111
|
root_node.remove!(child1)
|
112
|
+
|
113
|
+
# .... Many more methods are available. Check out the documentation!
|
108
114
|
```
|
109
115
|
|
110
116
|
This example can also be found at
|
@@ -131,8 +137,8 @@ To install the [gem][rt_gem], run this command from a terminal/shell:
|
|
131
137
|
|
132
138
|
$ gem install rubytree
|
133
139
|
|
134
|
-
This should install the gem file for **RubyTree**. Note that you might need to
|
135
|
-
super-user privileges (root/sudo) to successfully install the gem.
|
140
|
+
This should install the gem file for **RubyTree**. Note that you might need to
|
141
|
+
have super-user privileges (root/sudo) to successfully install the gem.
|
136
142
|
|
137
143
|
## DOCUMENTATION: ##
|
138
144
|
|
@@ -156,15 +162,15 @@ Note that the documentation is formatted using [Yard][].
|
|
156
162
|
|
157
163
|
## DEVELOPERS: ##
|
158
164
|
|
159
|
-
This section is only for modifying **RubyTree** itself. It is not required for
|
160
|
-
the library!
|
165
|
+
This section is only for modifying **RubyTree** itself. It is not required for
|
166
|
+
using the library!
|
161
167
|
|
162
168
|
You can download the latest released source code as a tar or zip file, as
|
163
169
|
mentioned above in the installation section.
|
164
170
|
|
165
171
|
Alternatively, you can checkout the latest commit/revision from the Version
|
166
|
-
Control System. Note that **RubyTree**'s primary [SCM][] is [git][] and is
|
167
|
-
[github.com][rt@github].
|
172
|
+
Control System. Note that **RubyTree**'s primary [SCM][] is [git][] and is
|
173
|
+
hosted on [github.com][rt@github].
|
168
174
|
|
169
175
|
### Using the git Repository ###
|
170
176
|
|
@@ -215,7 +221,8 @@ A big thanks to the following contributors for helping improve **RubyTree**:
|
|
215
221
|
`rename_child` methods.
|
216
222
|
9. [Aidan Steele](https://github.com/aidansteele) for performance improvements
|
217
223
|
to `is_root?` and `node_depth`.
|
218
|
-
|
224
|
+
10. [Marco Ziccadi](https://github.com/MZic) for adding the `path_as_string` and
|
225
|
+
`path_as_array` methods.
|
219
226
|
|
220
227
|
## LICENSE: ##
|
221
228
|
|
@@ -254,3 +261,6 @@ A big thanks to the following contributors for helping improve **RubyTree**:
|
|
254
261
|
[rt_site]: http://rubytree.anupamsg.me "RubyTree Site"
|
255
262
|
[structured_warnings]: http://github.com/schmidt/structured_warnings "structured_warnings"
|
256
263
|
[tree_data_structure]: http://en.wikipedia.org/wiki/Tree_data_structure "Tree Data Structure"
|
264
|
+
|
265
|
+
|
266
|
+
[](https://bitdeli.com/free "Bitdeli Badge")
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# Rakefile - This file is part of the RubyTree package.
|
4
4
|
#
|
5
|
-
# Copyright (c) 2006
|
5
|
+
# Copyright (c) 2006-2015 Anupam Sengupta
|
6
6
|
#
|
7
7
|
# All rights reserved.
|
8
8
|
#
|
@@ -12,9 +12,9 @@
|
|
12
12
|
# - Redistributions of source code must retain the above copyright notice, this
|
13
13
|
# list of conditions and the following disclaimer.
|
14
14
|
#
|
15
|
-
# - Redistributions in binary form must reproduce the above copyright notice,
|
16
|
-
# list of conditions and the following disclaimer in the documentation
|
17
|
-
# other materials provided with the distribution.
|
15
|
+
# - Redistributions in binary form must reproduce the above copyright notice,
|
16
|
+
# this list of conditions and the following disclaimer in the documentation
|
17
|
+
# and/or other materials provided with the distribution.
|
18
18
|
#
|
19
19
|
# - Neither the name of the organization nor the names of its contributors may
|
20
20
|
# be used to endorse or promote products derived from this software without
|
@@ -23,13 +23,13 @@
|
|
23
23
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
24
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
25
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
26
|
-
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
27
|
-
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
28
|
-
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
29
|
-
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
30
|
-
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
31
|
-
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
32
|
-
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
26
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
27
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
28
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
29
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
30
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
31
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
32
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
33
33
|
#
|
34
34
|
|
35
35
|
require 'rubygems'
|