reap 0.6.1 → 3.01
Sign up to get free protection for your applications and to get access to all the features.
- data/{ANN-0.6.1 → ANN} +0 -0
- data/ChangeLog +19 -8
- data/ProjectInfo +25 -0
- data/README +76 -11
- data/Rakefile +139 -17
- data/bin/reap +159 -0
- data/lib/reap/{announce-task.rb → announce_task.rb} +43 -41
- data/lib/reap/{chmod-task.rb → filemod_task.rb} +24 -20
- data/lib/reap/info_task.rb +29 -0
- data/lib/reap/noop_task.rb +35 -0
- data/lib/reap/{package-task.rb → package_task.rb} +63 -43
- data/lib/reap/projectinfo.rb +40 -0
- data/lib/reap/{publish-task.rb → publish_task.rb} +21 -17
- data/lib/reap/{rdoc-task.rb → rdoc_task.rb} +24 -19
- data/lib/reap/ready_made.rb +12 -0
- data/lib/reap/task.rb +89 -162
- data/lib/reap/tasks.rb +9 -0
- data/lib/reap/{test-task.rb → test_task.rb} +35 -15
- data/lib/reap/web_publish_task.rb +49 -0
- data/pub/grape.jpg +0 -0
- data/pub/www/index.html +61 -21
- data/pub/www/rdoc/classes/ProjectInfo.html +207 -0
- data/pub/www/rdoc/classes/ProjectInfo.src/M000055.html +18 -0
- data/pub/www/rdoc/classes/ProjectInfo.src/M000056.html +23 -0
- data/pub/www/rdoc/classes/ProjectInfo.src/M000057.html +18 -0
- data/pub/www/rdoc/classes/ProjectInfo.src/M000058.html +21 -0
- data/pub/www/rdoc/classes/ProjectInfo.src/M000059.html +18 -0
- data/pub/www/rdoc/classes/RakeTask.html +182 -0
- data/pub/www/rdoc/classes/RakeTask.src/M000051.html +18 -0
- data/pub/www/rdoc/classes/RakeTask.src/M000052.html +18 -0
- data/pub/www/rdoc/classes/RakeTask.src/M000053.html +18 -0
- data/pub/www/rdoc/classes/RakeTask.src/M000054.html +18 -0
- data/pub/www/rdoc/classes/Reap.html +57 -4
- data/pub/www/rdoc/classes/Reap/AnnounceTask.html +140 -14
- data/pub/www/rdoc/classes/Reap/AnnounceTask.src/M000039.html +16 -0
- data/pub/www/rdoc/classes/Reap/{TemplateTask.src/M000021.html → AnnounceTask.src/M000040.html} +4 -4
- data/pub/www/rdoc/classes/Reap/AnnounceTask.src/{M000031.html → M000041.html} +34 -34
- data/pub/www/rdoc/classes/Reap/AnnounceTask.src/{M000032.html → M000042.html} +1 -1
- data/pub/www/rdoc/classes/Reap/FilemodTask.html +254 -0
- data/pub/www/rdoc/classes/Reap/FilemodTask.src/M000027.html +16 -0
- data/pub/www/rdoc/classes/Reap/FilemodTask.src/M000028.html +18 -0
- data/pub/www/rdoc/classes/Reap/FilemodTask.src/M000029.html +21 -0
- data/pub/www/rdoc/classes/Reap/{ChmodTask.src/M000017.html → FilemodTask.src/M000030.html} +3 -3
- data/pub/www/rdoc/classes/Reap/{ChmodTask.src/M000018.html → FilemodTask.src/M000031.html} +2 -2
- data/pub/www/rdoc/classes/Reap/FilemodTask.src/M000032.html +18 -0
- data/pub/www/rdoc/classes/Reap/{TemplateTask.html → InfoTask.html} +46 -34
- data/pub/www/rdoc/classes/Reap/InfoTask.src/M000047.html +16 -0
- data/pub/www/rdoc/classes/Reap/{Task.src/M000026.html → InfoTask.src/M000048.html} +4 -4
- data/pub/www/rdoc/classes/Reap/{Task.src/M000025.html → InfoTask.src/M000049.html} +2 -3
- data/pub/www/rdoc/classes/Reap/InfoTask.src/M000050.html +18 -0
- data/pub/www/rdoc/classes/Reap/NoopTask.html +210 -0
- data/pub/www/rdoc/classes/Reap/NoopTask.src/M000043.html +16 -0
- data/pub/www/rdoc/classes/Reap/NoopTask.src/M000044.html +18 -0
- data/pub/www/rdoc/classes/Reap/{Task.src/M000028.html → NoopTask.src/M000045.html} +4 -3
- data/pub/www/rdoc/classes/Reap/NoopTask.src/M000046.html +18 -0
- data/pub/www/rdoc/classes/Reap/PackageTask.html +179 -22
- data/pub/www/rdoc/classes/Reap/PackageTask.src/M000005.html +16 -0
- data/pub/www/rdoc/classes/Reap/PackageTask.src/M000006.html +24 -0
- data/pub/www/rdoc/classes/Reap/PackageTask.src/M000007.html +53 -0
- data/pub/www/rdoc/classes/Reap/PackageTask.src/{M000002.html → M000008.html} +3 -4
- data/pub/www/rdoc/classes/Reap/PackageTask.src/{M000003.html → M000009.html} +1 -1
- data/pub/www/rdoc/classes/Reap/PublishTask.html +85 -14
- data/pub/www/rdoc/classes/Reap/PublishTask.src/M000023.html +16 -0
- data/pub/www/rdoc/classes/Reap/PublishTask.src/M000024.html +18 -0
- data/pub/www/rdoc/classes/Reap/PublishTask.src/M000025.html +22 -0
- data/pub/www/rdoc/classes/Reap/PublishTask.src/{M000020.html → M000026.html} +2 -2
- data/pub/www/rdoc/classes/Reap/RDocTask.html +37 -21
- data/pub/www/rdoc/classes/Reap/RDocTask.src/M000001.html +16 -0
- data/pub/www/rdoc/classes/Reap/RDocTask.src/M000002.html +18 -0
- data/pub/www/rdoc/classes/Reap/RDocTask.src/M000003.html +25 -0
- data/pub/www/rdoc/classes/Reap/RDocTask.src/M000004.html +39 -10
- data/pub/www/rdoc/classes/Reap/Task.html +44 -124
- data/pub/www/rdoc/classes/Reap/Task.src/M000033.html +21 -0
- data/pub/www/rdoc/classes/Reap/Task.src/{M000030.html → M000034.html} +4 -5
- data/pub/www/rdoc/classes/Reap/Task.src/M000035.html +41 -0
- data/pub/www/rdoc/classes/Reap/Task.src/M000036.html +16 -0
- data/pub/www/rdoc/classes/Reap/Task.src/M000037.html +18 -0
- data/pub/www/rdoc/classes/Reap/Task.src/M000038.html +19 -0
- data/pub/www/rdoc/classes/Reap/TestTask.html +66 -32
- data/pub/www/rdoc/classes/Reap/TestTask.src/M000014.html +16 -0
- data/pub/www/rdoc/classes/Reap/TestTask.src/M000015.html +18 -0
- data/pub/www/rdoc/classes/Reap/TestTask.src/M000016.html +25 -0
- data/pub/www/rdoc/classes/Reap/TestTask.src/{M000009.html → M000017.html} +5 -5
- data/pub/www/rdoc/classes/Reap/TestTask.src/{M000010.html → M000018.html} +3 -3
- data/pub/www/rdoc/classes/Reap/TestTask.src/{M000011.html → M000019.html} +1 -1
- data/pub/www/rdoc/classes/Reap/TestTask/TestResults.html +17 -17
- data/pub/www/rdoc/classes/Reap/TestTask/TestResults.src/{M000012.html → M000020.html} +1 -1
- data/pub/www/rdoc/classes/Reap/TestTask/TestResults.src/{M000013.html → M000021.html} +1 -1
- data/pub/www/rdoc/classes/Reap/TestTask/TestResults.src/{M000014.html → M000022.html} +1 -1
- data/pub/www/rdoc/classes/Reap/{ChmodTask.html → WebPublishTask.html} +46 -35
- data/pub/www/rdoc/classes/Reap/WebPublishTask.src/M000010.html +16 -0
- data/pub/www/rdoc/classes/Reap/WebPublishTask.src/M000011.html +18 -0
- data/pub/www/rdoc/classes/Reap/WebPublishTask.src/M000012.html +21 -0
- data/pub/www/rdoc/classes/Reap/WebPublishTask.src/M000013.html +32 -0
- data/pub/www/rdoc/classes/ReapTask.html +287 -0
- data/pub/www/rdoc/classes/ReapTask.src/M000060.html +18 -0
- data/pub/www/rdoc/classes/ReapTask.src/M000061.html +18 -0
- data/pub/www/rdoc/classes/ReapTask.src/M000062.html +18 -0
- data/pub/www/rdoc/classes/ReapTask.src/M000063.html +18 -0
- data/pub/www/rdoc/classes/ReapTask.src/M000064.html +18 -0
- data/pub/www/rdoc/classes/ReapTask.src/M000065.html +18 -0
- data/pub/www/rdoc/classes/ReapTask.src/M000066.html +18 -0
- data/pub/www/rdoc/classes/ReapTask.src/M000067.html +18 -0
- data/pub/www/rdoc/classes/ReapTask.src/M000068.html +18 -0
- data/pub/www/rdoc/created.rid +1 -1
- data/pub/www/rdoc/files/{lib/reap2/publish-task_rb.html → LICENSE.html} +19 -7
- data/pub/www/rdoc/files/README.html +271 -0
- data/pub/www/rdoc/files/lib/{reap2/announce-task_rb.html → reap/announce_task_rb.html} +5 -4
- data/pub/www/rdoc/files/lib/{reap2/template-task_rb.html → reap/filemod_task_rb.html} +5 -5
- data/pub/www/rdoc/files/lib/{reap2/rdoc-task_rb.html → reap/info_task_rb.html} +5 -5
- data/pub/www/rdoc/files/lib/{reap2/chmod-task_rb.html → reap/noop_task_rb.html} +5 -5
- data/pub/www/rdoc/files/lib/{reap2/package-task_rb.html → reap/package_task_rb.html} +5 -4
- data/pub/www/rdoc/files/lib/reap/projectinfo_rb.html +111 -0
- data/pub/www/rdoc/files/lib/reap/publish_task_rb.html +108 -0
- data/pub/www/rdoc/files/lib/reap/rdoc_task_rb.html +108 -0
- data/pub/www/rdoc/files/lib/reap/ready_made_rb.html +115 -0
- data/pub/www/rdoc/files/lib/{reap2 → reap}/task_rb.html +5 -6
- data/pub/www/rdoc/files/lib/reap/tasks_rb.html +115 -0
- data/pub/www/rdoc/files/lib/{reap2/test-task_rb.html → reap/test_task_rb.html} +5 -10
- data/pub/www/rdoc/files/lib/reap/web_publish_task_rb.html +108 -0
- data/pub/www/rdoc/fr_class_index.html +7 -2
- data/pub/www/rdoc/fr_file_index.html +15 -9
- data/pub/www/rdoc/fr_method_index.html +68 -32
- data/pub/www/rdoc/index.html +1 -1
- data/test/tc_reap.rb +1 -1
- metadata +126 -58
- data/Reapfile +0 -99
- data/lib/reap/reap-all.rb +0 -15
- data/lib/reap/template-task.rb +0 -40
- data/pub/www/rdoc/classes/Reap/ChmodTask.src/M000015.html +0 -21
- data/pub/www/rdoc/classes/Reap/ChmodTask.src/M000016.html +0 -21
- data/pub/www/rdoc/classes/Reap/PackageTask.src/M000001.html +0 -49
- data/pub/www/rdoc/classes/Reap/PublishTask.src/M000019.html +0 -24
- data/pub/www/rdoc/classes/Reap/RDocTask.src/M000005.html +0 -21
- data/pub/www/rdoc/classes/Reap/RDocTask.src/M000006.html +0 -53
- data/pub/www/rdoc/classes/Reap/Task.src/M000024.html +0 -21
- data/pub/www/rdoc/classes/Reap/Task.src/M000027.html +0 -28
- data/pub/www/rdoc/classes/Reap/Task.src/M000029.html +0 -18
- data/pub/www/rdoc/classes/Reap/TemplateTask.src/M000022.html +0 -21
- data/pub/www/rdoc/classes/Reap/TemplateTask.src/M000023.html +0 -34
- data/pub/www/rdoc/classes/Reap/TestTask.src/M000007.html +0 -25
- data/pub/www/rdoc/classes/Reap/TestTask.src/M000008.html +0 -21
- data/pub/www/rdoc/files/lib/reap2/reap-all_rb.html +0 -110
data/{ANN-0.6.1 → ANN}
RENAMED
File without changes
|
data/ChangeLog
CHANGED
@@ -1,9 +1,20 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
= Reap ChangeLog
|
3
|
+
|
4
|
+
== 03
|
5
|
+
|
6
|
+
* Major overhaul. Reap is no longer an independent project.
|
7
|
+
Rather, it is now an extension of Rake. All Reap tasks are
|
8
|
+
now a subclass of Rake::TaskLib.
|
9
|
+
|
10
|
+
== 02
|
11
|
+
|
12
|
+
* Improved test task. Each test now runs in its own process.
|
13
|
+
Output is summarized and in YAML.
|
14
|
+
* Improved configuration loading a bit.
|
15
|
+
* Wrote some basic docs on how to write a Reap task.
|
16
|
+
* Adjusted for Nano upgrade (was Facets).
|
17
|
+
|
18
|
+
== 01
|
19
|
+
|
20
|
+
* Alpha Development
|
data/ProjectInfo
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
--- %YAML:1.0
|
2
|
+
|
3
|
+
TITLE : &title Reap
|
4
|
+
NAME : &pkg reap
|
5
|
+
VERSION : '3.01'
|
6
|
+
AUTHOR : Thomas Sawyer
|
7
|
+
EMAIL : &email transfire@gmail.com
|
8
|
+
HOMEPAGE : "http://reap.rubyforge.org"
|
9
|
+
SUMMARY : Rake extensions for project management assitance.
|
10
|
+
|
11
|
+
DESCRIPTION: >
|
12
|
+
The Reap extensions for Rake comprise a set of commonly
|
13
|
+
needed tasks for Ruby package developers/deployers.
|
14
|
+
Because of the commonality, Reap utilizes a YAML
|
15
|
+
configuration file to harvest project information,
|
16
|
+
significantly simplifying Rake usage. In fact,
|
17
|
+
when using Reap, it will not be uncommon to see a
|
18
|
+
Rakefile containinf nothing but require 'reap-all'.
|
19
|
+
|
20
|
+
DEPENDENCIES : &dep [ nano ]
|
21
|
+
EXECUTABLES : &exe []
|
22
|
+
|
23
|
+
RUBYFORGE:
|
24
|
+
PROJECT: reap
|
25
|
+
USERNAME: reap
|
data/README
CHANGED
@@ -4,16 +4,16 @@ User Friendly Project Assitant for Ruby
|
|
4
4
|
|
5
5
|
== What's This?
|
6
6
|
|
7
|
-
Reap is a user friendly project assistant for Ruby developers
|
8
|
-
By organizing your project in a semi-formal
|
9
|
-
Reap makes it easy to do the
|
7
|
+
Reap is a user friendly project assistant for Ruby developers
|
8
|
+
built on top of Rake. By organizing your project in a semi-formal
|
9
|
+
manner (the same as setup.rb), Reap makes it easy to do the
|
10
|
+
following tasks:
|
10
11
|
|
11
12
|
* Generate RDocs.
|
12
13
|
* Run unit tests.
|
13
14
|
* Create Ruby Gem packages.
|
14
|
-
* Create standard .
|
15
|
+
* Create standard .tgz, tbz (bzip2) and/or .zip packages.
|
15
16
|
* Publish documents to Rubyforge or other web sites.
|
16
|
-
* Preform a traditional install (calls setup.rb).
|
17
17
|
* Announce a release to Ruby-talk or other mailing list.
|
18
18
|
* Prepare files for distribution (i.e. chmod, tag, etc.).
|
19
19
|
* Upload packages (coming soon!).
|
@@ -30,13 +30,11 @@ Install the ruby gem as you would any other:
|
|
30
30
|
|
31
31
|
<tt>gem install reap</tt>
|
32
32
|
|
33
|
-
Reap
|
34
|
-
supporting calibre libraries, Facets and Carats, so
|
35
|
-
they will also be installed.
|
33
|
+
Reap requires Nano Methods.
|
36
34
|
|
37
35
|
=== Manual Install
|
38
36
|
|
39
|
-
To install manually
|
37
|
+
To install manually follow the usual setup.eb steps:
|
40
38
|
|
41
39
|
1. Download the compressed package.
|
42
40
|
2. Unpack it.
|
@@ -45,10 +43,78 @@ To install manually follw the usiusl setup.eb steps:
|
|
45
43
|
|
46
44
|
You should be good to go.
|
47
45
|
|
46
|
+
== Usage
|
47
|
+
|
48
|
+
=== Using a Reap Task
|
49
|
+
|
50
|
+
Reap makes it pretty easy to use it's built-in tasks.
|
51
|
+
Not only will it grab common data from a ProjectInfo
|
52
|
+
YAML file if available, but it defines convenience methods
|
53
|
+
to make writing Rakefiles easier. For instance, to create
|
54
|
+
a "package" target all you generally need in your Rakefile is:
|
55
|
+
|
56
|
+
require 'reap/tasks'
|
57
|
+
|
58
|
+
include ReapTask
|
59
|
+
|
60
|
+
package_task :package
|
61
|
+
|
62
|
+
The reaon this can be so simple, is b/c Reap extrapolates the
|
63
|
+
information it needs from a comon ProjectInfo file. You will
|
64
|
+
of course need to create this file in you projects main directory.
|
65
|
+
A template is provided and a command line tool to copy it to your
|
66
|
+
current directory. Simply type:
|
67
|
+
|
68
|
+
> reap template
|
69
|
+
|
70
|
+
Then edit the ProjectInfo file. The fields are fairly self
|
71
|
+
explanitiory. Apart from Reap such a file is nice to have on
|
72
|
+
it's own merits too.
|
73
|
+
|
74
|
+
=== Building a Reap Task
|
75
|
+
|
76
|
+
Building a Reap task differs from building a Rake task
|
77
|
+
by two important factors. First there is only one target
|
78
|
+
per task (this may change) Second, task blocks are yeilded
|
79
|
+
_prior_ to the #init routine being exectuted. So your #init
|
80
|
+
routine should expect data to already be present in
|
81
|
+
the tasks attribute and take that into account (usually that
|
82
|
+
means using ++||=++)
|
83
|
+
|
84
|
+
Here's an, oh so simple, example:
|
85
|
+
|
86
|
+
class MyOhSoSimpleTask < Reap::Task
|
87
|
+
|
88
|
+
# This creates the convenience method
|
89
|
+
register 'my_oh_so_simple'
|
90
|
+
|
91
|
+
default_desc 'this is a custom reap task'
|
92
|
+
|
93
|
+
attr_accessor :message
|
94
|
+
|
95
|
+
def init
|
96
|
+
@message ||= master['default'] || 'None Found!'
|
97
|
+
end
|
98
|
+
|
99
|
+
# run the target task
|
100
|
+
def run
|
101
|
+
puts @message
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
The corresponding settings in the ProjectInfo file (master) will then be:
|
107
|
+
|
108
|
+
default: Default text, if any.
|
109
|
+
|
110
|
+
And to use it in your Rake file:
|
111
|
+
|
112
|
+
ReapTask::my_oh_so_simple_task :mytarget
|
113
|
+
|
48
114
|
== Status
|
49
115
|
|
50
116
|
Reap is currently Usable Beta. Most of the tasks
|
51
|
-
work very well.
|
117
|
+
work very well. Refinements are still common though,
|
52
118
|
and a few important tasks are still being planned.
|
53
119
|
|
54
120
|
== Legal
|
@@ -56,4 +122,3 @@ and a few important tasks are still being planned.
|
|
56
122
|
Reap
|
57
123
|
Copyright(c)2004-2005 Thomas Sawyer
|
58
124
|
Ruby License
|
59
|
-
|
data/Rakefile
CHANGED
@@ -1,19 +1,141 @@
|
|
1
1
|
|
2
|
-
require 'reap/
|
3
|
-
|
4
|
-
#require 'reap/template-task'
|
5
|
-
#require 'reap/chmod-task'
|
6
|
-
#require 'reap/test-task'
|
7
|
-
#require 'reap/rdoc-task'
|
8
|
-
#require 'reap/announce-task'
|
9
|
-
#require 'reap/publish-task'
|
10
|
-
#require 'reap/package-task'
|
11
|
-
|
12
|
-
#Reap::TemplateTask.new
|
13
|
-
#Reap::ChmodTask.new
|
14
|
-
#Reap::TestTask.new
|
15
|
-
#Reap::RDocTask.new
|
16
|
-
#Reap::AnnounceTask.new
|
17
|
-
#Reap::PublishTask.new
|
18
|
-
#Reap::PackageTask.new
|
2
|
+
require 'reap/tasks'
|
19
3
|
|
4
|
+
# Traditionally, a prebuilt rake task is utilized like this:
|
5
|
+
#
|
6
|
+
# Reap::PublishTask.new :mypublisher do |s|
|
7
|
+
# s.type = 'web'
|
8
|
+
# s.host = 'rubyforge.org'
|
9
|
+
# s.username = 'transami'
|
10
|
+
# s.dir = 'pub/www'
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
# Reap provides a way to use YAML and specilize methods to make
|
14
|
+
# this even cleaner.
|
15
|
+
#
|
16
|
+
# publish_task( :mypublisher ) {"
|
17
|
+
# type : web
|
18
|
+
# host : rubyforge.org
|
19
|
+
# username : transami
|
20
|
+
# dir : pub/www
|
21
|
+
# "}
|
22
|
+
#
|
23
|
+
# Of course, one can still use a traditional block with the
|
24
|
+
# special methods.
|
25
|
+
#
|
26
|
+
# publish_task :mypublisher do |s|
|
27
|
+
# s.type = 'web'
|
28
|
+
# s.host = 'rubyforge.org'
|
29
|
+
# s.username = 'transami'
|
30
|
+
# s.dir = 'pub/www'
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# But there is an additional advantage to the YAML approach. Reap prepends
|
34
|
+
# the task YAML with the YAML in the ProjectInfo file. This way it is easy
|
35
|
+
# to reuse master information in indivial tasks. For exmaple you might have
|
36
|
+
# an# &author anchor defined in ProjectInfo.
|
37
|
+
#
|
38
|
+
# publish_task( :mypublisher ) {"
|
39
|
+
# type : web
|
40
|
+
# host : rubyforge.org
|
41
|
+
# username : *author
|
42
|
+
# dir : pub/www
|
43
|
+
# "}
|
44
|
+
#
|
45
|
+
# This special method notation actually works for some prebuilt rake tasks too.
|
46
|
+
# But do not expect the YAML to work /w them.
|
47
|
+
#
|
48
|
+
|
49
|
+
# template_task
|
50
|
+
|
51
|
+
include ReapTask
|
52
|
+
|
53
|
+
info_task( :info )
|
54
|
+
|
55
|
+
publish_task :publish do"
|
56
|
+
type : web
|
57
|
+
host : rubyforge.org
|
58
|
+
username : transami
|
59
|
+
dir : www
|
60
|
+
"end
|
61
|
+
|
62
|
+
announce_task :announce do"
|
63
|
+
to : transfire@gmail.com # ruby-talk@ruby-lang.org
|
64
|
+
from : *email
|
65
|
+
domain : reap.rubyforge.org
|
66
|
+
server : smtp.gmail.com
|
67
|
+
port : 587
|
68
|
+
account : *email # transfire@gmail.com
|
69
|
+
authtype : login # cram_md5, plain
|
70
|
+
sectype : tls # ~, tls, ssl (not working yet)
|
71
|
+
file : ANN # which file contains announcement
|
72
|
+
slogan : REAP THE REWARDS!
|
73
|
+
links :
|
74
|
+
- http://reap.rubyforge.org
|
75
|
+
- http://rake.rubyforge.org
|
76
|
+
"end
|
77
|
+
|
78
|
+
filemod_task :filemod do"
|
79
|
+
filemod: 644
|
80
|
+
dirmod: 755
|
81
|
+
user: trans
|
82
|
+
group: users
|
83
|
+
"end
|
84
|
+
|
85
|
+
test_task :test do"
|
86
|
+
files:
|
87
|
+
- 'test/**/tc*.rb'
|
88
|
+
- 'test/**/test*.rb'
|
89
|
+
- 'test/**/*test.rb'
|
90
|
+
options: ~ # not used yet
|
91
|
+
"end
|
92
|
+
|
93
|
+
rdoc_task :rdoc do"
|
94
|
+
title: *title
|
95
|
+
dir: 'pub/www/rdoc'
|
96
|
+
template: html
|
97
|
+
options: ['--merge', '--all']
|
98
|
+
main: README
|
99
|
+
include:
|
100
|
+
- 'README*'
|
101
|
+
- 'LICEN*'
|
102
|
+
- 'COPY*'
|
103
|
+
- 'lib/**/*.rb'
|
104
|
+
- 'bin/**/*.rb'
|
105
|
+
exclude: []
|
106
|
+
"end
|
107
|
+
|
108
|
+
package_task :package do"
|
109
|
+
dir: pkg
|
110
|
+
include:
|
111
|
+
- 'lib/**/*'
|
112
|
+
- 'data/**/*'
|
113
|
+
- 'ext/**/*'
|
114
|
+
- 'bin/**/*'
|
115
|
+
- 'bench/**/*'
|
116
|
+
- 'test/**/*'
|
117
|
+
- 'doc/**/*'
|
118
|
+
- 'rdoc/**/*'
|
119
|
+
- 'pub/**/*'
|
120
|
+
- 'www/**/*'
|
121
|
+
- 'demo/**/*'
|
122
|
+
- 'samples/**/*'
|
123
|
+
- 'examples/**/*'
|
124
|
+
- 'bench/**/*'
|
125
|
+
- 'setup.rb'
|
126
|
+
- '[A-Z]*'
|
127
|
+
exclude:
|
128
|
+
- InstalledFiles
|
129
|
+
autorequire: ~
|
130
|
+
requirements: []
|
131
|
+
dependencies: *dep #[]
|
132
|
+
executables: *exe #[]
|
133
|
+
gem: true
|
134
|
+
zip: true
|
135
|
+
gzip: true
|
136
|
+
bzip2: true
|
137
|
+
"end
|
138
|
+
|
139
|
+
noop_task :noop do"
|
140
|
+
message: 'Hello, World!'
|
141
|
+
"end
|
data/bin/reap
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'getoptlong'
|
4
|
+
require 'rbconfig'
|
5
|
+
require 'reap/tasks'
|
6
|
+
|
7
|
+
HELP1 = <<-HERE
|
8
|
+
|
9
|
+
reap v#{::Reap::VERSION}
|
10
|
+
|
11
|
+
USAGE: reap [options...] <command> [arguments...]
|
12
|
+
|
13
|
+
COMMANDS:
|
14
|
+
|
15
|
+
help
|
16
|
+
Displays this help information.
|
17
|
+
|
18
|
+
template
|
19
|
+
Copies the ProjectInfo template into the current
|
20
|
+
directory, if it doesn't already exist.
|
21
|
+
|
22
|
+
HERE
|
23
|
+
|
24
|
+
HELP2 = <<-HERE
|
25
|
+
OPTIONS:
|
26
|
+
|
27
|
+
-v --verbose
|
28
|
+
Provides extra verbose processing information.
|
29
|
+
|
30
|
+
-u --use <file>
|
31
|
+
Use the specified configuration file rather than
|
32
|
+
the default 'ProjectInfo'.
|
33
|
+
|
34
|
+
-p --pretend (NOT YET IMPLEMENTED)
|
35
|
+
Pretend, just to see what would happen, but don't
|
36
|
+
actually do anything.
|
37
|
+
|
38
|
+
--version
|
39
|
+
Display the current version.
|
40
|
+
|
41
|
+
--help
|
42
|
+
Display this help information.
|
43
|
+
HERE
|
44
|
+
|
45
|
+
|
46
|
+
module Commands
|
47
|
+
extend self
|
48
|
+
|
49
|
+
DATA_DIR = 'site_ruby/reap'
|
50
|
+
FILE_NAME = 'ProjectInfo'
|
51
|
+
|
52
|
+
def version
|
53
|
+
puts "%.2f" % [ Reap::Version ]
|
54
|
+
end
|
55
|
+
|
56
|
+
def help
|
57
|
+
puts HELP1
|
58
|
+
|
59
|
+
#Reap::Task.registry.each do |t|
|
60
|
+
# puts " #{t.task_name}"
|
61
|
+
# puts " #{t.task_desc}\n\n"
|
62
|
+
#end
|
63
|
+
|
64
|
+
puts HELP2
|
65
|
+
end
|
66
|
+
|
67
|
+
def tasks
|
68
|
+
puts
|
69
|
+
#Reap::Task.registry.each do |t|
|
70
|
+
# puts " #{t.task_name}".ljust(20) + "#{t.task_desc}"
|
71
|
+
#end
|
72
|
+
puts
|
73
|
+
end
|
74
|
+
|
75
|
+
def template( file_name = ProjectInfo )
|
76
|
+
#dir = File.dirname(File.dirname(__FILE__))
|
77
|
+
dir = File.join( ::Config::CONFIG['datadir'], DATA_DIR )
|
78
|
+
|
79
|
+
tmpf = File.join( dir, 'template.yaml' )
|
80
|
+
unless File.file?( tmpf )
|
81
|
+
puts tmpf
|
82
|
+
raise "Tempfile is missing."
|
83
|
+
end
|
84
|
+
|
85
|
+
if File.directory?(filename)
|
86
|
+
puts "#{filename} a directory. Cannot comply."
|
87
|
+
return
|
88
|
+
elsif File.file?(filename)
|
89
|
+
puts "#{filename} already exists."
|
90
|
+
return
|
91
|
+
end
|
92
|
+
# copy tmpf to Reapfile
|
93
|
+
FileUtils.cp( tmpf, filename )
|
94
|
+
puts "#{filename} created. You'll need to fill it out."
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
|
100
|
+
# main
|
101
|
+
|
102
|
+
cmd = nil
|
103
|
+
|
104
|
+
opts = GetoptLong.new(
|
105
|
+
[ "-v", "--verbose", GetoptLong::NO_ARGUMENT ],
|
106
|
+
[ "-p", "--pretend", GetoptLong::NO_ARGUMENT ],
|
107
|
+
[ "-d", "--debug", GetoptLong::NO_ARGUMENT ],
|
108
|
+
[ "-u", "--use", GetoptLong::REQUIRED_ARGUMENT ],
|
109
|
+
[ "--version", GetoptLong::NO_ARGUMENT ],
|
110
|
+
[ "--help", GetoptLong::NO_ARGUMENT ]
|
111
|
+
)
|
112
|
+
|
113
|
+
opts.each do |o, a|
|
114
|
+
case o
|
115
|
+
when '-v'
|
116
|
+
$VERBOSE = true
|
117
|
+
when '-p'
|
118
|
+
$PRETEND = true
|
119
|
+
when '-u'
|
120
|
+
config = a
|
121
|
+
when '-d'
|
122
|
+
$DEBUG = true
|
123
|
+
when '--help'
|
124
|
+
cmd = 'help'
|
125
|
+
when '--version'
|
126
|
+
cmd = 'version'
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
cmd = cmd || ARGV[0]
|
131
|
+
args = ARGV[1..-1]
|
132
|
+
config = nil
|
133
|
+
|
134
|
+
cmd = cmd.downcase if cmd
|
135
|
+
|
136
|
+
case cmd
|
137
|
+
when nil,'help'
|
138
|
+
Commands.help
|
139
|
+
exit 0
|
140
|
+
when 'tasks'
|
141
|
+
Commands.tasks
|
142
|
+
exit 0
|
143
|
+
when 'version'
|
144
|
+
Commands.version
|
145
|
+
exit 0
|
146
|
+
when 'template'
|
147
|
+
Commands.template
|
148
|
+
end
|
149
|
+
|
150
|
+
# Quick-build and run a task.
|
151
|
+
|
152
|
+
c = cmd.downcase.to_s
|
153
|
+
if ReapTask.respond_to?( "#{c}_task" )
|
154
|
+
rt = ReapTask.send("#{c}_task") { ARGV.slice(1..-1).join(' ') }
|
155
|
+
rt.run
|
156
|
+
else
|
157
|
+
puts "Unknown command. Try 'reap help' for assitance."
|
158
|
+
exit 0
|
159
|
+
end
|