rubytree 0.5.2 → 0.5.3

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.
Files changed (9) hide show
  1. data/COPYING +22 -26
  2. data/ChangeLog +18 -0
  3. data/History.txt +11 -5
  4. data/README +150 -147
  5. data/Rakefile +41 -123
  6. data/TODO +5 -3
  7. data/lib/tree.rb +12 -4
  8. data/lib/tree/binarytree.rb +0 -0
  9. metadata +20 -11
data/COPYING CHANGED
@@ -1,31 +1,27 @@
1
- RUBYTREE - http://rubytree.rubyforge.org
2
- ========================================
1
+ = Rubytree
2
+
3
+ http://rubytree.rubyforge.org
3
4
 
4
5
  Copyright (c) 2006, 2007 Anupam Sengupta
5
6
 
6
7
  All rights reserved.
7
8
 
8
- Redistribution and use in source and binary forms, with or without modification,
9
- are permitted provided that the following conditions are met:
10
-
11
- - Redistributions of source code must retain the above copyright notice, this
12
- list of conditions and the following disclaimer.
13
-
14
- - Redistributions in binary form must reproduce the above copyright notice, this
15
- list of conditions and the following disclaimer in the documentation and/or
16
- other materials provided with the distribution.
17
-
18
- - Neither the name of the organization nor the names of its contributors may
19
- be used to endorse or promote products derived from this software without
20
- specific prior written permission.
21
-
22
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
10
+ following conditions are met:
11
+
12
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following
13
+ disclaimer.
14
+
15
+ - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
16
+ disclaimer in the documentation and/or other materials provided with the distribution.
17
+
18
+ - Neither the name of the organization nor the names of its contributors may be used to endorse or promote products
19
+ derived from this software without specific prior written permission.
20
+
21
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/ChangeLog CHANGED
@@ -1,3 +1,21 @@
1
+ 2010-01-01 Anupam Sengupta <anupamsg@gmail.com>
2
+
3
+ * Rakefile: Have migrated 100% to usage of Hoe for the rake
4
+ tasks. Have removed all legacy GemSpec and custom task definitions.
5
+
6
+ * .cvsignore: Added the coverage.info file to the excluded list.
7
+
8
+ * TODO: More TODO items. Changed the file mode to use org-mode.
9
+
10
+ * History.txt: Added the change log summary.
11
+
12
+ * README: Updated the content to match the Hoe sections. Minor
13
+ formatting performed. Changed the line endings to Unix.
14
+
15
+ * COPYING: Minor formatting changes.
16
+
17
+ * lib/tree.rb (Tree): Updated the release version number.
18
+
1
19
  2007-12-21 Anupam Sengupta <anupamsg@gmail.com>
2
20
 
3
21
  * Rakefile: Added the rcov option to exclude rcov itself from
data/History.txt CHANGED
@@ -1,20 +1,26 @@
1
- = 0.5.2 / 2007-12-21
1
+ === 0.5.3 / 2009-12-31
2
+
3
+ * Cleanup of the build system to exclusively use Hoe.
4
+ * Modifications and reformatting to the documentation.
5
+ * No user visible changes.
6
+
7
+ === 0.5.2 / 2007-12-21
2
8
 
3
9
  * Added more test cases and enabled ZenTest compatibility for the test case
4
10
  names.
5
11
 
6
- = 0.5.1 / 2007-12-20
12
+ === 0.5.1 / 2007-12-20
7
13
 
8
14
  * Minor code refactoring.
9
15
 
10
- = 0.5.0 / 2007-12-18
16
+ === 0.5.0 / 2007-12-18
11
17
 
12
18
  * Fixed the marshalling code to correctly handle non-string content.
13
19
 
14
- = 0.4.3 / 2007-10-09
20
+ === 0.4.3 / 2007-10-09
15
21
 
16
22
  * Changes to the build mechanism (now uses Hoe).
17
23
 
18
- = 0.4.2 / 2007-10-01
24
+ === 0.4.2 / 2007-10-01
19
25
 
