rubytree 0.8.1 → 0.8.2

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.
File without changes
@@ -1,3 +1,8 @@
1
+ === 0.8.2 / 2011-12-15
2
+
3
+ * Minor bug-fix release to address bug #1215 (Tree::TreeNode#to_s
4
+ breaks if @content or @parent.name is not a string).
5
+
1
6
  === 0.8.1 / 2010-10-02
2
7
 
3
8
  * This is the public release of R0.8.0, with additional bug-fixes.
data/README CHANGED
@@ -6,7 +6,7 @@
6
6
  \/ \_/\__,_|_.__/ \__, |\__|_| \___|\___|
7
7
  |___/
8
8
 
9
- Copyright (c) 2006, 2007, 2008, 2009, 2010 Anupam Sengupta (anupamsg at gmail dot com)
9
+ Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Anupam Sengupta (anupamsg at gmail dot com)
10
10
 
11
11
  http://rubytree.rubyforge.org
12
12
 
@@ -11,7 +11,7 @@
11
11
  # Author:: Anupam Sengupta (anupamsg@gmail.com)
12
12
  #
13
13
 
14
- # Copyright (c) 2006, 2007, 2008, 2009, 2010 Anupam Sengupta
14
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Anupam Sengupta
15
15
  #
16
16
  # All rights reserved.
17
17
  #
@@ -48,7 +48,7 @@
48
48
  module Tree
49
49
 
50
50
  # Rubytree Package Version
51
- VERSION = '0.8.1'
51
+ VERSION = '0.8.2'
52
52
 
53
53
  # == TreeNode Class Description
54
54
  #
@@ -184,8 +184,8 @@ module Tree
184
184
  # @return [String] A string representation of the node.
185
185
  def to_s
186
186
  "Node Name: #{@name}" +
187
- " Content: " + (@content || "<Empty>") +
188
- " Parent: " + (is_root?() ? "<None>" : @parent.name) +
187
+ " Content: " + (@content.to_s || "<Empty>") +
188
+ " Parent: " + (is_root?() ? "<None>" : @parent.name.to_s) +
189
189
  " Children: #{@children.length}" +
190
190
  " Total Nodes: #{size()}"
191
191
  end
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # $Revision$ by $Author$ on $Date$
6
6
  #
7
- # Copyright (c) 2006, 2007, 2008, 2009, 2010 Anupam Sengupta
7
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Anupam Sengupta
8
8
  #
9
9
  # All rights reserved.
10
10
  #
@@ -164,6 +164,30 @@ module TestTree
164
164
  expected_string = "Node Name: A Node Content: Some Content Parent: <None> Children: 0 Total Nodes: 1"
165
165
 
166
166
  assert_equal(expected_string, a_node.to_s, "The string representation should be same")
167
+
168
+ # Now test with a symbol as a key.
169
+ a_node = Tree::TreeNode.new(:Node_Name, "Some Content")
170
+ expected_string = "Node Name: Node_Name Content: Some Content Parent: <None> Children: 0 Total Nodes: 1"
171
+ assert_equal(expected_string, a_node.to_s, "The string representation should be same")
172
+
173
+ # Now test with a symbol as a key and another symbol as the content.
174
+ a_node = Tree::TreeNode.new(:Node_Name, :Content)
175
+ expected_string = "Node Name: Node_Name Content: Content Parent: <None> Children: 0 Total Nodes: 1"
176
+ assert_equal(expected_string, a_node.to_s, "The string representation should be same")
177
+
178
+ # Now test with a symbol as a key, and a hash as the content.
179
+ a_hash = {:a_key => "Some Value"}
180
+ a_node = Tree::TreeNode.new(:Node_Name, a_hash)
181
+ expected_string = "Node Name: Node_Name Content: #{a_hash} Parent: <None> Children: 0 Total Nodes: 1"
182
+ assert_equal(expected_string, a_node.to_s, "The string representation should be same")
183
+
184
+ # Lets now add a child to the previous node, and test the to_s for the child
185
+ child_node = Tree::TreeNode.new(:Child_node, "Child Node")
186
+ a_node << child_node
187
+
188
+ expected_string = "Node Name: Child_node Content: Child Node Parent: Node_Name Children: 0 Total Nodes: 1"
189
+ assert_equal(expected_string, child_node.to_s, "The string representation should be same")
190
+
167
191
  end
168
192
 
169
193
  # Test the first_sibling method.
metadata CHANGED
@@ -1,64 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubytree
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
5
- prerelease: false
4
+ hash: 59
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 1
10
- version: 0.8.1
9
+ - 2
10
+ version: 0.8.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Anupam Sengupta
14
14
  autorequire:
15
15
  bindir: bin
