rubytree 0.9.7 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 76d30f00380e7ea4594dda970de679d6949a61b9
4
- data.tar.gz: 11a9fe380940e988200f84e2f69dff3752e4e380
2
+ SHA256:
3
+ metadata.gz: 32db11d4bf364a3abad82c8b165293c44ac979a3ba4c5c80e73470558e1cd450
4
+ data.tar.gz: 298a2b4c37fec0b18f48267607f712debe73271e440ad77dc73bbb3ae43b24df
5
5
  SHA512:
6
- metadata.gz: b7e9ee7173158d02e55c29ea3122076bc164f3bc180a717bce34bf0ca29d65e9e60bd9f0d13fccb16cf4339e064a56d05e2a0bb120b2bf2a65edb83cef29b7ec
7
- data.tar.gz: cf1ced56a4092931a7f8439a466c68a338a3fb86cac941862885bbdd4ac3c34abd8e2c3921e76504681bb075309112cd5b0b5b50faddb9a10e1a7a172c3c7d5f
6
+ metadata.gz: 9ed55c0a1915ff0d31405d32ec652351b061415c4b696bb044d4e9bf6f0dbaaa406df3d29a7b4236c46bb86467091454e6cccf75e9be5a6ace0651fdbf12610e
7
+ data.tar.gz: 8b215004ac680ca53db74700f1de3c5e08d6c383cbe2b1548281966a4b4a7113c21cd6c4f49b991e4e55fac5da1e0635672c2055bf8ddafa2d8cf50731fbdcc8
data/API-CHANGES.md ADDED
@@ -0,0 +1,153 @@
1
+ # API Changes in RubyTree
2
+
3
+ This lists the various API changes that have been made to the `RubyTree`
4
+ package.
5
+
6
+ _Note_: API changes are expected to reduce significantly after the `1.x`
7
+ release. In most cases, an alternative will be provided to ensure relatively
8
+ smooth transition to the new APIs.
9
+
10
+ ## Release 2.0.0 Changes
11
+
12
+ * The _minimum_ required Ruby version is now `2.6` (or higher).
13
+
14
+ * The long-broken `Tree::TreeNode#depth` method has _finally_ been removed. Use
15
+ [Tree::TreeNode#node_depth][node_depth] instead.
16
+
17
+ * Support for `CamelCase` methods has been removed. This was a legacy shim
18
+ that has hopefully outlived its usefulness.
19
+
20
+ * Use of integers as node-names now no longer requires the optional
21
+ `num_as_name` method argument.
22
+
23
+ * The predicate methods beginning with `is_` or `has_` are now aliases to the
24
+ real methods **without** these prefixes. For example,
25
+ `Tree::TreeNode#is_root?` is now aliased to `Tree::TreeNode#root?`. This is to
26
+ comply with the Ruby standard. These original prefixed method names should be
27
+ considered as deprecated and the corresponding non-prefixed method names
28
+ should be used instead. it is possible that the old prefixed method names
29
+ might be removed in the future.
30
+
31
+ * [structured_warnings][] has been **removed** from the code-base and is no
32
+ longer a dependency. This was a long-standing point of friction for many
33
+ users.
34
+
35
+ ## Release 0.9.5 Changes
36
+
37
+ * The [Tree::TreeNode#add][add] method now provides **move** semantics, if a
38
+ child node on an existing tree is added to another tree, or another location
39
+ on the same tree. In this situation, the child node is removed from its old
40
+ position and added to the new parent node. After the add operation is
41
+ complete, the child no longer exists on the old tree/location.
42
+
43
+ ## Release 0.9.3 Changes
44
+
45
+ * Validation for unique node names has changed in the [Tree::TreeNode#add][add]
46
+ method. `RubyTree` no longer enforces globally unique names. The node-names
47
+ need to be unique _only between_ the sibling nodes.
48
+
49
+ ## Release 0.9.0 Changes
50
+
51
+ * New post-ordered traversal via the
52
+ [Tree::TreeNode#postordered_each][postordered_each] method.
53
+
54
+ * The Binary Tree implementation now supports in-order traversal via the
55
+ [Tree::BinaryTreeNode#inordered_each][inordered_each] method.
56
+
57
+ * `RubyTree` now mixes in the
58
+ [Comparable](http://ruby-doc.org/core-1.8.7/Comparable.html) module.
59
+
60
+ * The traversal methods ([Tree::TreeNode#each][each],
61
+ [Tree::TreeNode#preordered_each][preordered_each],
62
+ [Tree::TreeNode#postordered_each][postordered_each] and
63
+ [Tree::TreeNode#breadth_each][breadth_each] now correctly return an
64
+ [Enumerator](rdoc-ref:http://ruby-doc.org/core-1.8.7/Enumerable.html) as the
65
+ return value when no block is given, and return the receiver node if a block
66
+ was provided. This is consistent with how the standard Ruby collections work.
67
+
68
+ ## Release 0.8.3 Changes
69
+
70
+ * [Tree::TreeNode#siblings][siblings] will now return an empty array for the
71
+ root node.
72
+
73
+ ## Release 0.8.0 Changes
74
+
75
+ * Added the ability to specify an optional insertion position in the
76
+ [Tree::TreeNode#add][add] method. Idea and original code contributed by Dirk.
77
+
78
+ * Added a new method
79
+ [Tree::TreeNode#detached_subtree_copy][detached_subtree_copy] to allow cloning
80
+ the entire tree. This method is also aliased to
81
+ [Tree::TreeNode#dup][dup]. Idea and original code contributed by Vincenzo
82
+ Farruggia.
83
+
84
+ * Converted all _CamelCase_ method names to the canonical ruby_method_names
85
+ (underscore separated). The CamelCase methods can still be invoked, but
86
+ will throw a deprecated warning.
87
+
88
+ ## Release 0.7.0 Changes
89
+
90
+ * Converted all exceptions thrown on invalid method arguments to from
91
+ `RuntimeError` to `ArgumentError`. This impacts the following methods:
92
+
93
+ * [Tree::TreeNode#initialize][initialize]
94
+ * [Tree::TreeNode#add][add]
95
+ * [Tree::TreeNode#[]][access]
96
+ * [Tree::BinaryTreeNode#add][btree_add]
97
+
98
+
99
+ * Added [Tree::TreeNode#level][level] as an alias for
100
+ [Tree::TreeNode#node_depth][node_depth]
101
+
102
+ * Added new methods [Tree::TreeNode#in_degree][in_degree] and
103
+ [Tree::TreeNode#out_degree][out_degree] to report the node's degree stats.
104
+
105
+ * [Tree::TreeNode#is_only_child?][is_only_child] now returns `true` for a root
106
+ node.
107
+
108
+ * [Tree::TreeNode#next_sibling][next_sibling] and
109
+ [Tree::TreeNode#previous_sibling][previous_sibling] now return `nil` for a
110
+ root node.
111
+
112
+ * [Tree::TreeNode#add][add] and [Tree::TreeNode#<<][append] now throw an
113
+ `ArgumentError` exception if a `nil` node is passed as an argument.
114
+
115
+ * Added new methods
116
+ [Tree::TreeNode#to_json][to_json] and
117
+ [Tree::TreeNode#json_create][json_create]
118
+ to convert to/from the JSON format. Thanks to
119
+ [Dirk](http://github.com/railsbros-dirk) for this change.
120
+
121
+ ## Release 0.6.1 Changes
122
+
123
+ * Deprecated the [Tree::Utils::TreeMetricsHandler#depth][depth] method as it was
124
+ returning an incorrect depth value. Have introduced a new replacement method
125
+ [Tree::Utils::TreeMetricsHandler#node_depth][node_depth] which returns the
126
+ correct result.
127
+
128
+
129
+ [structured_warnings]: https://github.com/schmidt/structured_warnings
130
+
131
+ [access]: rdoc-ref:Tree::TreeNode#[]
132
+ [add]: rdoc-ref:Tree::TreeNode#add
133
+ [append]: rdoc-ref:Tree::TreeNode#<<
134
+ [breadth_each]: rdoc-ref:Tree::TreeNode#breadth_each
135
+ [btree_add]: rdoc-ref:Tree::BinaryTreeNode#add
136
+ [depth]: rdoc-ref:Tree::Utils::TreeMetricsHandler#depth
137
+ [detached_subtree_copy]: rdoc-ref:Tree::TreeNode#detached_subtree_copy
138
+ [dup]: rdoc-ref:Tree::TreeNode#dup
139
+ [each]: rdoc-ref:Tree::TreeNode#each
140
+ [in_degree]: rdoc-ref:Tree::Utils::TreeMetricsHandler#in_degree
141
+ [initialize]: rdoc-ref:Tree::TreeNode#initialize
142
+ [inordered_each]: rdoc-ref:Tree::BinaryTreeNode#inordered_each
143
+ [is_only_child]: rdoc-ref:Tree::TreeNode#is_only_child?
144
+ [json_create]: rdoc-ref:Tree::Utils::JSONConverter::ClassMethods#json_create
145
+ [level]: rdoc-ref:Tree::Utils::TreeMetricsHandler#level
146
+ [next_sibling]: rdoc-ref:Tree::TreeNode#next_sibling
147
+ [node_depth]: rdoc-ref:Tree::Utils::TreeMetricsHandler#node_depth
148
+ [out_degree]: rdoc-ref:Tree::Utils::TreeMetricsHandler#out_degree
149
+ [postordered_each]: rdoc-ref:Tree::TreeNode#postordered_each
150
+ [preordered_each]: rdoc-ref:Tree::TreeNode#preordered_each
151
+ [previous_sibling]: rdoc-ref:Tree::TreeNode#previous_sibling
152
+ [siblings]: rdoc-ref:Tree::TreeNode#siblings
153
+ [to_json]: rdoc-ref:Tree::Utils::JSONConverter#to_json
data/Gemfile CHANGED
@@ -1,15 +1,4 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
2
 
3
- # Specify your gem's dependencies in rubytree.gemspec
3
+ source 'https://rubygems.org'
4
4
  gemspec
5
-
6
- group :development, :test do
7
- gem "rake", "~> 10.4"
8
- gem "test-unit", "~> 3.0"
9
- gem "coveralls", ">= 0.7", :require => false, :platforms => :mri_21
10
- gem "rspec", ">= 3.4"
11
- end
12
-
13
- # Local Variables:
14
- # mode: ruby
15
- # End:
data/Gemfile.lock CHANGED
@@ -1,83 +1,82 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubytree (0.9.7)
5
- json (~> 1.8)
6
- structured_warnings (~> 0.2)
4
+ rubytree (2.0.0)
5
+ json (~> 2.0, > 2.3.1)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
10
9
  specs:
11
- coveralls (0.8.10)
12
- json (~> 1.8)
13
- rest-client (>= 1.6.8, < 2)
14
- simplecov (~> 0.11.0)
15
- term-ansicolor (~> 1.3)
16
- thor (~> 0.19.1)
17
- tins (~> 1.6.0)
18
- diff-lcs (1.2.5)
19
- docile (1.1.5)
20
- domain_name (0.5.25)
21
- unf (>= 0.0.5, < 1.0.0)
22
- http-cookie (1.0.2)
23
- domain_name (~> 0.5)
24
- json (1.8.3)
25
- mime-types (2.99)
26
- netrc (0.11.0)
27
- power_assert (0.2.6)
28
- rake (10.4.2)
29
- rdoc (4.2.1)
30
- json (~> 1.4)
31
- rest-client (1.8.0)
32
- http-cookie (>= 1.0.2, < 2.0)
33
- mime-types (>= 1.16, < 3.0)
34
- netrc (~> 0.7)
35
- rspec (3.4.0)
36
- rspec-core (~> 3.4.0)
37
- rspec-expectations (~> 3.4.0)
38
- rspec-mocks (~> 3.4.0)
39
- rspec-core (3.4.1)
40
- rspec-support (~> 3.4.0)
41
- rspec-expectations (3.4.0)
10
+ ast (2.4.2)
11
+ diff-lcs (1.5.0)
12
+ json (2.6.2)
13
+ parallel (1.22.1)
14
+ parser (3.1.2.0)
15
+ ast (~> 2.4.1)
16
+ power_assert (2.0.1)
17
+ psych (4.0.4)
18
+ stringio
19
+ rainbow (3.1.1)
20
+ rake (13.0.6)
21
+ rdoc (6.4.0)
22
+ psych (>= 4.0.0)
23
+ regexp_parser (2.5.0)
24
+ rexml (3.2.5)
25
+ rspec (3.11.0)
26
+ rspec-core (~> 3.11.0)
27
+ rspec-expectations (~> 3.11.0)
28
+ rspec-mocks (~> 3.11.0)
29
+ rspec-core (3.11.0)
30
+ rspec-support (~> 3.11.0)
31
+ rspec-expectations (3.11.0)
42
32
  diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.4.0)
44
- rspec-mocks (3.4.0)
33
+ rspec-support (~> 3.11.0)
34
+ rspec-mocks (3.11.1)
45
35
  diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.4.0)
47
- rspec-support (3.4.1)
36
+ rspec-support (~> 3.11.0)
37
+ rspec-support (3.11.0)
48
38
  rtags (0.97)
49
39
  rtagstask (0.0.4)
50
40
  rtags (> 0.0.0)
51
- simplecov (0.11.1)
52
- docile (~> 1.1.0)
53
- json (~> 1.8)
54
- simplecov-html (~> 0.10.0)
55
- simplecov-html (0.10.0)
56
- structured_warnings (0.2.0)
57
- term-ansicolor (1.3.2)
58
- tins (~> 1.0)
59
- test-unit (3.1.5)
41
+ rubocop (1.30.1)
42
+ parallel (~> 1.10)
43
+ parser (>= 3.1.0.0)
44
+ rainbow (>= 2.2.2, < 4.0)
45
+ regexp_parser (>= 1.8, < 3.0)
46
+ rexml (>= 3.2.5, < 4.0)
47
+ rubocop-ast (>= 1.18.0, < 2.0)
48
+ ruby-progressbar (~> 1.7)
49
+ unicode-display_width (>= 1.4.0, < 3.0)
50
+ rubocop-ast (1.18.0)
51
+ parser (>= 3.1.1.0)
52
+ rubocop-rake (0.6.0)
53
+ rubocop (~> 1.0)
54
+ rubocop-rspec (2.11.1)
55
+ rubocop (~> 1.19)
56
+ ruby-progressbar (1.11.0)
57
+ stringio (3.0.2)
58
+ test-unit (3.5.3)
60
59
  power_assert
61
- thor (0.19.1)
62
- tins (1.6.0)
63
- unf (0.1.4)
64
- unf_ext
65
- unf_ext (0.0.7.1)
66
- yard (0.8.7.6)
60
+ unicode-display_width (2.1.0)
61
+ webrick (1.7.0)
62
+ yard (0.9.28)
63
+ webrick (~> 1.7.0)
67
64
 
68
65
  PLATFORMS
69
66
  ruby
70
67
 
71
68
  DEPENDENCIES
72
- bundler (~> 1.7)
73
- coveralls (>= 0.7)
74
- rake (~> 10.4)
75
- rdoc (~> 4.2)
76
- rspec (>= 3.4)
77
- rtagstask (~> 0.0)
69
+ bundler (~> 2.3)
70
+ rake (~> 13.0)
71
+ rdoc (~> 6.0)
72
+ rspec (~> 3.0, > 3.10)
73
+ rtagstask (~> 0.0.4)
74
+ rubocop (~> 1.0)
75
+ rubocop-rake (~> 0.0)
76
+ rubocop-rspec (~> 2.0)
78
77
  rubytree!
79
78
  test-unit (~> 3.0)
80
- yard (~> 0.8)
79
+ yard (~> 0.0, >= 0.9.20)
81
80
 
82
81
  BUNDLED WITH
83
- 1.10.2
82
+ 2.3.4