20
26
  * Minor code refactoring. Changes in the Rakefile.
data/README CHANGED
@@ -1,147 +1,150 @@
1
-
2
- __ _ _
3
- /__\_ _| |__ _ _| |_ _ __ ___ ___
4
- / \// | | | '_ \| | | | __| '__/ _ \/ _ \
5
- / _ \ |_| | |_) | |_| | |_| | | __/ __/
6
- \/ \_/\__,_|_.__/ \__, |\__|_| \___|\___|
7
- |___/
8
-
9
- (c) 2006, 2007 Anupam Sengupta
10
- http://rubytree.rubyforge.org
11
-
12
- Rubytree is a simple implementation of the generic Tree data structure. This
13
- implementation is node-centric, where the individual nodes on the tree are the
14
- primary objects and drive the structure.
15
-
16
- == INSTALL:
17
-
18
- Rubytree is an open source project and is hosted at:
19
-
20
- http://rubytree.rubyforge.org
21
-
22
- Rubytree can be downloaded as a Rubygem or as a tar/zip file from:
23
-
24
- http://rubyforge.org/frs/?group_id=1215&release_id=8817
25
-
26
- The file-name is one of:
27
-
28
- rubytree-<VERSION>.gem - The Rubygem
29
- rubytree-<VERSION>.tgz - GZipped source files
30
- rubytree-<VERSION>.zip - Zipped source files
31
-
32
- Download the appropriate file-type for your system.
33
-
34
- It is recommended to install Rubytree as a Ruby Gem, as this is an easy way to
35
- keep the version updated, and keep multiple versions of the library available on
36
- your system.
37
-
38
- === Installing the Gem
39
-
40
- To Install the Gem, from a Terminal/CLI command prompt, issue the command:
41
-
42
- gem install rubytree
43
-
44
- This should install the gem file for Rubytree. Note that you may need to be a
45
- super-user (root) to successfully install the gem.
46
-
47
- === Installing from the tgz/zip file
48
-
49
- Extract the archive file (tgz or zip) and run the following command from the
50
- top-level source directory:
51
-
52
- ruby ./setup.rb
53
-
54
- You may need administrator/super-user privileges to complete the setup using
55
- this method.
56
-
57
- == DOCUMENTATION:
58
-
59
- The primary class for this implementation is Tree::TreeNode. See the
60
- class documentation for an usage example.
61
-
62
- From a command line/terminal prompt, you can issue the following command to view
63
- the text mode ri documentation:
64
-
65
- ri Tree::TreeNode
66
-
67
- Documentation on the web is available at:
68
-
69
- http://rubytree.rubyforge.org/rdoc
70
-
71
- == EXAMPLE:
72
-
73
- The following code-snippet implements this tree structure:
74
-
75
- +------------+
76
- | ROOT |
77
- +-----+------+
78
- +-------------+------------+
79
- | |
80
- +-------+-------+ +-------+-------+
81
- | CHILD 1 | | CHILD 2 |
82
- +-------+-------+ +---------------+
83
- |
84
- |
85
- +-------+-------+
86
- | GRANDCHILD 1 |
87
- +---------------+
88
-
89
- require 'tree'
90
-
91
- myTreeRoot = Tree::TreeNode.new("ROOT", "Root Content")
92
-
93
- myTreeRoot << Tree::TreeNode.new("CHILD1", "Child1 Content") << Tree::TreeNode.new("GRANDCHILD1", "GrandChild1 Content")
94
-
95
- myTreeRoot << Tree::TreeNode.new("CHILD2", "Child2 Content")
96
-
97
- myTreeRoot.printTree
98
-
99
- child1 = myTreeRoot["CHILD1"]
100
-
101
- grandChild1 = myTreeRoot["CHILD1"]["GRANDCHILD1"]
102
-
103
- siblingsOfChild1Array = child1.siblings
104
-
105
- immediateChildrenArray = myTreeRoot.children
106
-
107
- # Process all nodes
108
-
109
- myTreeRoot.each { |node| node.content.reverse }
110
-
111
- myTreeRoot.remove!(child1) # Remove the child
112
-
113
- == LICENSE:
114
-
115
- Rubytree is licensed under BSD license.
116
-
117
- Copyright (c) 2006, 2007 Anupam Sengupta
118
-
119
- All rights reserved.
120
-
121
- Redistribution and use in source and binary forms, with or without modification,
122
- are permitted provided that the following conditions are met:
123
-
124
- - Redistributions of source code must retain the above copyright notice, this
125
- list of conditions and the following disclaimer.
126
-
127
- - Redistributions in binary form must reproduce the above copyright notice, this
128
- list of conditions and the following disclaimer in the documentation and/or
129
- other materials provided with the distribution.
130
-
131
- - Neither the name of the organization nor the names of its contributors may
132
- be used to endorse or promote products derived from this software without
133
- specific prior written permission.
134
-
135
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
136
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
137
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
138
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
139
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
140
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
141
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
142
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
144
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145
-
146
-
147
- (Document Revision: $Revision: 1.16 $ by $Author: anupamsg $)
1
+ = rubytree
2
+ __ _ _
3
+ /__\_ _| |__ _ _| |_ _ __ ___ ___
4
+ / \// | | | '_ \| | | | __| '__/ _ \/ _ \
5
+ / _ \ |_| | |_) | |_| | |_| | | __/ __/
6
+ \/ \_/\__,_|_.__/ \__, |\__|_| \___|\___|
7
+ |___/
8
+
9
+ (c) 2006, 2007, 2008, 2009 Anupam Sengupta
10
+ http://rubytree.rubyforge.org
11
+
12
+ == DESCRIPTION:
13
+
14
+ Rubytree is a Ruby implementation of the generic Tree data structure. It provides a generic tree data-structure with
15
+ ability to store keyed node-elements in the tree. This implementation is node-centric, where the individual nodes on
16
+ the tree are the primary objects and form the leafs of the structure. The implementation mixes in the Enumerable
17
+ module.
18
+
19
+ == SYNOPSIS:
20
+
21
+ As an example, the following code-snippet implements this tree structure:
22
+
23
+ +------------+
24
+ | ROOT |
25
+ +-----+------+
26
+ +-------------+------------+
27
+ | |
28
+ +-------+-------+ +-------+-------+
29
+ | CHILD 1 | | CHILD 2 |
30
+ +-------+-------+ +---------------+
31
+ |
32
+ |
33
+ +-------+-------+
34
+ | GRANDCHILD 1 |
35
+ +---------------+
36
+
37
+ # Example
38
+ require 'tree'
39
+
40
+ myTreeRoot = Tree::TreeNode.new("ROOT", "Root Content")
41
+ myTreeRoot << Tree::TreeNode.new("CHILD1", "Child1 Content") << Tree::TreeNode.new("GRANDCHILD1", "GrandChild1 Content")
42
+ myTreeRoot << Tree::TreeNode.new("CHILD2", "Child2 Content")
43
+
44
+ myTreeRoot.printTree
45
+
46
+ child1 = myTreeRoot["CHILD1"]
47
+ grandChild1 = myTreeRoot["CHILD1"]["GRANDCHILD1"]
48
+
49
+ siblingsOfChild1Array = child1.siblings
50
+ immediateChildrenArray = myTreeRoot.children
51
+
52
+ # Process all nodes
53
+ myTreeRoot.each { |node| node.content.reverse }
54
+ myTreeRoot.remove!(child1) # Remove the child
55
+
56
+
57
+ == REQUIREMENTS:
58
+
59
+ * Ruby 1.8+ (http://www.ruby-lang.org)
60
+
61
+ == INSTALL:
62
+
63
+ Rubytree is an open source project and is hosted at:
64
+
65
+ http://rubytree.rubyforge.org
66
+
67
+ Rubytree can be downloaded as a Rubygem or as a tar/zip file from:
68
+
69
+ http://rubyforge.org/frs/?group_id=1215&release_id=8817
70
+
71
+ The file-name is one of:
72
+
73
+ rubytree-<VERSION>.gem - The Rubygem
74
+ rubytree-<VERSION>.tgz - GZipped source files
75
+ rubytree-<VERSION>.zip - Zipped source files
76
+
77
+ Download the appropriate file-type for your system.
78
+
79
+ It is recommended to install Rubytree as a Ruby Gem, as this is an easy way to keep the version updated, and keep
80
+ multiple versions of the library available on your system.
81
+
82
+ === Installing the Gem
83
+
84
+ To Install the Gem, from a Terminal/CLI command prompt, issue the command:
85
+
86
+ $ gem install rubytree
87
+
88
+ This should install the gem file for Rubytree. Note that you may need to be a super-user (root) to successfully install
89
+ the gem.
90
+
91
+ === Installing from the tgz/zip file
92
+
93
+ Extract the archive file (tgz or zip) and run the following command from the top-level source directory:
94
+
95
+ ruby ./setup.rb
96
+
97
+ You may need administrator/super-user privileges to complete the setup using this method.
98
+
99
+ == DOCUMENTATION:
100
+
101
+ The primary class for this implementation is Tree::TreeNode. See the class documentation for an usage example.
102
+
103
+ From a command line/terminal prompt, you can issue the following command to view the text mode ri documentation:
104
+
105
+ ri Tree::TreeNode
106
+
107
+ Documentation on the web is available at:
108
+
109
+ http://rubytree.rubyforge.org/rdoc
110
+
111
+ == DEVELOPERS:
112
+
113
+ After checking out the source, run:
114
+
115
+ $ rake newb
116
+
117
+ This task will install any missing dependencies, run the tests/specs, and generate the RDoc.
118
+
119
+ Note that you need to have the Rubygem 'Hoe' (http://seattlerb.rubyforge.org/hoe/Hoe.html) to successfully run the rake
120
+ tasks.
121
+
122
+ == LICENSE:
123
+
124
+ Rubytree is licensed under the BSD[http://www.opensource.org/licenses/bsd-license.php] license.
125
+
126
+ Copyright (c) 2006, 2007 Anupam Sengupta
127
+ All rights reserved.
128
+
129
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
130
+ following conditions are met:
131
+
132
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following
133
+ disclaimer.
134
+
135
+ - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
136
+ disclaimer in the documentation and/or other materials provided with the distribution.
137
+
138
+ - Neither the name of the organization nor the names of its contributors may be used to endorse or promote products
139
+ derived from this software without specific prior written permission.
140
+
141
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
142
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
143
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
144
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
145
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
146
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
147
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
148
+
149
+
150
+ (Document Revision: $Revision: 1.18 $ by $Author: anupamsg $)
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rakefile
2
2
  #
3
- # $Revision: 1.27 $ by $Author: anupamsg $
3
+ # $Revision: 1.29 $ by $Author: anupamsg $
4
4
  # $Name: $
5
5
  #
6
6
  # Copyright (c) 2006, 2007 Anupam Sengupta
@@ -33,153 +33,71 @@
33
33
  # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
34
  #
35
35
 
36
- require 'rubygems'
37
- require 'rake/gempackagetask'
38
-
39
- require 'rake/clean'
40
- require 'rake/packagetask'
41
- require 'rake/testtask'
42
- require 'rake/rdoctask'
43
-
44
- require 'fileutils'
45
-
46
- # General Stuff ####################################################
47
-
48
- $:.insert 0, File.expand_path( File.join( File.dirname(__FILE__), 'lib' ) )
49
- require 'tree' # To read the version information.
50
-
51
36
  PKG_NAME = "rubytree"
52
- PKG_VERSION = Tree::VERSION
53
- PKG_FULLNAME = PKG_NAME + "-" + PKG_VERSION
54
- PKG_SUMMARY = "Ruby implementation of the Tree data structure."
55
- PKG_DESCRIPTION = <<-END
56
- Provides a generic tree data-structure with ability to
57
- store keyed node-elements in the tree. The implementation
58
- mixes in the Enumerable module.
59
-
60
- Website: http://rubytree.rubyforge.org/
61
- END
62
-
63
- PKG_FILES = FileList[
64
- '[A-Z]*',
65
- '*.rb',
66
- 'lib/**/*.rb',
67
- 'test/**/*.rb'
68
- ]
69
37
 
70
38
  # Default is to create a rubygem.
71
- desc "Default Task"
39
+ desc "Default Task (create the gem)"
72
40
  task :default => :gem
73
41
 
74
- begin # Try loading hoe
42
+ # Use Hoe to define the rake tasks.
43
+ begin
75
44
  require 'hoe'
76
- # If Hoe is found, use it to define tasks
77
- # =======================================
78
- Hoe.new(PKG_NAME, PKG_VERSION) do |p|
79
- p.rubyforge_name = PKG_NAME
80
- p.author = "Anupam Sengupta"
81
- p.email = "anupamsg@gmail.com"
82
- p.summary = PKG_SUMMARY
83
- p.description = PKG_DESCRIPTION
84
- p.url = "http://rubytree.rubyforge.org/"
85
- p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
86
- p.remote_rdoc_dir = 'rdoc'
87
- p.need_tar = true
88
- p.need_zip = true
89
- p.test_globs = ['test/test_*.rb']
90
- p.spec_extras = {
91
- :has_rdoc => true,
92
- :platform => Gem::Platform::RUBY,
93
- :has_rdoc => true,
94
- :extra_rdoc_files => ['README', 'COPYING', 'ChangeLog', 'History.txt'],
95
- :rdoc_options => ['--main', 'README'],
96
- :autorequire => 'tree'
97
- }
45
+ Hoe.spec PKG_NAME do
46
+ # The GemSpec settings
47
+ self.rubyforge_name = PKG_NAME
48
+ developer "Anupam Sengupta", "anupamsg@gmail.com"
49
+ self.extra_rdoc_files = ['README', 'COPYING', 'ChangeLog']
50
+ self.url = "http://rubytree.rubyforge.org"
51
+ self.readme_file = 'README'
52
+ self.spec_extras[:rdoc_options] = ['--main', 'README']
53
+
54
+ # Now the publishing settings
55
+ self.remote_rdoc_dir = 'rdoc'
56
+
57
+ # Support additional package formats
58
+ self.need_tar = true
59
+ self.need_zip = true
60
+
61
+ # Code Metrics ...
62
+ self.flay_threshold = timebomb 1200, 100 # Default is 1200, 100
63
+ self.flog_threshold = timebomb 1200, 100 # Default is 1200, 100
98
64
  end
99
65
 
100
- rescue LoadError # If Hoe is not found
101
- # If Hoe is not found, then use the usual Gemspec based Rake tasks
102
- # ================================================================
103
- spec = Gem::Specification.new do |s|
104
- s.name = PKG_NAME
105
- s.version = PKG_VERSION
106
- s.platform = Gem::Platform::RUBY
107
- s.author = "Anupam Sengupta"
108
- s.email = "anupamsg@gmail.com"
109
- s.homepage = "http://rubytree.rubyforge.org/"
110
- s.rubyforge_project = 'rubytree'
111
- s.summary = PKG_SUMMARY
112
- s.add_dependency('rake', '>= 0.7.2')
113
- s.description = PKG_DESCRIPTION
114
- s.has_rdoc = true
115
- s.extra_rdoc_files = ['README', 'COPYING', 'ChangeLog']
116
- s.autorequire = "tree"
117
- s.files = PKG_FILES.to_a
118
- s.test_files = Dir.glob('test/test*.rb')
119
- end
66
+ rescue LoadError # If Hoe is not found ...
67
+ $stderr.puts <<-END
68
+ ERROR!!! You do not seem to have Hoe installed!
120
69
 
121
- desc "Prepares for installation"
122
- task :prepare do
123
- ruby "setup.rb config"
124
- ruby "setup.rb setup"
125
- end
70
+ The Hoe gem is required for running the rake tasks for building the rubytree gem.
126
71
 
127
- desc "Installs the package #{PKG_NAME}"
128
- task :install => [:prepare] do
129
- ruby "setup.rb install"
130
- end
72
+ You can download Hoe as a Rubygem by running as root (or sudo):
131
73
 
132
- Rake::GemPackageTask.new(spec) do |pkg|
133
- pkg.need_zip = true
134
- pkg.need_tar = true
135
- end
74
+ $ gem install hoe
136
75
 
137
- Rake::TestTask.new do |t|
138
- t.libs << "test"
139
- t.test_files = FileList['test/test*.rb']
140
- t.verbose = true
141
- end
76
+ More details can be found at http://seattlerb.rubyforge.org/hoe/Hoe.html
142
77
 
143
- end # End loading Hoerc
144
- # ================================================================
78
+ END
79
+ end
145
80
 
146
81
 
147
82
  # The following tasks are loaded independently of Hoe
148
-
149
- # Hoe's rdoc task is ugly.
150
- Rake::RDocTask.new(:docs) do |rd|
151
- rd.rdoc_files.include("README", "COPYING", "ChangeLog", "lib/**/*.rb")
152
- rd.rdoc_dir = 'doc'
153
- rd.title = "#{PKG_FULLNAME} Documentation"
154
-
155
- # Use the template only if it is present, otherwise, the standard template is
156
- # used.
157
- template = "../allison/allison.rb"
158
- rd.template = template if File.file?(template)
159
-
160
- rd.options << '--line-numbers' << '--inline-source'
161
- end
83
+ # ===================================================
162
84
 
163
85
  # Optional TAGS Task.
164
- # Needs https://rubyforge.org/projects/rtagstask/
86
+ # Needs http://rubyforge.org/projects/rtagstask/
165
87
  begin
166
88
  require 'rtagstask'
167
89
  RTagsTask.new do |rd|
168
90
  rd.vi = false
169
91
  end
170
92
  rescue LoadError
171
- end
93
+ $stderr.puts <<-END
94
+ ERROR!!! You need to have the rtagstask (https://rubyforge.org/projects/rtagstask/) for generating the TAGS file.
172
95
 
173
- # Optional RCOV Task
174
- # Needs http://eigenclass.org/hiki/rcov
175
- begin
176
- require 'rcov/rcovtask'
177
- Rcov::RcovTask.new do |t|
178
- t.test_files = FileList['test/test*.rb']
179
- t.rcov_opts << "--exclude 'rcov.rb'" # rcov itself should not be profiled
180
- # t.verbose = true # uncomment to see the executed commands
181
- end
182
- rescue LoadError
96
+ You can install the rtags gem by running the following command as root (or sudo):
97
+
98
+ $ gem install rtagstask
99
+
100
+ END
183
101
  end
184
102
 
185
103
  #Rakefile,v $
data/TODO CHANGED
@@ -1,7 +1,9 @@
1
- # -*- mode: outline; coding: utf-8-unix; -*-
1
+ # -*- mode: org; coding: utf-8-unix; -*-
2
2
 
3
- * Add logic in Rakefile to read the file list from Manifest.txt file.
3
+ * TODO Get the version control moved from CVS to Subversion (request submitted to RubyForge)
4
+ * TODO Add a YAML export method to the TreeNode class.
4
5
 
5
- * Add a YAML export method to the TreeNode class.
6
+ * DONE Add logic in Rakefile to read the file list from Manifest.txt file.
7
+ CLOSED: [2009-12-31 Thu 23:37]
6
8
 
7
9
 
data/lib/tree.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # tree.rb
2
2
  #
3
- # $Revision: 1.29 $ by $Author: anupamsg $
3
+ # $Revision: 1.31 $ by $Author: anupamsg $
4
4
  # $Name: $
5
5
  #
6
6
  # = tree.rb - Generic Multi-way Tree implementation
@@ -48,16 +48,16 @@
48
48
  module Tree
49
49
 
50
50
  # Rubytree Package Version
51
- VERSION = '0.5.2'
51
+ VERSION = '0.5.3'
52
52
 
53
53
  # == TreeNode Class Description
54
54
  #
55
- # The node class for the tree representation. the nodes are named and have a
55
+ # The node class for the tree representation. the nodes are +named+ and have a
56
56
  # place-holder for the node data (i.e., the `content' of the node). The node
57
57
  # names are expected to be unique. In addition, the node provides navigation
58
58
  # methods to traverse the tree.
59
59
  #
60
- # The nodes can have any number of child nodes attached to it. Note that while
60
+ # A node can have any number of child nodes attached to it. Note that while
61
61
  # this implementation does not support directed graphs, the class itself makes
62
62
  # no restrictions on associating a node's CONTENT with multiple parent nodes.
63
63
  #
@@ -475,6 +475,14 @@ module Tree
475
475
  end
476
476
 
477
477
  # $Log: tree.rb,v $
478
+ # Revision 1.31 2009/12/31 19:28:50 anupamsg
479
+ # Migrated the rake build and install mechanism to use Hoe (http://seattlerb.rubyforge.org/hoe/Hoe.html) exclusively.
480
+ # Have removed all legacy custom tasks (including the old GemSpec). Have also made some formatting modifications to the
481
+ # documentation. The release itself does not contain any user visible changes from a functionality point of view.
482
+ #
483
+ # Revision 1.30 2009/10/05 18:27:10 anupamsg
484
+ # Minor editing of the comment and an addition to the .cvsignore.
485
+ #
478
486
  # Revision 1.29 2007/12/22 00:28:59 anupamsg
479
487
  # Added more test cases, and enabled ZenTest compatibility.
480
488
  #
File without changes
metadata CHANGED
@@ -1,37 +1,44 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubytree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anupam Sengupta
8
- autorequire: tree
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2007-12-21 00:00:00 -07:00
12
+ date: 2010-01-01 00:00:00 +05:30
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: hoe
17
+ type: :development
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements:
20
21
  - - ">="
21
22
  - !ruby/object:Gem::Version
22
- version: 1.3.0
23
+ version: 2.4.0
23
24
  version:
24
- description: "Provides a generic tree data-structure with ability to store keyed node-elements in the tree. The implementation mixes in the Enumerable module. Website: http://rubytree.rubyforge.org/"
25
- email: anupamsg@gmail.com
25
+ description: |-
26
+ Rubytree is a Ruby implementation of the generic Tree data structure. It provides a generic tree data-structure with
27
+ ability to store keyed node-elements in the tree. This implementation is node-centric, where the individual nodes on
28
+ the tree are the primary objects and form the leafs of the structure. The implementation mixes in the Enumerable
29
+ module.
30
+ email:
31
+ - anupamsg@gmail.com
26
32
  executables: []
27
33
 
28
34
  extensions: []
29
35
 
30
36
  extra_rdoc_files:
37
+ - History.txt
38
+ - Manifest.txt
31
39
  - README
32
40
  - COPYING
33
41
  - ChangeLog
34
- - History.txt
35
42
  files:
36
43
  - COPYING
37
44
  - ChangeLog
@@ -46,7 +53,9 @@ files:
46
53
  - test/test_binarytree.rb
47
54
  - test/test_tree.rb
48
55
  has_rdoc: true
49
- homepage: http://rubytree.rubyforge.org/
56
+ homepage: http://rubytree.rubyforge.org
57
+ licenses: []
58
+
50
59
  post_install_message:
51
60
  rdoc_options:
52
61
  - --main
@@ -68,10 +77,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
77
  requirements: []
69
78
 
70
79
  rubyforge_project: rubytree
71
- rubygems_version: 1.0.1
80
+ rubygems_version: 1.3.5
72
81
  signing_key:
73
- specification_version: 2
74
- summary: Ruby implementation of the Tree data structure.
82
+ specification_version: 3
83
+ summary: Rubytree is a Ruby implementation of the generic Tree data structure
75
84
  test_files:
76
85
  - test/test_binarytree.rb
77
86
  - test/test_tree.rb