rubytree 0.9.7 → 2.0.0
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 +5 -5
- data/API-CHANGES.md +153 -0
- data/Gemfile +2 -13
- data/Gemfile.lock +60 -61
- data/History.md +410 -0
- data/LICENSE.md +1 -2
- data/README.md +24 -28
- data/Rakefile +65 -48
- data/TODO.org +19 -15
- data/examples/example_basic.rb +19 -12
- data/lib/rubytree.rb +3 -4
- data/lib/tree/binarytree.rb +27 -27
- data/lib/tree/tree_deps.rb +9 -12
- data/lib/tree/utils/hash_converter.rb +127 -121
- data/lib/tree/utils/json_converter.rb +81 -79
- data/lib/tree/utils/metrics_methods.rb +18 -48
- data/lib/tree/utils/path_methods.rb +15 -17
- data/lib/tree/utils/tree_merge_handler.rb +79 -80
- data/lib/tree/utils/utils.rb +9 -6
- data/lib/tree/version.rb +3 -5
- data/lib/tree.rb +194 -177
- data/rubytree.gemspec +67 -44
- data/spec/spec_helper.rb +5 -3
- data/spec/tree_spec.rb +136 -37
- data/test/run_test.rb +9 -8
- data/test/test_binarytree.rb +86 -105
- data/test/test_rubytree_require.rb +4 -5
- data/test/test_subclassed_node.rb +5 -26
- data/test/test_thread_and_fiber.rb +13 -16
- data/test/test_tree.rb +577 -657
- metadata +142 -55
- data/API-CHANGES.rdoc +0 -99
- data/History.rdoc +0 -303
- data/TAGS +0 -248
- data/gem_graph.png +0 -0
- data/lib/tree/utils/camel_case_method_handler.rb +0 -79
- data/setup.rb +0 -1585
data/History.md
ADDED
@@ -0,0 +1,410 @@
|
|
1
|
+
# History of Changes
|
2
|
+
|
3
|
+
### 2.0.0 / 2022-06-21
|
4
|
+
|
5
|
+
* A major release with significant modernization to the code base and removal of
|
6
|
+
legacy cruft, thanks to [jmortlock][].
|
7
|
+
|
8
|
+
* The long deprecated `Tree::TreeNode#depth` method has finally been
|
9
|
+
**removed**. Use [Tree::TreeNode#node_depth][node_depth] instead.
|
10
|
+
|
11
|
+
* Support for `CamelCase` methods has been dropped.
|
12
|
+
|
13
|
+
* The predicate methods beginning with `is_` or `has_` are now aliases to real
|
14
|
+
methods **without** these prefixes. For example, `Tree::TreeNode#is_root?` is
|
15
|
+
now aliased to `Tree::TreeNode#root?`. This is to comply with the Ruby
|
16
|
+
standard. The original prefixed method names should be considered as
|
17
|
+
deprecated and the corresponding non-prefixed method names should be used
|
18
|
+
instead. it is possible that the old prefixed method names might be removed in
|
19
|
+
the future.
|
20
|
+
|
21
|
+
* RubyTree now supports MRI Ruby versions `2.6.x`, `2.7.x`, and `3.0.x`.
|
22
|
+
|
23
|
+
* Explicit support for `rbx` Ruby has been removed (_might_ still work, but not
|
24
|
+
tested.)
|
25
|
+
|
26
|
+
* RubyTree now uses [Github Workflows][workflow] for its CI pipeline.
|
27
|
+
|
28
|
+
* RubyTree now allows proper sub-classing of [Tree::TreeNode][TreeNode]. Thanks to
|
29
|
+
[jack12816][] for this.
|
30
|
+
|
31
|
+
* RubyTree now correctly handles creating detached copies of un-clonable objects
|
32
|
+
such as `:symbol`, `true|false`, etc. Thanks to [igneus][] for this.
|
33
|
+
|
34
|
+
### 1.0.2 / 2021-12-29
|
35
|
+
|
36
|
+
* A minor maintenance version to address a minor but annoying warning for
|
37
|
+
circular dependencies.
|
38
|
+
|
39
|
+
### 1.0.1 / 2021-12-29
|
40
|
+
|
41
|
+
* Updated all dependencies (dev and runtime) to their _latest_ stable
|
42
|
+
releases. This is to primarily address potential CVE exposures from upstream
|
43
|
+
libraries.
|
44
|
+
|
45
|
+
* Updated the supported version of MRI Ruby to `2.7.x`.
|
46
|
+
|
47
|
+
* Minor code cleanup using the safe automated corrections using `rubocop`.
|
48
|
+
|
49
|
+
* Note that this was never released to <https://rubygems.org>.
|
50
|
+
|
51
|
+
### 1.0.0 / 2017-12-21
|
52
|
+
|
53
|
+
* Finally! Released version `1.0.0`.
|
54
|
+
|
55
|
+
* This is a maintenance release that updates the dependent gem versions and
|
56
|
+
addresses a few security vulnerabilities for older upstream gem packages.
|
57
|
+
|
58
|
+
* With this release, Rubytree now requires Ruby version `2.2.x` or higher.
|
59
|
+
|
60
|
+
### 0.9.7 / 2015-12-31
|
61
|
+
|
62
|
+
* Released `0.9.6`. This is a minor bug-fix release.
|
63
|
+
|
64
|
+
* This release allows the [Tree::TreeNode#print_tree][print_tree] method to be
|
65
|
+
used on non-root nodes. Thanks to [Ojab][Ojab].
|
66
|
+
|
67
|
+
* The spaceship operator (`<=>`) now returns `nil` if the object being compared
|
68
|
+
to is _itself_ `nil` or not another [Tree::TreeNode][TreeNode].
|
69
|
+
|
70
|
+
### 0.9.6 / 2015-05-30
|
71
|
+
|
72
|
+
* Released `0.9.6`, which is identical to `0.9.5`, _except_ for an update to the
|
73
|
+
gem's release date.
|
74
|
+
|
75
|
+
### 0.9.5 / 2015-05-30
|
76
|
+
|
77
|
+
* Released `0.9.5`.
|
78
|
+
|
79
|
+
### 0.9.5pre7 / 2015-05-30
|
80
|
+
|
81
|
+
* Added new methods for getting the path of a node as a `string`. These have
|
82
|
+
been added as a new `mixin`
|
83
|
+
[Tree::Utils::TreePathHandler][TreePathHandler]. Thanks to [Marco][].
|
84
|
+
|
85
|
+
### 0.9.5pre5 / 2015-01-01
|
86
|
+
|
87
|
+
* Fixed [bug-32][] and enabled _move_ semantics on the [Tree::TreeNode#add][add]
|
88
|
+
method, so that if a child is added, which has an existing parent, then it
|
89
|
+
will be _removed_ from its old parent, prior to being added to the new location.
|
90
|
+
|
91
|
+
### 0.9.5pre4 / 2014-12-17
|
92
|
+
|
93
|
+
* Added performance improvements to [Tree::TreeNode#is_root?][is_root] and
|
94
|
+
[Tree::Utils::TreeMetricsHandler#node_depth][mnode_depth]. Thanks to [Aidan Steel][Aidan].
|
95
|
+
|
96
|
+
### 0.9.5pre3 / 2014-12-16
|
97
|
+
|
98
|
+
* Minor fix to correct the release date. This release is otherwise identical
|
99
|
+
to `0.9.5pre2`.
|
100
|
+
|
101
|
+
### 0.9.5pre2 / 2014-12-16
|
102
|
+
|
103
|
+
* Added [Tree::TreeNode#rename][rename] and
|
104
|
+
[Tree::TreeNode#rename_child][rename_child] methods by merging in code from
|
105
|
+
[pr-35][]. Thanks to [Evan Sharp][Evan].
|
106
|
+
|
107
|
+
### 0.9.5pre / 2014-11-01
|
108
|
+
|
109
|
+
* Fixed [bug-13][] with the patch provided by [Jen Hamon][jhamon].
|
110
|
+
|
111
|
+
* Fixed a bug in [Tree::TreeNode#print_tree][print_tree] with the patch provided
|
112
|
+
by [Evan Sharp][Evan].
|
113
|
+
|
114
|
+
* Fixed [bug-31][], which was causing incorrect behavior in
|
115
|
+
[Tree::TreeNode#postordered_each][postordered_each] and
|
116
|
+
[Tree::TreeNode#breadth_each][breadth_each] methods when a block was not
|
117
|
+
provided.
|
118
|
+
|
119
|
+
### 0.9.4 / 2014-07-04
|
120
|
+
|
121
|
+
* Changed all references to <http://rubyforge.org>.
|
122
|
+
|
123
|
+
### 0.9.3 / 2014-02-01
|
124
|
+
|
125
|
+
* Fixed the issue with globally unique node names. See [bug-24][].
|
126
|
+
|
127
|
+
### 0.9.2 / 2014-01-03
|
128
|
+
|
129
|
+
* Yanked `R0.9.1` as the `History.rdoc` file was not updated.
|
130
|
+
|
131
|
+
* Updated the gem description.
|
132
|
+
|
133
|
+
* Changed the [travis-ci][] build to include `coverall` support.
|
134
|
+
|
135
|
+
### 0.9.1 / 2014-01-03
|
136
|
+
|
137
|
+
* Updated the gem description.
|
138
|
+
|
139
|
+
* Incorporated code coverage using the `coverall` gem.
|
140
|
+
|
141
|
+
### 0.9.0 / 2014-01-02
|
142
|
+
|
143
|
+
This is a feature and bug-fix release.
|
144
|
+
|
145
|
+
#### The Features
|
146
|
+
|
147
|
+
* Rubytree now supports `postordered` traversal via the
|
148
|
+
[Tree::TreeNode#postordered_each][postordered_each] method. Thanks to [Paul de
|
149
|
+
Courcel][Paul] for this.
|
150
|
+
|
151
|
+
* The Binary tree now supports `inorder` traversal via the
|
152
|
+
[Tree::BinaryTreeNode#inordered_each][inordered_each] method.
|
153
|
+
|
154
|
+
* Ability to merge in another tree at a chosen node, or merge two trees to
|
155
|
+
create a third tree. Thanks to [Darren Oakley][Darren] for this [pr-2][].
|
156
|
+
|
157
|
+
* RubyTree now mixes in the [Comparable][] module.
|
158
|
+
|
159
|
+
#### The Fixes
|
160
|
+
|
161
|
+
* (_Partial_) fix for preventing cyclic graphs in the tree.
|
162
|
+
|
163
|
+
* Refactored the [Tree::TreeNode#each][each] method to prevent stack errors while
|
164
|
+
navigating deep trees ([bug-12][]).
|
165
|
+
|
166
|
+
* Check to ensure that the added node's name is unique to the destination tree
|
167
|
+
([pr-9][]). Thanks to [Youssef Rebahi-Gilbert][Youssef] for the idea and the
|
168
|
+
initial code.
|
169
|
+
|
170
|
+
* Fix for [bug-23][], where the tree traversal on a binary tree would fail if
|
171
|
+
the _left_ child was `nil`.
|
172
|
+
|
173
|
+
* The following traversal methods now correctly return an
|
174
|
+
[Enumerator][] as the return value when no block is given, and
|
175
|
+
return the _receiver node_ if a block was provided. This is consistent with
|
176
|
+
how the standard Ruby collections work.
|
177
|
+
|
178
|
+
* [Tree::TreeNode#each][each],
|
179
|
+
* [Tree::TreeNode#preordered_each][preordered_each],
|
180
|
+
* [Tree::TreeNode#postordered_each][postordered_each] and
|
181
|
+
* [Tree::TreeNode#breadth_each][breadth_each].
|
182
|
+
|
183
|
+
#### Other Changes
|
184
|
+
|
185
|
+
* Structural changes in the code to refactor out the non-core functions into
|
186
|
+
modules (mostly by extracting out non-core code as `mixins`).
|
187
|
+
|
188
|
+
* Significant refactoring of the documentation. The [Yard][] tags are now
|
189
|
+
extensively used.
|
190
|
+
|
191
|
+
* Basic support built-in for including example code in the gem. This will be
|
192
|
+
fully expanded in the next release.
|
193
|
+
|
194
|
+
* Various changes to the [Bundler][], [travis-ci][] and other `Rakefile`
|
195
|
+
changes.
|
196
|
+
|
197
|
+
### 0.8.3 / 2012-08-21
|
198
|
+
|
199
|
+
This is a primarily a bug-fix release, with some packaging changes.
|
200
|
+
|
201
|
+
* Have removed the dependency on [Hoe][]. The build is now based on vanilla
|
202
|
+
[gemspec][].
|
203
|
+
|
204
|
+
* Included support for [gem-testers][].
|
205
|
+
|
206
|
+
* Included support for [Bundler][].
|
207
|
+
|
208
|
+
* Implemented the [Tree::Utils::JSONConverter#as_json][as_json] method to
|
209
|
+
support Rails' `JSON` encoding, by pulling in the changes from [Eric Cline][Eric].
|
210
|
+
|
211
|
+
* Partial fix for [bug-5][]. This is to prevent infinite looping if an existing
|
212
|
+
node is added again elsewhere in the tree.
|
213
|
+
|
214
|
+
* Fixed the issue with using `integers` as node names, and its interaction
|
215
|
+
with the `Tree::TreeNode#[]` access method as documented in [bug-6][].
|
216
|
+
|
217
|
+
* Clarified the need to have _unique_ node names in the documentation ([bug-7][]).
|
218
|
+
|
219
|
+
* Fixed [Tree::TreeNode#siblings][siblings] method to return an _empty_ array
|
220
|
+
for the root node as well (it returned `nil` earlier).
|
221
|
+
|
222
|
+
### 0.8.2 / 2011-12-15
|
223
|
+
|
224
|
+
* Minor bug-fix release to address [bug-1215][] ([Tree::TreeNode#to_s][to_s]
|
225
|
+
breaks if `@content` or `@parent.name` is not a string).
|
226
|
+
|
227
|
+
### 0.8.1 / 2010-10-02
|
228
|
+
|
229
|
+
* This is the public release of `R0.8.0`, with additional bug-fixes. Note that
|
230
|
+
`R0.8.0` will **not be** released separately as a publicly available
|
231
|
+
Rubygem. All changes as listed for `R0.8.0` are available in this release.
|
232
|
+
|
233
|
+
* The main change in `R0.8.0`/`R0.8.1` is conversion of all `CamelCase` method
|
234
|
+
names to `snake_case`. The old `CamelCase` method names will _still_ work (to
|
235
|
+
ensure backwards compatibility), but will also display a warning.
|
236
|
+
|
237
|
+
* The [Tree::TreeNode#add][add] method now accepts an _optional_ child insertion
|
238
|
+
point.
|
239
|
+
|
240
|
+
* The sub-tree from the current node can now be cloned in its _entirety_ using
|
241
|
+
the [Tree::TreeNode#detached_subtree_copy][detached_subtree_copy] method.
|
242
|
+
|
243
|
+
* A major bug-fix for [bug-28613][] which impacted the `Binarytree`
|
244
|
+
implementation.
|
245
|
+
|
246
|
+
* Minor code re-factoring driven by the code-smell checks using
|
247
|
+
[reek][].
|
248
|
+
|
249
|
+
* Inclusion of the `reek` code-smell detection tool in the `Rakefile`.
|
250
|
+
|
251
|
+
### 0.8.0 / 2010-05-04
|
252
|
+
|
253
|
+
* Updated the [Tree::TreeNode#add][add] method to allow the optional
|
254
|
+
specification of an insertion position in the child array.
|
255
|
+
|
256
|
+
* Added a new method
|
257
|
+
[Tree::TreeNode#detached_subtree_copy][detached_subtree_copy] to allow cloning
|
258
|
+
the entire tree (this method is also aliased as `dup`).
|
259
|
+
|
260
|
+
* Converted all `CamelCase` method names to the canonical `ruby_method_names`
|
261
|
+
(underscore separated). The `CamelCase` methods _can still_ be invoked, but
|
262
|
+
will throw a [Deprecated Warning][dep-warning]. The support for old
|
263
|
+
`CamelCase` methods **will** go away some time in the future, so the user is
|
264
|
+
advised to convert all current method invocations to the new names.
|
265
|
+
|
266
|
+
### 0.7.0 / 2010-05-03
|
267
|
+
|
268
|
+
* Added new methods to report the degree-statistics of a node.
|
269
|
+
|
270
|
+
* Added a convenience method alias [Tree::TreeNode#level][level] to `nodeDepth`.
|
271
|
+
|
272
|
+
* Converted the exceptions thrown on invalid arguments to [ArgumentError][]
|
273
|
+
instead of [RuntimeError][].
|
274
|
+
|
275
|
+
* Converted the documentation to [Yard][] format.
|
276
|
+
|
277
|
+
* Added new methods for converting to/from [JSON][] format. Thanks to Dirk
|
278
|
+
[Breuer][] for this [fork](http://github.com/galaxycats/).
|
279
|
+
|
280
|
+
* Added a separate [API-CHANGES.md](file:API-CHANGES.md) documentation file.
|
281
|
+
|
282
|
+
* Added fixes for root related edge conditions to the:
|
283
|
+
|
284
|
+
* [Tree::TreeNode#is_only_child?][is_only_child],
|
285
|
+
* [Tree::TreeNode#next_sibling][next_sibling],
|
286
|
+
* [Tree::TreeNode#previous_sibling][previous_sibling] and
|
287
|
+
* [Tree::TreeNode#remove!][remove] methods.
|
288
|
+
|
289
|
+
* Removed the `ChangeLog` file as this can now be generated from the git logs.
|
290
|
+
|
291
|
+
* Other minor code cleanup.
|
292
|
+
|
293
|
+
### 0.6.2 / 2010-01-30
|
294
|
+
|
295
|
+
* Updated the documentation.
|
296
|
+
|
297
|
+
### 0.6.1 / 2010-01-04
|
298
|
+
|
299
|
+
* Changed the hard-dependency on the [structured_warnings][] gem to a
|
300
|
+
_soft-dependency_ - which lets `RubyTree` still work if this gem is not
|
301
|
+
available. The rationale for this is that we _should not_ require the user to
|
302
|
+
install a separate library just for _one_ edge-case function (in this case, to
|
303
|
+
indicate a deprecated method). However, if the library *is* available on the
|
304
|
+
user's system, then it **will** get used.
|
305
|
+
|
306
|
+
### 0.6.0 / 2010-01-03
|
307
|
+
|
308
|
+
* Fixed [bug-22535][] where the `Tree::TreeNode#depth` method was actually
|
309
|
+
returning `height+1` (**not** the `depth`).
|
310
|
+
|
311
|
+
* Marked the `Tree::TreeNode#depth` method as **deprecated** (and introduced the
|
312
|
+
run-time dependency on the [structured-warnings][] gem).
|
313
|
+
|
314
|
+
### 0.5.3 / 2009-12-31
|
315
|
+
|
316
|
+
* Cleanup of the build system to exclusively use [Hoe][].
|
317
|
+
* Modifications and reformatting to the documentation.
|
318
|
+
* No user visible changes.
|
319
|
+
|
320
|
+
### 0.5.2 / 2007-12-21
|
321
|
+
|
322
|
+
* Added more test cases and enabled [ZenTest][] compatibility for the test case
|
323
|
+
names.
|
324
|
+
|
325
|
+
### 0.5.1 / 2007-12-20
|
326
|
+
|
327
|
+
* Minor code refactoring.
|
328
|
+
|
329
|
+
### 0.5.0 / 2007-12-18
|
330
|
+
|
331
|
+
* Fixed the marshalling code to correctly handle non-string content.
|
332
|
+
|
333
|
+
### 0.4.3 / 2007-10-09
|
334
|
+
|
335
|
+
* Changes to the build mechanism (now uses [Hoe]).
|
336
|
+
|
337
|
+
### 0.4.2 / 2007-10-01
|
338
|
+
|
339
|
+
* Minor code refactoring. Changes in the `Rakefile`.
|
340
|
+
|
341
|
+
[bug-5]: https://github.com/evolve75/RubyTree/issues/5
|
342
|
+
[bug-6]: https://github.com/evolve75/RubyTree/issues/6
|
343
|
+
[bug-7]: https://github.com/evolve75/RubyTree/issues/7
|
344
|
+
[bug-12]: https://github.com/evolve75/RubyTree/issues/12
|
345
|
+
[bug-13]: https://github.com/evolve75/RubyTree/issues/13
|
346
|
+
[bug-23]: https://github.com/evolve75/RubyTree/issues/23
|
347
|
+
[bug-24]: https://github.com/evolve75/RubyTree/issues/24
|
348
|
+
[bug-31]: https://github.com/evolve75/RubyTree/issues/31
|
349
|
+
[bug-32]: https://github.com/evolve75/RubyTree/issues/32
|
350
|
+
[bug-1215]: http://rubyforge.org/tracker/index.php?func=detail&aid=1215&group_id=1215&atid=4793
|
351
|
+
[bug-28613]: http://rubyforge.org/tracker/index.php?func=detail&aid=28613&group_id=1215&atid=4793
|
352
|
+
[bug-22535]: http://rubyforge.org/tracker/index.php?func=detail&aid=22535&group_id=1215&atid=4793
|
353
|
+
|
354
|
+
[pr-2]: https://github.com/evolve75/RubyTree/pull/2
|
355
|
+
[pr-9]: https://github.com/evolve75/RubyTree/pull/9
|
356
|
+
[pr-35]: https://github.com/evolve75/RubyTree/pull/35
|
357
|
+
|
358
|
+
[ArgumentError]: http://www.ruby-doc.org/core-2.0.0/ArgumentError.html
|
359
|
+
[Bundler]: https://bundler.io
|
360
|
+
[Comparable]: http://ruby-doc.org/core-1.8.7/Comparable.html
|
361
|
+
[Enumerator]: http://ruby-doc.org/core-1.8.7/Enumerable.html
|
362
|
+
[Hoe]: http://www.zenspider.com/projects/hoe.html
|
363
|
+
[JSON]: http://www.json.org
|
364
|
+
[RuntimeError]: http://www.ruby-doc.org/core-2.0.0/RuntimeError.html
|
365
|
+
[Yard]: http://yardoc.org
|
366
|
+
[ZenTest]: https://github.com/seattlerb/zentest
|
367
|
+
[dep-warning]: http://rug-b.rubyforge.org/structured_warnings/rdoc/
|
368
|
+
[gem-testers]: https://test.rubygems.org/
|
369
|
+
[gemspec]: https://guides.rubygems.org/specification-reference/
|
370
|
+
[reek]: https://github.com/troessner/reek
|
371
|
+
[structured-warnings]: http://github.com/schmidt/structured_warnings
|
372
|
+
[travis-ci]: https://travis-ci.org
|
373
|
+
[workflow]: https://docs.github.com/en/actions/using-workflows
|
374
|
+
|
375
|
+
[Aidan]: https://github.com/aidansteele
|
376
|
+
[Breuer]: http://github.com/railsbros-dirk
|
377
|
+
[Darren]: https://github.com/dazoakley
|
378
|
+
[Eric]: https://github.com/escline
|
379
|
+
[Evan]: https://github.com/packetmonkey
|
380
|
+
[Marco]: https://github.com/MZic
|
381
|
+
[Ojab]: https://github.com/ojab
|
382
|
+
[Paul]: https://github.com/pdecourcel
|
383
|
+
[Youssef]: https://github.com/ysf
|
384
|
+
[igneus]: https://github.com/igneus
|
385
|
+
[jack12816]: https://github.com/jack12816
|
386
|
+
[jhamon]: https://www.github.com/jhamon
|
387
|
+
[jmortlock]: https://github.com/jmortlock
|
388
|
+
|
389
|
+
[TreeNode]: rdoc-ref:Tree::TreeNode
|
390
|
+
[TreePathHandler]: Tree::Utils::TreePathHandler
|
391
|
+
[add]: rdoc-ref:Tree::TreeNode#add
|
392
|
+
[as_json]: rdoc-ref:Tree::Utils::JSONConverter#as_json
|
393
|
+
[breadth_each]: rdoc-ref:Tree::TreeNode#breadth_each
|
394
|
+
[detached_subtree_copy]: rdoc-ref:Tree::TreeNode#detached_subtree_copy
|
395
|
+
[each]: rdoc-ref:Tree::TreeNode#each
|
396
|
+
[inordered_each]: rdoc-ref:Tree::BinaryTreeNode#inordered_each
|
397
|
+
[is_only_child]: rdoc-ref:Tree::TreeNode#is_only_child?
|
398
|
+
[is_root]: rdoc-ref:Tree::TreeNode#is_root?
|
399
|
+
[level]: rdoc-ref:Tree::TreeNode#level
|
400
|
+
[mnode_depth]: rdoc-ref:Tree::Utils::TreeMetricsHandler#node_depth
|
401
|
+
[next_sibling]: rdoc-ref:Tree::TreeNode#next_sibling
|
402
|
+
[node_depth]: rdoc-ref:Tree::TreeNode#node_depth
|
403
|
+
[postordered_each]: rdoc-ref:Tree::TreeNode#postordered_each
|
404
|
+
[previous_sibling]: rdoc-ref:Tree::TreeNode#previous_sibling
|
405
|
+
[print_tree]: rdoc-ref:Tree::TreeNode#print_tree
|
406
|
+
[remove]: rdoc-ref:Tree::TreeNode#remove!
|
407
|
+
[rename]: rdoc-ref:Tree::TreeNode#rename
|
408
|
+
[rename_child]: rdoc-ref:Tree::TreeNode#rename_child
|
409
|
+
[siblings]: rdoc-ref:Tree::TreeNode#siblings
|
410
|
+
[to_s]: rdoc-ref:Tree::TreeNode#to_s
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -1,14 +1,6 @@
|
|
1
|
-
<!--
|
2
|
-
README.md
|
3
|
-
|
4
|
-
Copyright (C) 2006-2015 Anupam Sengupta (anupamsg@gmail.com)
|
5
|
-
|
6
|
-
-->
|
7
1
|
# **RubyTree** #
|
8
2
|
|
9
3
|
[](http://badge.fury.io/rb/rubytree)
|
10
|
-
[](http://travis-ci.org/evolve75/rubytree)
|
11
|
-
[](https://gemnasium.com/evolve75/RubyTree)
|
12
4
|
[](https://codeclimate.com/github/evolve75/RubyTree)
|
13
5
|
[](https://coveralls.io/r/evolve75/RubyTree)
|
14
6
|
|
@@ -40,9 +32,9 @@ The home page for **RubyTree** is at [rubytree.anupamsg.me][rt_site].
|
|
40
32
|
|
41
33
|
## WHAT'S NEW: ##
|
42
34
|
|
43
|
-
See [History](./History.
|
35
|
+
See [History](./History.md) for the detailed Changelog.
|
44
36
|
|
45
|
-
See [API-CHANGES](./API-CHANGES.
|
37
|
+
See [API-CHANGES](./API-CHANGES.md) for the detailed description of
|
46
38
|
API level changes.
|
47
39
|
|
48
40
|
## GETTING STARTED: ##
|
@@ -55,9 +47,7 @@ See the [API][rt_doc] documentation for more details.
|
|
55
47
|
#
|
56
48
|
# example_basic.rb:: Basic usage of the tree library.
|
57
49
|
#
|
58
|
-
#
|
59
|
-
# Time-stamp: <2013-12-28 12:14:20 anupam>
|
60
|
-
# Copyright (C) 2013 Anupam Sengupta <anupamsg@gmail.com>
|
50
|
+
# Copyright (C) 2013-2022 Anupam Sengupta <anupamsg@gmail.com>
|
61
51
|
#
|
62
52
|
# The following example implements this tree structure:
|
63
53
|
#
|
@@ -120,19 +110,21 @@ This example can also be found at
|
|
120
110
|
|
121
111
|
## REQUIREMENTS: ##
|
122
112
|
|
123
|
-
* [Ruby][]
|
113
|
+
* [Ruby][] 2.6.x and above.
|
124
114
|
|
125
115
|
|
126
116
|
* Run-time Dependencies:
|
127
|
-
|
117
|
+
|
128
118
|
* [JSON][] for converting to/from the JSON format
|
129
119
|
|
130
120
|
|
131
121
|
* Development dependencies (not required for installing the gem):
|
122
|
+
|
132
123
|
* [Bundler][] for creating the stable build environment
|
133
124
|
* [Rake][] for building the package
|
134
125
|
* [Yard][] for the documentation
|
135
126
|
* [RSpec][] for additional Ruby Spec test files
|
127
|
+
* [Rubocop][] for linting the code
|
136
128
|
|
137
129
|
## INSTALL: ##
|
138
130
|
|
@@ -145,7 +137,7 @@ have super-user privileges (root/sudo) to successfully install the gem.
|
|
145
137
|
|
146
138
|
## DOCUMENTATION: ##
|
147
139
|
|
148
|
-
The primary class **RubyTree** is
|
140
|
+
The primary class **RubyTree** is [Tree::TreeNode][TreeNode]. See the class
|
149
141
|
documentation for an example of using the library.
|
150
142
|
|
151
143
|
If the *ri* documentation was generated during install, you can use this
|
@@ -181,11 +173,11 @@ The git repository is available at [github.com/evolve75/RubyTree][rt@github].
|
|
181
173
|
|
182
174
|
For cloning the git repository, use one of the following commands:
|
183
175
|
|
184
|
-
$ git clone git://github.com/evolve75/RubyTree.git
|
176
|
+
$ git clone git://github.com/evolve75/RubyTree.git # using ssh
|
185
177
|
|
186
178
|
or
|
187
179
|
|
188
|
-
$ git clone
|
180
|
+
$ git clone https://github.com/evolve75/RubyTree.git # using https
|
189
181
|
|
190
182
|
### Setting up the Development Environment ###
|
191
183
|
|
@@ -196,9 +188,9 @@ After checking out the source, run:
|
|
196
188
|
|
197
189
|
$ gem install bundler
|
198
190
|
$ bundle install
|
199
|
-
$ rake test
|
200
|
-
$ rake doc:yard
|
201
|
-
$ rake gem:package
|
191
|
+
$ bundle exec rake test:all
|
192
|
+
$ bundle exec rake doc:yard
|
193
|
+
$ bundle exec rake gem:package
|
202
194
|
|
203
195
|
These steps will install any missing dependencies, run the tests/specs,
|
204
196
|
generate the documentation, and finally generate the gem file.
|
@@ -226,14 +218,18 @@ A big thanks to the following contributors for helping improve **RubyTree**:
|
|
226
218
|
to `is_root?` and `node_depth`.
|
227
219
|
10. [Marco Ziccadi](https://github.com/MZic) for adding the `path_as_string` and
|
228
220
|
`path_as_array` methods.
|
221
|
+
11. [John Mortlock](https://github.com/jmortlock) for significant modernization
|
222
|
+
of the library code and addition of Github `workflows`.
|
223
|
+
12. [Hermann Mayer](https://github.com/jack12816) for adding support for
|
224
|
+
specialized tree nodes (sub-classes of `Tree::TreeNode`).
|
225
|
+
13. [Jakub Pavlik](https://github.com/igneus) for fixing the creation of
|
226
|
+
detached copies of unclonable objects such as `:symbol`, `true|false`, etc.
|
229
227
|
|
230
228
|
## LICENSE: ##
|
231
229
|
|
232
230
|
**RubyTree** is licensed under the terms of the [BSD][] license. See
|
233
231
|
[LICENSE.md](./LICENSE.md) for details.
|
234
232
|
|
235
|
-
{include:file:LICENSE.md}
|
236
|
-
|
237
233
|
__ _ _
|
238
234
|
/__\_ _| |__ _ _| |_ _ __ ___ ___
|
239
235
|
/ \// | | | '_ \| | | | __| '__/ _ \/ _ \
|
@@ -244,8 +240,8 @@ A big thanks to the following contributors for helping improve **RubyTree**:
|
|
244
240
|
[BSD]: http://opensource.org/licenses/bsd-license.php "BSD License"
|
245
241
|
[Binary tree]: http://en.wikipedia.org/wiki/Binary_tree "Binary Tree Data Structure"
|
246
242
|
[Bundler]: http://bundler.io "Bundler"
|
247
|
-
[Comparable]: http://ruby-doc.org/core-
|
248
|
-
[Enumerable]: http://ruby-doc.org/core-
|
243
|
+
[Comparable]: http://ruby-doc.org/core-2.4.2/Comparable.html "Comparable mix-in"
|
244
|
+
[Enumerable]: http://ruby-doc.org/core-2.4.2/Enumerable.html "Enumerable mix-in"
|
249
245
|
[JSON]: http://flori.github.com/json "JSON"
|
250
246
|
[Rake]: https://rubygems.org/gems/rake "Rake"
|
251
247
|
[Ruby]: http://www.ruby-lang.org "Ruby Programming Language"
|
@@ -254,7 +250,7 @@ A big thanks to the following contributors for helping improve **RubyTree**:
|
|
254
250
|
[breadth-first]: http://en.wikipedia.org/wiki/Breadth-first_search "Breadth-first (level-first) Traversal"
|
255
251
|
[git]: http://git-scm.com "Git SCM"
|
256
252
|
[in-order]: http://en.wikipedia.org/wiki/Tree_traversal#In-order "In-order (symmetric) Traversal"
|
257
|
-
[marshaling]: http://ruby-doc.org/core-
|
253
|
+
[marshaling]: http://ruby-doc.org/core-2.4.2/Marshal.html "Marshaling in Ruby"
|
258
254
|
[post-order]: http://en.wikipedia.org/wiki/Tree_traversal#Post-order "Post-ordered Traversal"
|
259
255
|
[pre-order]: http://en.wikipedia.org/wiki/Tree_traversal#Pre-order "Pre-ordered Traversal"
|
260
256
|
[rt@github]: http://github.com/evolve75/RubyTree "RubyTree Project Page on Github"
|
@@ -262,8 +258,8 @@ A big thanks to the following contributors for helping improve **RubyTree**:
|
|
262
258
|
[rt_doc]: http://rubytree.anupamsg.me/rdoc "RubyTree Documentation"
|
263
259
|
[rt_gem]: http://rubygems.org/gems/rubytree "RubyTree Gem"
|
264
260
|
[rt_site]: http://rubytree.anupamsg.me "RubyTree Site"
|
265
|
-
[structured_warnings]: http://github.com/schmidt/structured_warnings "structured_warnings"
|
266
261
|
[tree_data_structure]: http://en.wikipedia.org/wiki/Tree_data_structure "Tree Data Structure"
|
267
262
|
[RSpec]: https://relishapp.com/rspec/
|
263
|
+
[Rubocop]: https://rubocop.org
|
268
264
|
|
269
|
-
[
|
265
|
+
[TreeNode]: rdoc-ref:Tree::TreeNode
|