rubytree 1.0.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/API-CHANGES.md +153 -0
- data/Gemfile +2 -6
- data/Gemfile.lock +40 -55
- data/History.md +410 -0
- data/LICENSE.md +1 -1
- data/README.md +21 -24
- data/Rakefile +41 -20
- data/TODO.org +19 -15
- data/examples/example_basic.rb +14 -7
- data/lib/rubytree.rb +2 -3
- data/lib/tree/binarytree.rb +13 -12
- data/lib/tree/tree_deps.rb +2 -5
- data/lib/tree/utils/hash_converter.rb +129 -121
- data/lib/tree/utils/json_converter.rb +80 -77
- data/lib/tree/utils/metrics_methods.rb +14 -47
- data/lib/tree/utils/path_methods.rb +11 -11
- data/lib/tree/utils/tree_merge_handler.rb +80 -80
- data/lib/tree/utils/utils.rb +9 -7
- data/lib/tree/version.rb +3 -4
- data/lib/tree.rb +80 -82
- data/rubytree.gemspec +61 -38
- data/spec/spec_helper.rb +4 -2
- data/spec/tree_spec.rb +129 -28
- data/test/run_test.rb +4 -3
- data/test/test_binarytree.rb +25 -45
- data/test/test_rubytree_require.rb +2 -1
- data/test/test_subclassed_node.rb +2 -20
- data/test/test_thread_and_fiber.rb +4 -4
- data/test/test_tree.rb +126 -199
- metadata +103 -69
- data/API-CHANGES.rdoc +0 -99
- data/History.rdoc +0 -303
- data/lib/tree/utils/camel_case_method_handler.rb +0 -77
- data/setup.rb +0 -1565
@@ -4,9 +4,9 @@
|
|
4
4
|
#
|
5
5
|
# Author:: Anupam Sengupta (anupamsg@gmail.com)
|
6
6
|
#
|
7
|
-
# Time-stamp: <
|
7
|
+
# Time-stamp: <2022-06-20 22:16:46 anupam>
|
8
8
|
#
|
9
|
-
# Copyright (C) 2012, 2013, 2014, 2015 Anupam Sengupta <anupamsg@gmail.com>
|
9
|
+
# Copyright (C) 2012, 2013, 2014, 2015, 2022 Anupam Sengupta <anupamsg@gmail.com>
|
10
10
|
#
|
11
11
|
# All rights reserved.
|
12
12
|
#
|
@@ -34,93 +34,96 @@
|
|
34
34
|
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
35
35
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
36
36
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
37
|
+
#
|
38
|
+
# frozen_string_literal: true
|
37
39
|
|
38
|
-
require_relative '../utils/utils'
|
39
40
|
require 'json'
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
module Tree
|
43
|
+
module Utils
|
44
|
+
# Provides utility methods to convert a {Tree::TreeNode} to and from
|
45
|
+
# JSON[http://flori.github.com/json/].
|
46
|
+
module JSONConverter
|
47
|
+
def self.included(base)
|
48
|
+
base.extend(ClassMethods)
|
49
|
+
end
|
47
50
|
|
48
|
-
|
51
|
+
# @!group Converting to/from JSON
|
49
52
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
53
|
+
# Creates a JSON ready Hash for the #to_json method.
|
54
|
+
#
|
55
|
+
# @author Eric Cline (https://github.com/escline)
|
56
|
+
# @since 0.8.3
|
57
|
+
#
|
58
|
+
# @return A hash based representation of the JSON
|
59
|
+
#
|
60
|
+
# Rails uses JSON in ActiveSupport, and all Rails JSON encoding goes through
|
61
|
+
# +as_json+.
|
62
|
+
#
|
63
|
+
# @param [Object] _options
|
64
|
+
#
|
65
|
+
# @see #to_json
|
66
|
+
# @see http://stackoverflow.com/a/6880638/273808
|
67
|
+
# noinspection RubyUnusedLocalVariable
|
68
|
+
def as_json(_options = {})
|
69
|
+
json_hash = {
|
70
|
+
name: name,
|
71
|
+
content: content,
|
72
|
+
JSON.create_id => self.class.name
|
73
|
+
}
|
71
74
|
|
72
|
-
|
75
|
+
json_hash['children'] = children if children?
|
73
76
|
|
74
|
-
|
75
|
-
|
77
|
+
json_hash
|
78
|
+
end
|
76
79
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
80
|
+
# Creates a JSON representation of this node including all it's children.
|
81
|
+
# This requires the JSON gem to be available, or else the operation fails with
|
82
|
+
# a warning message. Uses the Hash output of #as_json method.
|
83
|
+
#
|
84
|
+
# @author Dirk Breuer (http://github.com/railsbros-dirk)
|
85
|
+
# @since 0.7.0
|
86
|
+
#
|
87
|
+
# @return The JSON representation of this subtree.
|
88
|
+
#
|
89
|
+
# @see ClassMethods#json_create
|
90
|
+
# @see #as_json
|
91
|
+
# @see http://flori.github.com/json
|
92
|
+
def to_json(*args)
|
93
|
+
as_json.to_json(*args)
|
94
|
+
end
|
92
95
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
96
|
+
# ClassMethods for the {JSONConverter} module. Will become class methods in
|
97
|
+
# the +include+ target.
|
98
|
+
module ClassMethods
|
99
|
+
# Helper method to create a Tree::TreeNode instance from the JSON hash
|
100
|
+
# representation. Note that this method should *NOT* be called directly.
|
101
|
+
# Instead, to convert the JSON hash back to a tree, do:
|
102
|
+
#
|
103
|
+
# tree = JSON.parse(the_json_hash)
|
104
|
+
#
|
105
|
+
# This operation requires the {JSON gem}[http://flori.github.com/json/] to
|
106
|
+
# be available, or else the operation fails with a warning message.
|
107
|
+
#
|
108
|
+
# @author Dirk Breuer (http://github.com/railsbros-dirk)
|
109
|
+
# @since 0.7.0
|
110
|
+
#
|
111
|
+
# @param [Hash] json_hash The JSON hash to convert from.
|
112
|
+
#
|
113
|
+
# @return [Tree::TreeNode] The created tree.
|
114
|
+
#
|
115
|
+
# @see #to_json
|
116
|
+
# @see http://flori.github.com/json
|
117
|
+
def json_create(json_hash)
|
118
|
+
node = new(json_hash['name'], json_hash['content'])
|
116
119
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
+
json_hash['children']&.each do |child|
|
121
|
+
node << child
|
122
|
+
end
|
123
|
+
|
124
|
+
node
|
120
125
|
end
|
121
126
|
end
|
122
|
-
|
123
|
-
node
|
124
127
|
end
|
125
128
|
end
|
126
129
|
end
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#
|
5
5
|
# Author:: Anupam Sengupta (anupamsg@gmail.com)
|
6
6
|
#
|
7
|
-
# Time-stamp: <
|
7
|
+
# Time-stamp: <2022-06-20 22:17:00 anupam>
|
8
8
|
#
|
9
|
-
# Copyright (C) 2013, 2015, 2017, 2021 Anupam Sengupta <anupamsg@gmail.com>
|
9
|
+
# Copyright (C) 2013, 2015, 2017, 2021, 2022 Anupam Sengupta <anupamsg@gmail.com>
|
10
10
|
#
|
11
11
|
# All rights reserved.
|
12
12
|
#
|
@@ -35,14 +35,12 @@
|
|
35
35
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
36
36
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
37
37
|
#
|
38
|
+
# frozen_string_literal: true
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
module TreeMetricsHandler
|
44
|
-
# noinspection RubyUnusedLocalVariable
|
45
|
-
def self.included(_base)
|
40
|
+
module Tree
|
41
|
+
module Utils
|
42
|
+
# Provides utility functions to measure various tree metrics.
|
43
|
+
module TreeMetricsHandler
|
46
44
|
# @!group Metrics and Measures
|
47
45
|
|
48
46
|
# @!attribute [r] size
|
@@ -79,9 +77,9 @@ module Tree::Utils
|
|
79
77
|
#
|
80
78
|
# @return [Integer] Height of the node.
|
81
79
|
def node_height
|
82
|
-
return 0 if
|
80
|
+
return 0 if leaf?
|
83
81
|
|
84
|
-
1 + @children.collect
|
82
|
+
1 + @children.collect(&:node_height).max
|
85
83
|
end
|
86
84
|
|
87
85
|
# @!attribute [r] node_depth
|
@@ -90,15 +88,11 @@ module Tree::Utils
|
|
90
88
|
# Depth:: Length of the node's path to its root. Depth of a root node is
|
91
89
|
# zero.
|
92
90
|
#
|
93
|
-
# *Note* that the deprecated method {#depth} was incorrectly computing
|
94
|
-
# this value. Please replace all calls to the old method with
|
95
|
-
# {#node_depth} instead.
|
96
|
-
#
|
97
91
|
# {#level} is an alias for this method.
|
98
92
|
#
|
99
93
|
# @return [Integer] Depth of this node.
|
100
94
|
def node_depth
|
101
|
-
return 0 if
|
95
|
+
return 0 if root?
|
102
96
|
|
103
97
|
1 + parent.node_depth
|
104
98
|
end
|
@@ -111,33 +105,6 @@ module Tree::Utils
|
|
111
105
|
node_depth
|
112
106
|
end
|
113
107
|
|
114
|
-
# @!attribute [r] depth
|
115
|
-
# Depth of the tree from this node. A single leaf node has a depth of 1.
|
116
|
-
#
|
117
|
-
# This method is *DEPRECATED* and may be removed in the subsequent
|
118
|
-
# releases. Note that the value returned by this method is actually the:
|
119
|
-
#
|
120
|
-
# _height_ + 1 of the node, *NOT* the _depth_.
|
121
|
-
#
|
122
|
-
# For correct and conventional behavior, please use {#node_depth} and
|
123
|
-
# {#node_height} methods instead.
|
124
|
-
#
|
125
|
-
# @return [Integer] depth of the node.
|
126
|
-
#
|
127
|
-
# @deprecated This method returns an incorrect value. Use the
|
128
|
-
# {#node_depth} method instead.
|
129
|
-
#
|
130
|
-
# @see #node_depth
|
131
|
-
def depth
|
132
|
-
warn StructuredWarnings::DeprecatedMethodWarning,
|
133
|
-
'This method is deprecated. '\
|
134
|
-
'Please use node_depth() or node_height() instead (bug # 22535)'
|
135
|
-
|
136
|
-
return 1 if is_leaf?
|
137
|
-
|
138
|
-
1 + @children.collect { |child| child.depth }.max
|
139
|
-
end
|
140
|
-
|
141
108
|
# @!attribute [r] breadth
|
142
109
|
# Breadth of the tree at this node's level.
|
143
110
|
# A single node without siblings has a breadth of 1.
|
@@ -148,7 +115,7 @@ module Tree::Utils
|
|
148
115
|
#
|
149
116
|
# @return [Integer] breadth of the node's level.
|
150
117
|
def breadth
|
151
|
-
|
118
|
+
root? ? 1 : parent.children.size
|
152
119
|
end
|
153
120
|
|
154
121
|
# @!attribute [r] in_degree
|
@@ -163,7 +130,7 @@ module Tree::Utils
|
|
163
130
|
#
|
164
131
|
# @return [Integer] The in-degree of this node.
|
165
132
|
def in_degree
|
166
|
-
|
133
|
+
root? ? 0 : 1
|
167
134
|
end
|
168
135
|
|
169
136
|
# @!attribute [r] out_degree
|
@@ -174,10 +141,10 @@ module Tree::Utils
|
|
174
141
|
#
|
175
142
|
# @return [Integer] The out-degree of this node.
|
176
143
|
def out_degree
|
177
|
-
|
144
|
+
leaf? ? 0 : children.size
|
178
145
|
end
|
179
146
|
|
180
147
|
# @!endgroup
|
181
|
-
end
|
148
|
+
end
|
182
149
|
end
|
183
150
|
end
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#
|
5
5
|
# Author:: Marco Ziccardi and Anupam Sengupta (anupamsg@gmail.com)
|
6
6
|
#
|
7
|
-
# Time-stamp: <
|
7
|
+
# Time-stamp: <2022-06-20 02:00:11 anupam>
|
8
8
|
#
|
9
|
-
# Copyright (C) 2015, 2021 Anupam Sengupta <anupamsg@gmail.com>
|
9
|
+
# Copyright (C) 2015, 2021, 2022 Anupam Sengupta <anupamsg@gmail.com>
|
10
10
|
#
|
11
11
|
# All rights reserved.
|
12
12
|
#
|
@@ -35,12 +35,12 @@
|
|
35
35
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
36
36
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
37
37
|
#
|
38
|
+
# frozen_string_literal: true
|
38
39
|
|
39
|
-
module Tree
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
def self.included(_base)
|
40
|
+
module Tree
|
41
|
+
module Utils
|
42
|
+
# Provides utility methods for path extraction
|
43
|
+
module TreePathHandler
|
44
44
|
# @!group Node Path
|
45
45
|
|
46
46
|
# Returns the path of this node from the root as a string, with the node
|
@@ -75,16 +75,16 @@ module Tree::Utils
|
|
75
75
|
def get_path_name_array(current_array_path = [])
|
76
76
|
path_array = current_array_path + [name]
|
77
77
|
|
78
|
-
if
|
78
|
+
if parent # Recurse to parent node.
|
79
|
+
parent.get_path_name_array(path_array)
|
80
|
+
else # else If detached node or root node.
|
79
81
|
path_array
|
80
|
-
else # Else recurse to parent node.
|
81
|
-
path_array = parent.get_path_name_array(path_array)
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
85
|
protected :get_path_name_array
|
86
86
|
|
87
87
|
# @!endgroup
|
88
|
-
end
|
88
|
+
end
|
89
89
|
end
|
90
90
|
end
|
@@ -3,9 +3,9 @@
|
|
3
3
|
# tree_merge_handler.rb
|
4
4
|
#
|
5
5
|
# Author: Anupam Sengupta
|
6
|
-
# Time-stamp: <
|
6
|
+
# Time-stamp: <2022-06-20 22:17:12 anupam>
|
7
7
|
#
|
8
|
-
# Copyright (C) 2013, 2015 Anupam Sengupta (anupamsg@gmail.com)
|
8
|
+
# Copyright (C) 2013, 2015, 2022 Anupam Sengupta (anupamsg@gmail.com)
|
9
9
|
#
|
10
10
|
# All rights reserved.
|
11
11
|
#
|
@@ -34,95 +34,95 @@
|
|
34
34
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
35
35
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
36
36
|
#
|
37
|
-
|
38
|
-
require_relative '../../../lib/tree/utils/utils'
|
37
|
+
# frozen_string_literal: true
|
39
38
|
|
40
39
|
# Provides utility methods to merge two {Tree::TreeNode} based trees.
|
41
40
|
# @since 0.9.0
|
42
|
-
module Tree
|
43
|
-
|
41
|
+
module Tree
|
42
|
+
module Utils
|
43
|
+
# Handles merging of two trees.
|
44
|
+
module TreeMergeHandler
|
45
|
+
# @!group Merging Trees
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
47
|
+
# Merge two trees that share the same root node and returns <em>a new
|
48
|
+
# tree</em>.
|
49
|
+
#
|
50
|
+
# The new tree contains the contents of the merge between _other_tree_ and
|
51
|
+
# self. Duplicate nodes (coming from _other_tree_) will *NOT* be overwritten
|
52
|
+
# in self.
|
53
|
+
#
|
54
|
+
# @author Darren Oakley (https://github.com/dazoakley)
|
55
|
+
#
|
56
|
+
# @param [Tree::TreeNode] other_tree The other tree to merge with.
|
57
|
+
# @return [Tree::TreeNode] the resulting tree following the merge.
|
58
|
+
#
|
59
|
+
# @raise [TypeError] This exception is raised if _other_tree_ is not a
|
60
|
+
# {Tree::TreeNode}.
|
61
|
+
#
|
62
|
+
# @raise [ArgumentError] This exception is raised if _other_tree_ does not
|
63
|
+
# have the same root node as self.
|
64
|
+
def merge(other_tree)
|
65
|
+
check_merge_prerequisites(other_tree)
|
66
|
+
merge_trees(root.dup, other_tree.root)
|
67
|
+
end
|
66
68
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
69
|
+
# Merge in another tree (that shares the same root node) into +this+ tree.
|
70
|
+
# Duplicate nodes (coming from _other_tree_) will NOT be overwritten in
|
71
|
+
# self.
|
72
|
+
#
|
73
|
+
# @author Darren Oakley (https://github.com/dazoakley)
|
74
|
+
#
|
75
|
+
# @param [Tree::TreeNode] other_tree The other tree to merge with.
|
76
|
+
#
|
77
|
+
# @raise [TypeError] This exception is raised if _other_tree_ is not a
|
78
|
+
# {Tree::TreeNode}.
|
79
|
+
#
|
80
|
+
# @raise [ArgumentError] This exception is raised if _other_tree_ does not
|
81
|
+
# have the same root node as self.
|
82
|
+
def merge!(other_tree)
|
83
|
+
check_merge_prerequisites(other_tree)
|
84
|
+
merge_trees(root, other_tree.root)
|
85
|
+
end
|
84
86
|
|
85
|
-
|
87
|
+
private
|
86
88
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
'You can only merge in another instance of Tree::TreeNode'
|
97
|
-
end
|
89
|
+
# Utility function to check that the conditions for a tree merge are met.
|
90
|
+
#
|
91
|
+
# @author Darren Oakley (https://github.com/dazoakley)
|
92
|
+
#
|
93
|
+
# @see #merge
|
94
|
+
# @see #merge!
|
95
|
+
def check_merge_prerequisites(other_tree)
|
96
|
+
raise TypeError, 'You can only merge in another instance of Tree::TreeNode' \
|
97
|
+
unless other_tree.is_a?(Tree::TreeNode)
|
98
98
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
end
|
103
|
-
end
|
99
|
+
raise ArgumentError, 'Unable to merge trees as they do not share the same root' \
|
100
|
+
unless root.name == other_tree.root.name
|
101
|
+
end
|
104
102
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
103
|
+
# Utility function to recursively merge two subtrees.
|
104
|
+
#
|
105
|
+
# @author Darren Oakley (https://github.com/dazoakley)
|
106
|
+
#
|
107
|
+
# @param [Tree::TreeNode] tree1 The target tree to merge into.
|
108
|
+
# @param [Tree::TreeNode] tree2 The donor tree (that will be merged
|
109
|
+
# into target).
|
110
|
+
# @raise [Tree::TreeNode] The merged tree.
|
111
|
+
def merge_trees(tree1, tree2)
|
112
|
+
names1 = tree1.children? ? tree1.children.map(&:name) : []
|
113
|
+
names2 = tree2.children? ? tree2.children.map(&:name) : []
|
116
114
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
115
|
+
names_to_merge = names2 - names1
|
116
|
+
names_to_merge.each do |name|
|
117
|
+
tree1 << tree2[name].detached_subtree_copy
|
118
|
+
end
|
121
119
|
|
122
|
-
|
123
|
-
|
124
|
-
|
120
|
+
tree1.children.each do |child|
|
121
|
+
merge_trees(child, tree2[child.name]) unless tree2[child.name].nil?
|
122
|
+
end
|
125
123
|
|
126
|
-
|
124
|
+
tree1
|
125
|
+
end
|
126
|
+
end
|
127
127
|
end
|
128
128
|
end
|
data/lib/tree/utils/utils.rb
CHANGED
@@ -4,11 +4,9 @@
|
|
4
4
|
#
|
5
5
|
# Author:: Anupam Sengupta (anupamsg@gmail.com)
|
6
6
|
#
|
7
|
-
# Time-stamp: <
|
7
|
+
# Time-stamp: <2022-06-20 01:21:38 anupam>
|
8
8
|
#
|
9
|
-
# Copyright (C) 2012
|
10
|
-
#
|
11
|
-
# All rights reserved.
|
9
|
+
# Copyright (C) 2012-2022 Anupam Sengupta. All rights reserved.
|
12
10
|
#
|
13
11
|
# Redistribution and use in source and binary forms, with or without
|
14
12
|
# modification, are permitted provided that the following conditions are met:
|
@@ -34,9 +32,13 @@
|
|
34
32
|
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
35
33
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
36
34
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
35
|
+
#
|
36
|
+
# frozen_string_literal: true
|
37
37
|
|
38
38
|
# Provides utilities and mixin modules for RubyTree.
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
module Tree
|
40
|
+
# Provides various utilities for the TreeNode class.
|
41
|
+
module Utils
|
42
|
+
# Empty module. Being used as a namespace.
|
43
|
+
end
|
42
44
|
end
|
data/lib/tree/version.rb
CHANGED
@@ -4,9 +4,7 @@
|
|
4
4
|
#
|
5
5
|
# Author:: Anupam Sengupta (anupamsg@gmail.com)
|
6
6
|
#
|
7
|
-
# Copyright (c) 2012
|
8
|
-
#
|
9
|
-
# All rights reserved.
|
7
|
+
# Copyright (c) 2012-2022 Anupam Sengupta. All rights reserved.
|
10
8
|
#
|
11
9
|
# Redistribution and use in source and binary forms, with or without
|
12
10
|
# modification, are permitted provided that the following conditions are met:
|
@@ -33,8 +31,9 @@
|
|
33
31
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
34
32
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
35
33
|
#
|
34
|
+
# frozen_string_literal: true
|
36
35
|
|
37
36
|
module Tree
|
38
37
|
# Rubytree Package Version
|
39
|
-
VERSION = '
|
38
|
+
VERSION = '2.0.0'
|
40
39
|
end
|