16
- cert_chain:
17
- - |
18
- -----BEGIN CERTIFICATE-----
19
- MIIDMjCCAhqgAwIBAgIBADANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhhbnVw
20
- YW1zZzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
21
- MB4XDTEwMDkyODIwMzExOFoXDTExMDkyODIwMzExOFowPzERMA8GA1UEAwwIYW51
22
- cGFtc2cxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
23
- bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPf87wKYt5whj50qYVw2
24
- gZ3xDKK5pNxJFhxHanrRWhk3JURGJjM9jk9i2Ei4eDYzSf/sYpGAMIXjISOp5p8Y
25
- 0Ihw7jN7b7doxpayIvo+h66N5RdIVXGK5+hWynuqumTs577+97eS93Kx4v1cDWXv
26
- M9ENYykowwe2b+TlsqvIMeGfGNX6dtnP5MjmlAyZdSlMHqj/m5a6tSDWCwIrwJjA
27
- EY0iwIvRlqssuvKPxH2skK4Fh22H179tCswoZfpvG1L6UzrZDWCZ8Ane/azXmTNs
28
- gV6/xwXdApf9Pbcz6M1glk1+bqeh40K7g4Vn74qVKWBGN+dOxV25VWZDRbHfpWJw
29
- Sc8CAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFAaE
30
- AJueWTN4Jk2eSqVTEtcwJsGaMA0GCSqGSIb3DQEBBQUAA4IBAQACRDVp7B9IX5bg
31
- XzjyPpp0flo50sn1ckN8Tp+2JW9m5AYjqis8kDHSfIkde8Qem3lPP1dMyuLoLr/f
32
- Rm2VTLF6ANCTTghezqcF71g64WdYm4sHRJ7HWk1U4O7OI/FlsU1rV4ci+myU+GYT
33
- Bugm4xj1CQcQ26CbmRFaDUelQmAt2BVC4bknZPDMbAbBIr9EOr6H5DvURMS6Vieg
34
- xQGekdJ942Ue5hphzV2o4Zwm5R0qPjqhnRO1MXtdjly1YCFtbN3XZ6ijMSLBvzRq
35
- Y+h3eilU09UAlB+ozLJKjYMrnkFJH7f0gNt0+5iUG5vP+3aaIXyP3bOIKe9YAuPa
36
- MVN7wJio
37
- -----END CERTIFICATE-----
16
+ cert_chain: []
38
17
 
39
- date: 2010-10-02 00:00:00 +05:30
40
- default_executable:
18
+ date: 2011-12-16 00:00:00 Z
41
19
  dependencies:
42
- - !ruby/object:Gem::Dependency
43
- name: rubyforge
44
- prerelease: false
45
- requirement: &id001 !ruby/object:Gem::Requirement
46
- none: false
47
- requirements:
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- hash: 7
51
- segments:
52
- - 2
53
- - 0
54
- - 4
55
- version: 2.0.4
56
- type: :development
57
- version_requirements: *id001
58
20
  - !ruby/object:Gem::Dependency
59
21
  name: hoe-yard
60
22
  prerelease: false
61
- requirement: &id002 !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
62
24
  none: false
63
25
  requirements:
64
26
  - - ">="
@@ -70,23 +32,22 @@ dependencies:
70
32
  - 2
71
33
  version: 0.1.2
72
34
  type: :development
73
- version_requirements: *id002
35
+ version_requirements: *id001
74
36
  - !ruby/object:Gem::Dependency
75
37
  name: hoe
76
38
  prerelease: false
77
- requirement: &id003 !ruby/object:Gem::Requirement
39
+ requirement: &id002 !ruby/object:Gem::Requirement
78
40
  none: false
79
41
  requirements:
80
- - - ">="
42
+ - - ~>
81
43
  - !ruby/object:Gem::Version
82
- hash: 19
44
+ hash: 27
83
45
  segments:
84
46
  - 2
85
- - 6
86
- - 2
87
- version: 2.6.2
47
+ - 12
48
+ version: "2.12"
88
49
  type: :development
89
- version_requirements: *id003
50
+ version_requirements: *id002
90
51
  description: |-
91
52
  RubyTree is a Ruby implementation of the generic tree data structure. It provides a node-based model to store keyed
92
53
  node-elements in the tree and simple APIs to access, modify and traverse the structure. RubyTree is node-centric, where
@@ -117,7 +78,7 @@ files:
117
78
  - setup.rb
118
79
  - test/test_binarytree.rb
119
80
  - test/test_tree.rb
120
- has_rdoc: yard
81
+ - .gemtest
121
82
  homepage: http://rubytree.rubyforge.org
122
83
  licenses: []
123
84
 
@@ -169,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
130
  requirements: []
170
131
 
171
132
  rubyforge_project: rubytree
172
- rubygems_version: 1.3.7
133
+ rubygems_version: 1.8.10
173
134
  signing_key:
174
135
  specification_version: 3
175
136
  summary: RubyTree is a Ruby implementation of the generic tree data structure
data.tar.gz.sig DELETED
@@ -1 +0,0 @@
1
- ܥ**�]ڏ�)�5"����qƵtܣ�g��Fl]t�߉���8?��)��������Bl"3mj(˳~�"U<_�M="�J�>�ݚ�K�1�h�Hgaw(�,���)T9�N��ⶎ�ڙ���P-q���U������)��u��T�e��>-��l�H�{�`,���Cn6� ow�x��q�(k'g`��{pɆ^u�4��&xGQ��E�DP*�.`���F?�m��m>+��W�� C���U�f%u��2z\0�
metadata.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- VK� �jz�Z|X�1��������3y�dj6_�o��. ䷿��ca�X��g�Y�����/�����ixe�����bfkD'҅�8>:trJ�(�`��sY��M��L�FH*� W}�R�G3�H��wi���4�o*é�DN-נ�Y`�8� �Z+H+gsi#%�[`��������s�'T�.�U���2|�<��G,�>7�gڪ��� �|tµ��W!�x�ˆ[Z
2
- � 4�ܢ�Wgxm��M�7