rubytree 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +22 -26
- data/ChangeLog +18 -0
- data/History.txt +11 -5
- data/README +150 -147
- data/Rakefile +41 -123
- data/TODO +5 -3
- data/lib/tree.rb +12 -4
- data/lib/tree/binarytree.rb +0 -0
- metadata +20 -11
data/COPYING
CHANGED
@@ -1,31 +1,27 @@
|
|
1
|
-
|
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
|
-
|
10
|
-
|
11
|
-
- Redistributions of source code must retain the above copyright notice, this
|
12
|
-
|
13
|
-
|
14
|
-
- Redistributions in binary form must reproduce the above copyright notice, this
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
-
|
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
|
-
|
12
|
+
=== 0.5.1 / 2007-12-20
|
7
13
|
|
8
14
|
* Minor code refactoring.
|
9
15
|
|
10
|
-
|
16
|
+
=== 0.5.0 / 2007-12-18
|
11
17
|
|
12
18
|
* Fixed the marshalling code to correctly handle non-string content.
|
13
19
|
|
14
|
-
|
20
|
+
=== 0.4.3 / 2007-10-09
|
15
21
|
|
16
22
|
* Changes to the build mechanism (now uses Hoe).
|
17
23
|
|
18
|
-
|
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
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
==
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
http://
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
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.
|
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
|
-
|
42
|
+
# Use Hoe to define the rake tasks.
|
43
|
+
begin
|
75
44
|
require 'hoe'
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
133
|
-
pkg.need_zip = true
|
134
|
-
pkg.need_tar = true
|
135
|
-
end
|
74
|
+
$ gem install hoe
|
136
75
|
|
137
|
-
|
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
|
-
|
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
|
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
|
-
|
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
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
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:
|
1
|
+
# -*- mode: org; coding: utf-8-unix; -*-
|
2
2
|
|
3
|
-
*
|
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
|
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.
|
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.
|
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
|
-
#
|
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
|
#
|
data/lib/tree/binarytree.rb
CHANGED
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.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anupam Sengupta
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
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:
|
23
|
+
version: 2.4.0
|
23
24
|
version:
|
24
|
-
description:
|
25
|
-
|
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.
|
80
|
+
rubygems_version: 1.3.5
|
72
81
|
signing_key:
|
73
|
-
specification_version:
|
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
|