reap 5.10.10 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +400 -8
- data/README +136 -75
- data/bin/reap +2 -2
- data/bin/rubytest +5 -0
- data/data/reap/scaffold/standard/COPYING +403 -0
- data/data/reap/scaffold/{ChangeLog → standard/ChangeLog} +0 -0
- data/data/reap/scaffold/standard/INSTALL +14 -0
- data/data/reap/scaffold/{ProjectInfo → standard/ProjectInfo} +23 -24
- data/data/reap/scaffold/standard/README +3 -0
- data/data/reap/scaffold/standard/Rakefile +10 -0
- data/{Rakefile → data/reap/scaffold/standard/TODO} +0 -0
- data/data/reap/scaffold/{setup.rb → standard/setup.rb} +287 -270
- data/data/reap/scaffold/subversion/trunk/COPYING +403 -0
- data/data/reap/scaffold/{INSTALL → subversion/trunk/ChangeLog} +0 -0
- data/data/reap/scaffold/subversion/trunk/INSTALL +14 -0
- data/data/reap/scaffold/subversion/trunk/ProjectInfo +76 -0
- data/data/reap/scaffold/subversion/trunk/README +3 -0
- data/data/reap/scaffold/subversion/trunk/Rakefile +10 -0
- data/data/reap/scaffold/{README → subversion/trunk/TODO} +0 -0
- data/data/reap/scaffold/subversion/trunk/setup.rb +1568 -0
- data/data/reap/setup.rb +1568 -0
- data/lib/reap/bin/reap.rb +176 -80
- data/lib/reap/bin/rubytest.rb +53 -0
- data/lib/reap/class/announce.rb +220 -0
- data/lib/reap/class/doap.rb +80 -0
- data/lib/reap/class/extest.rb +151 -0
- data/lib/reap/class/filer.rb +62 -0
- data/lib/reap/class/installer.rb +178 -0
- data/lib/reap/class/manifest.rb +72 -0
- data/lib/reap/class/package.rb +468 -0
- data/lib/reap/class/publish.rb +152 -0
- data/lib/reap/class/rdoc.rb +131 -0
- data/lib/reap/class/test.rb +269 -0
- data/lib/reap/projectinfo.rb +187 -30
- data/lib/reap/rake.rb +42 -0
- data/lib/reap/reap.rb +89 -0
- data/lib/reap/tasks.rb +672 -11
- data/lib/reap/taskutils.rb +122 -0
- data/sample/ProjectInfo +96 -0
- data/sample/Rakefile +9 -0
- data/sample/Reapfile +11 -0
- data/sample/task/demo.rb +15 -0
- data/setup.rb +287 -272
- metadata +99 -257
- data/ANN +0 -3
- data/ChangeLog +0 -25
- data/ProjectInfo +0 -65
- data/data/reap/scaffold/COPYING +0 -11
- data/data/reap/scaffold/Rakefile +0 -146
- data/data/reap/scaffold/Todo +0 -0
- data/dev/Rakefile +0 -60
- data/dev/composite_task.rb +0 -27
- data/dev/compositepublisher.rb +0 -24
- data/dev/ftptools.rb +0 -139
- data/dev/license-each.rb +0 -85
- data/dev/publisher.rb +0 -75
- data/dev/rubyforgepublisher.rb +0 -18
- data/dev/sshpublisher.rb +0 -47
- data/dev/suby-cvs.rb +0 -46
- data/dev/template.rb +0 -72
- data/lib/reap/lint.rb +0 -0
- data/lib/reap/readymade.rb +0 -21
- data/lib/reap/task.rb +0 -187
- data/lib/reap/task/announce.rb +0 -156
- data/lib/reap/task/fileperm.rb +0 -82
- data/lib/reap/task/info.rb +0 -20
- data/lib/reap/task/install.rb +0 -33
- data/lib/reap/task/noop.rb +0 -26
- data/lib/reap/task/package.rb +0 -204
- data/lib/reap/task/publish.rb +0 -49
- data/lib/reap/task/rdoc.rb +0 -82
- data/lib/reap/task/scaffold.rb +0 -114
- data/lib/reap/task/test.rb +0 -186
- data/lib/reap/task/testext.rb +0 -110
- data/lib/reap/task/webpublish.rb +0 -43
- data/lib/reap/test.rb +0 -138
- data/test/tc_reap.rb +0 -11
- data/web/ProjectInfo +0 -57
- data/web/images/appleboy.jpg +0 -0
- data/web/images/grape.jpg +0 -0
- data/web/index.html +0 -124
- data/web/rdoc/classes/Object.html +0 -121
- data/web/rdoc/classes/ProjectInfo.html +0 -207
- data/web/rdoc/classes/ProjectInfo.src/M000094.html +0 -18
- data/web/rdoc/classes/ProjectInfo.src/M000095.html +0 -24
- data/web/rdoc/classes/ProjectInfo.src/M000096.html +0 -22
- data/web/rdoc/classes/ProjectInfo.src/M000097.html +0 -21
- data/web/rdoc/classes/ProjectInfo.src/M000098.html +0 -18
- data/web/rdoc/classes/Reap.html +0 -248
- data/web/rdoc/classes/Reap.src/M000023.html +0 -16
- data/web/rdoc/classes/Reap.src/M000024.html +0 -21
- data/web/rdoc/classes/Reap.src/M000025.html +0 -16
- data/web/rdoc/classes/Reap.src/M000026.html +0 -21
- data/web/rdoc/classes/Reap/Announce.html +0 -262
- data/web/rdoc/classes/Reap/Announce.src/M000030.html +0 -18
- data/web/rdoc/classes/Reap/Announce.src/M000031.html +0 -114
- data/web/rdoc/classes/Reap/Announce.src/M000032.html +0 -46
- data/web/rdoc/classes/Reap/Info.html +0 -176
- data/web/rdoc/classes/Reap/Info.src/M000033.html +0 -18
- data/web/rdoc/classes/Reap/Info.src/M000034.html +0 -17
- data/web/rdoc/classes/Reap/Info.src/M000035.html +0 -18
- data/web/rdoc/classes/Reap/Install.html +0 -193
- data/web/rdoc/classes/Reap/Install.src/M000036.html +0 -18
- data/web/rdoc/classes/Reap/Install.src/M000037.html +0 -20
- data/web/rdoc/classes/Reap/Install.src/M000038.html +0 -26
- data/web/rdoc/classes/Reap/Noop.html +0 -192
- data/web/rdoc/classes/Reap/Noop.src/M000027.html +0 -18
- data/web/rdoc/classes/Reap/Noop.src/M000028.html +0 -17
- data/web/rdoc/classes/Reap/Noop.src/M000029.html +0 -18
- data/web/rdoc/classes/Reap/Package.html +0 -310
- data/web/rdoc/classes/Reap/Package.src/M000055.html +0 -18
- data/web/rdoc/classes/Reap/Package.src/M000056.html +0 -68
- data/web/rdoc/classes/Reap/Package.src/M000057.html +0 -84
- data/web/rdoc/classes/Reap/Package.src/M000058.html +0 -61
- data/web/rdoc/classes/Reap/Perm.html +0 -236
- data/web/rdoc/classes/Reap/Perm.src/M000078.html +0 -18
- data/web/rdoc/classes/Reap/Perm.src/M000079.html +0 -21
- data/web/rdoc/classes/Reap/Perm.src/M000080.html +0 -42
- data/web/rdoc/classes/Reap/Perm.src/M000081.html +0 -26
- data/web/rdoc/classes/Reap/Perm.src/M000082.html +0 -18
- data/web/rdoc/classes/Reap/Publish.html +0 -213
- data/web/rdoc/classes/Reap/Publish.src/M000070.html +0 -18
- data/web/rdoc/classes/Reap/Publish.src/M000071.html +0 -22
- data/web/rdoc/classes/Reap/Publish.src/M000072.html +0 -37
- data/web/rdoc/classes/Reap/RDoc.html +0 -218
- data/web/rdoc/classes/Reap/RDoc.src/M000059.html +0 -18
- data/web/rdoc/classes/Reap/RDoc.src/M000060.html +0 -24
- data/web/rdoc/classes/Reap/RDoc.src/M000061.html +0 -70
- data/web/rdoc/classes/Reap/Task.html +0 -396
- data/web/rdoc/classes/Reap/Task.src/M000039.html +0 -18
- data/web/rdoc/classes/Reap/Task.src/M000040.html +0 -16
- data/web/rdoc/classes/Reap/Task.src/M000041.html +0 -16
- data/web/rdoc/classes/Reap/Task.src/M000042.html +0 -16
- data/web/rdoc/classes/Reap/Task.src/M000043.html +0 -16
- data/web/rdoc/classes/Reap/Task.src/M000044.html +0 -22
- data/web/rdoc/classes/Reap/Task.src/M000045.html +0 -16
- data/web/rdoc/classes/Reap/Task.src/M000046.html +0 -16
- data/web/rdoc/classes/Reap/Task.src/M000047.html +0 -16
- data/web/rdoc/classes/Reap/Task.src/M000048.html +0 -16
- data/web/rdoc/classes/Reap/Task.src/M000049.html +0 -16
- data/web/rdoc/classes/Reap/Task.src/M000050.html +0 -27
- data/web/rdoc/classes/Reap/Task.src/M000051.html +0 -19
- data/web/rdoc/classes/Reap/Task.src/M000052.html +0 -18
- data/web/rdoc/classes/Reap/Task.src/M000053.html +0 -18
- data/web/rdoc/classes/Reap/Task.src/M000054.html +0 -19
- data/web/rdoc/classes/Reap/Test.html +0 -253
- data/web/rdoc/classes/Reap/Test.src/M000062.html +0 -18
- data/web/rdoc/classes/Reap/Test.src/M000063.html +0 -26
- data/web/rdoc/classes/Reap/Test.src/M000064.html +0 -77
- data/web/rdoc/classes/Reap/Test.src/M000065.html +0 -27
- data/web/rdoc/classes/Reap/Test.src/M000066.html +0 -50
- data/web/rdoc/classes/Reap/Test/TestResults.html +0 -205
- data/web/rdoc/classes/Reap/Test/TestResults.src/M000067.html +0 -21
- data/web/rdoc/classes/Reap/Test/TestResults.src/M000068.html +0 -21
- data/web/rdoc/classes/Reap/Test/TestResults.src/M000069.html +0 -23
- data/web/rdoc/classes/Reap/TestExt.html +0 -234
- data/web/rdoc/classes/Reap/TestExt.src/M000073.html +0 -18
- data/web/rdoc/classes/Reap/TestExt.src/M000074.html +0 -20
- data/web/rdoc/classes/Reap/TestExt.src/M000075.html +0 -49
- data/web/rdoc/classes/Reap/TestExt.src/M000076.html +0 -34
- data/web/rdoc/classes/Reap/TestExt.src/M000077.html +0 -27
- data/web/rdoc/classes/Reap/WebPublish.html +0 -213
- data/web/rdoc/classes/Reap/WebPublish.src/M000083.html +0 -18
- data/web/rdoc/classes/Reap/WebPublish.src/M000084.html +0 -21
- data/web/rdoc/classes/Reap/WebPublish.src/M000085.html +0 -32
- data/web/rdoc/classes/ReapCommand.html +0 -425
- data/web/rdoc/classes/ReapCommand.src/M000001.html +0 -16
- data/web/rdoc/classes/ReapCommand.src/M000003.html +0 -16
- data/web/rdoc/classes/ReapCommand.src/M000005.html +0 -16
- data/web/rdoc/classes/ReapCommand.src/M000007.html +0 -16
- data/web/rdoc/classes/ReapCommand.src/M000009.html +0 -16
- data/web/rdoc/classes/ReapCommand.src/M000011.html +0 -16
- data/web/rdoc/classes/ReapCommand.src/M000013.html +0 -18
- data/web/rdoc/classes/ReapCommand.src/M000014.html +0 -19
- data/web/rdoc/classes/ReapCommand.src/M000015.html +0 -19
- data/web/rdoc/classes/ReapCommand.src/M000016.html +0 -24
- data/web/rdoc/classes/ReapCommand.src/M000018.html +0 -29
- data/web/rdoc/classes/Scaffold.html +0 -211
- data/web/rdoc/classes/Scaffold.src/M000086.html +0 -16
- data/web/rdoc/classes/Scaffold.src/M000087.html +0 -28
- data/web/rdoc/classes/Scaffold.src/M000088.html +0 -32
- data/web/rdoc/classes/Scaffold.src/M000089.html +0 -18
- data/web/rdoc/classes/UnitTestKernel.html +0 -176
- data/web/rdoc/classes/UnitTestKernel.src/M000019.html +0 -18
- data/web/rdoc/classes/UnitTestKernel.src/M000020.html +0 -18
- data/web/rdoc/classes/UnitTestKernel.src/M000021.html +0 -22
- data/web/rdoc/classes/UnitTestKernel.src/M000022.html +0 -22
- data/web/rdoc/classes/UnitTesting.html +0 -165
- data/web/rdoc/classes/UnitTesting.src/M000090.html +0 -34
- data/web/rdoc/classes/UnitTesting.src/M000091.html +0 -18
- data/web/rdoc/classes/UnitTesting/Failure.html +0 -156
- data/web/rdoc/classes/UnitTesting/Failure.src/M000092.html +0 -18
- data/web/rdoc/classes/UnitTesting/Failure.src/M000093.html +0 -21
- data/web/rdoc/created.rid +0 -1
- data/web/rdoc/files/ANN.html +0 -107
- data/web/rdoc/files/COPYING.html +0 -119
- data/web/rdoc/files/ChangeLog.html +0 -144
- data/web/rdoc/files/ProjectInfo.html +0 -190
- data/web/rdoc/files/README.html +0 -274
- data/web/rdoc/files/Rakefile.html +0 -101
- data/web/rdoc/files/lib/reap/bin/reap_rb.html +0 -129
- data/web/rdoc/files/lib/reap/lint_rb.html +0 -101
- data/web/rdoc/files/lib/reap/projectinfo_rb.html +0 -110
- data/web/rdoc/files/lib/reap/readymade_rb.html +0 -123
- data/web/rdoc/files/lib/reap/task/announce_rb.html +0 -114
- data/web/rdoc/files/lib/reap/task/fileperm_rb.html +0 -108
- data/web/rdoc/files/lib/reap/task/info_rb.html +0 -108
- data/web/rdoc/files/lib/reap/task/install_rb.html +0 -108
- data/web/rdoc/files/lib/reap/task/noop_rb.html +0 -108
- data/web/rdoc/files/lib/reap/task/package_rb.html +0 -109
- data/web/rdoc/files/lib/reap/task/publish_rb.html +0 -108
- data/web/rdoc/files/lib/reap/task/rdoc_rb.html +0 -108
- data/web/rdoc/files/lib/reap/task/scaffold_rb.html +0 -107
- data/web/rdoc/files/lib/reap/task/test_rb.html +0 -110
- data/web/rdoc/files/lib/reap/task/testext_rb.html +0 -109
- data/web/rdoc/files/lib/reap/task/webpublish_rb.html +0 -108
- data/web/rdoc/files/lib/reap/task_rb.html +0 -120
- data/web/rdoc/files/lib/reap/tasks_rb.html +0 -116
- data/web/rdoc/files/lib/reap/test_rb.html +0 -109
- data/web/rdoc/fr_class_index.html +0 -47
- data/web/rdoc/fr_file_index.html +0 -51
- data/web/rdoc/fr_method_index.html +0 -124
- data/web/rdoc/index.html +0 -24
- data/web/rdoc/rdoc-style.css +0 -208
data/lib/reap/task/publish.rb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'reap/task'
|
3
|
-
|
4
|
-
#
|
5
|
-
# Publish Task
|
6
|
-
#
|
7
|
-
class Reap::Publish < Reap::Task
|
8
|
-
|
9
|
-
section_required true
|
10
|
-
|
11
|
-
def task_desc
|
12
|
-
"Publish documents to the web."
|
13
|
-
end
|
14
|
-
|
15
|
-
attr_accessor :host, :type, :dir, :project, :username
|
16
|
-
attr_accessor :exclude # not using yet
|
17
|
-
|
18
|
-
def init
|
19
|
-
@type ||= 'www'
|
20
|
-
@host ||= 'rubyforge.org'
|
21
|
-
@project ||= master['rubyforge']['project'] || master['name']
|
22
|
-
@username ||= master['rubyforge']['username']
|
23
|
-
@exclude ||= []
|
24
|
-
end
|
25
|
-
|
26
|
-
def run
|
27
|
-
cmd = ''; skip = false
|
28
|
-
|
29
|
-
case @host
|
30
|
-
when 'rubyforge', 'rubyforge.org'
|
31
|
-
case @type
|
32
|
-
when 'www', 'web'
|
33
|
-
cmd = %{scp -r #{@dir}/* #{@username}@rubyforge.org:/var/www/gforge-projects/#{@project}/}
|
34
|
-
else
|
35
|
-
puts %{Unrecognized publishing kind '#{@type}' for host '#{@host}'. Skipped.}
|
36
|
-
skip = true
|
37
|
-
end
|
38
|
-
else
|
39
|
-
puts %{Unrecognized publishing host '#{@host}'. Skipped.}
|
40
|
-
skip = true
|
41
|
-
end
|
42
|
-
|
43
|
-
unless skip
|
44
|
-
puts "Reap is shelling out publishing work..."
|
45
|
-
sh(cmd) unless $PRETEND
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
data/lib/reap/task/rdoc.rb
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'reap/task'
|
3
|
-
|
4
|
-
#
|
5
|
-
# RDoc Task
|
6
|
-
#
|
7
|
-
class Reap::RDoc < Reap::Task
|
8
|
-
|
9
|
-
def task_desc
|
10
|
-
"Generate RDocs (in #{dir})."
|
11
|
-
end
|
12
|
-
|
13
|
-
attr_accessor :dir, :main, :title, :template,
|
14
|
-
:include, :exclude, :options
|
15
|
-
|
16
|
-
def init
|
17
|
-
@dir ||= 'doc'
|
18
|
-
@main ||= 'README'
|
19
|
-
@title ||= master["title"]
|
20
|
-
@template ||= 'html' # 'jamis'
|
21
|
-
@include ||= [ 'A-Z*', 'lib/**/*', 'ext/**/*' ]
|
22
|
-
@exclude ||= [ 'demo/**/*', 'example/**/*', 'sample/**/*' ]
|
23
|
-
@options ||= ['--merge', '--all']
|
24
|
-
end
|
25
|
-
|
26
|
-
def run
|
27
|
-
must_exclude = [ 'InstalledFiles', 'CVS/**/*' ]
|
28
|
-
|
29
|
-
if !File.exists?(@main) or File.directory?(@main)
|
30
|
-
warn "Specified RDoc Main file #{@main} not found. Ignored."
|
31
|
-
@main = nil
|
32
|
-
end
|
33
|
-
|
34
|
-
rdoc_dir = File.expand_path(@dir)
|
35
|
-
|
36
|
-
if FileTest.directory?(@dir)
|
37
|
-
print "Directory '#{@dir}' already exists. Clobber? [y/N] "
|
38
|
-
until inp = $stdin.gets[0,1] ; sleep 1 ; end ; puts
|
39
|
-
if (inp || 'y').downcase == 'y'
|
40
|
-
puts "Removing old directory '#{rdoc_dir}'..."
|
41
|
-
#FileUtils.mkdir_p(".trash") unless FileTest.directory?(".trash")
|
42
|
-
#trashdir = ".trash/#{File.basename(@dir)}"
|
43
|
-
#FileUtils.rm_r(trashdir) if FileTest.exists?(trashdir)
|
44
|
-
#FileUtils.mv(@dir, trashdir)
|
45
|
-
FileUtils.rm_r(@dir) unless $PRETEND
|
46
|
-
else
|
47
|
-
puts "Reap rdoc task canceled."
|
48
|
-
return nil
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
rdoc_target = "#{rdoc_dir}/index.html"
|
53
|
-
|
54
|
-
exc = []
|
55
|
-
(@exclude + must_exclude).each{ |e|
|
56
|
-
exc << e
|
57
|
-
exc |= Dir.glob(e+'/**/*')
|
58
|
-
}
|
59
|
-
|
60
|
-
inc = Dir.glob('[A-Z]*')
|
61
|
-
@include.each{ |i| inc |= Dir.glob(i) }
|
62
|
-
inc -= exc
|
63
|
-
|
64
|
-
inc = inc.select{ |f| File.file?(f) }
|
65
|
-
|
66
|
-
rdoc_files = inc
|
67
|
-
rdoc_files = '"' << rdoc_files.join('" "') << '"'
|
68
|
-
|
69
|
-
# build options string
|
70
|
-
build = []
|
71
|
-
build += @options
|
72
|
-
build << "--main '#{@main}'" if @main
|
73
|
-
build << "--title '#{@title}'" if @title
|
74
|
-
build << "-T '#{@template}'" if @template
|
75
|
-
rdoc_opts = build.join(' ')
|
76
|
-
|
77
|
-
# do it!
|
78
|
-
puts "Reap is shelling work out to RDoc..."
|
79
|
-
sh %{rdoc -o #{rdoc_dir} #{rdoc_opts} #{rdoc_files}}
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
data/lib/reap/task/scaffold.rb
DELETED
@@ -1,114 +0,0 @@
|
|
1
|
-
|
2
|
-
#require 'rbconfig'
|
3
|
-
#require 'reap/projectinfo'
|
4
|
-
|
5
|
-
module Scaffold
|
6
|
-
extend self
|
7
|
-
|
8
|
-
SCMPaths => %w{
|
9
|
-
trunk
|
10
|
-
branch
|
11
|
-
tag
|
12
|
-
scrap
|
13
|
-
package
|
14
|
-
}
|
15
|
-
|
16
|
-
TrunkPaths = %w{
|
17
|
-
bin
|
18
|
-
lib
|
19
|
-
ext
|
20
|
-
dev
|
21
|
-
data
|
22
|
-
test
|
23
|
-
demo
|
24
|
-
}
|
25
|
-
|
26
|
-
TrunkFiles = %w{
|
27
|
-
README
|
28
|
-
INSTALL
|
29
|
-
COPYING
|
30
|
-
ProjectInfo
|
31
|
-
ChangeLog
|
32
|
-
Todo
|
33
|
-
RakeFile
|
34
|
-
setup.rb
|
35
|
-
}
|
36
|
-
|
37
|
-
def go(name) ; scaffold(name) ; end
|
38
|
-
|
39
|
-
# Main method.
|
40
|
-
def scaffold(name=nil)
|
41
|
-
name ||= 'yourlib.projectdomain.org'
|
42
|
-
t = Time.now.strftime("%Y-%m-%d")
|
43
|
-
libdir = File.join( 'lib', "#{@name},#{t}" )
|
44
|
-
|
45
|
-
if @scm
|
46
|
-
SCMPaths.each { |d| makedir( d ) }
|
47
|
-
Dir.chdir 'trunk'
|
48
|
-
end
|
49
|
-
TrunkPaths.each { |d| makedir( d ) }
|
50
|
-
makedir_with_check( libdir )
|
51
|
-
TrunkFiles.each { |f| temlpate( f ) }
|
52
|
-
end
|
53
|
-
|
54
|
-
private
|
55
|
-
|
56
|
-
# Copy a file from lib/data to the current dir.
|
57
|
-
def template( filename )
|
58
|
-
dir = File.join(File.dirname(__FILE__), 'data' )
|
59
|
-
#dir = File.join( ::Config::CONFIG['datadir'], DATA_DIR )
|
60
|
-
f = File.join( dir, filename )
|
61
|
-
unless File.file?( f )
|
62
|
-
puts f
|
63
|
-
raise "Tempfile is missing."
|
64
|
-
end
|
65
|
-
|
66
|
-
if File.exists?(filename)
|
67
|
-
puts "#{filename} already exists."
|
68
|
-
return
|
69
|
-
end
|
70
|
-
# copy tmpf to Reapfile
|
71
|
-
FileUtils.cp( f, filename )
|
72
|
-
#puts "#{filename} created. You'll need to fill it out."
|
73
|
-
end
|
74
|
-
|
75
|
-
# Make a directory as long as it doesn't already exist.
|
76
|
-
def makedir( dir )
|
77
|
-
FileUtils.makedir_p( dir ) unless File.directory?( dir )
|
78
|
-
end
|
79
|
-
|
80
|
-
end
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
=begin
|
85
|
-
def scaffold
|
86
|
-
require 'reap/scaffold'
|
87
|
-
name =
|
88
|
-
domain =
|
89
|
-
Scaffold.go( name, domain )
|
90
|
-
end
|
91
|
-
|
92
|
-
def template( file_name = ProjectInfo )
|
93
|
-
#dir = File.dirname(File.dirname(__FILE__))
|
94
|
-
dir = File.join( ::Config::CONFIG['datadir'], DATA_DIR )
|
95
|
-
|
96
|
-
tmpf = File.join( dir, 'template.yaml' )
|
97
|
-
unless File.file?( tmpf )
|
98
|
-
puts tmpf
|
99
|
-
raise "Tempfile is missing."
|
100
|
-
end
|
101
|
-
|
102
|
-
if File.directory?(filename)
|
103
|
-
puts "#{filename} a directory. Cannot comply."
|
104
|
-
return
|
105
|
-
elsif File.file?(filename)
|
106
|
-
puts "#{filename} already exists."
|
107
|
-
return
|
108
|
-
end
|
109
|
-
# copy tmpf to Reapfile
|
110
|
-
FileUtils.cp( tmpf, filename )
|
111
|
-
puts "#{filename} created. You'll need to fill it out."
|
112
|
-
end
|
113
|
-
=end
|
114
|
-
|
data/lib/reap/task/test.rb
DELETED
@@ -1,186 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'reap/task'
|
3
|
-
|
4
|
-
#require 'test/unit'
|
5
|
-
require 'test/unit/ui/testrunnermediator'
|
6
|
-
require 'facet/string/tabto'
|
7
|
-
|
8
|
-
Test::Unit.run = true # don't run auto tests
|
9
|
-
|
10
|
-
#
|
11
|
-
# Test Task
|
12
|
-
#
|
13
|
-
# The Reap test task runs each test in
|
14
|
-
# it's own process, making for purer
|
15
|
-
# test facility.
|
16
|
-
#
|
17
|
-
# NOTE: This works well enough but it is a bit of
|
18
|
-
# hack. It actually marshals test results across
|
19
|
-
# a stdout->stdin shell pipe. One consequence of
|
20
|
-
# this is that you can't send debug info to stdout
|
21
|
-
# (including #p and #puts). This, hopefully can be
|
22
|
-
# remedied in the future.
|
23
|
-
#
|
24
|
-
class Reap::Test < Reap::Task
|
25
|
-
|
26
|
-
def task_desc
|
27
|
-
"Run unit-tests (each in a separate process)."
|
28
|
-
end
|
29
|
-
|
30
|
-
attr_accessor :libs, :files, :fixture, :against_installed
|
31
|
-
|
32
|
-
def init
|
33
|
-
@libs ||= ['lib']
|
34
|
-
@files ||= [ 'test/*/**/*.rb', 'test/**/tc*.rb', 'test/**/test*.rb', 'test/**/*test.rb' ]
|
35
|
-
@fixture ||= []
|
36
|
-
@against_installed ||= false
|
37
|
-
|
38
|
-
# interal use
|
39
|
-
@results = TestResults.new
|
40
|
-
@errors = []
|
41
|
-
@failures = []
|
42
|
-
end
|
43
|
-
|
44
|
-
def run
|
45
|
-
# get test files
|
46
|
-
test_libs = @libs.join(':')
|
47
|
-
test_files = FileList.new
|
48
|
-
test_files.include(*@files)
|
49
|
-
if test_files.empty?
|
50
|
-
puts "No test files found."
|
51
|
-
return
|
52
|
-
end
|
53
|
-
print "Reap is shelling out work to Ruby's Test Suite..."
|
54
|
-
|
55
|
-
test_files.each { |f|
|
56
|
-
$stdout << '.'; $stdout.flush
|
57
|
-
dotest( f )
|
58
|
-
#ruby %{-r"test/unit" "#{f}"}
|
59
|
-
}
|
60
|
-
puts "done."
|
61
|
-
|
62
|
-
# Don't know why empty arrays get in them yet, but...
|
63
|
-
@failures.reject! { |e| e == [] }
|
64
|
-
@errors.reject! { |e| e == [] }
|
65
|
-
|
66
|
-
# Display Failures
|
67
|
-
puts
|
68
|
-
puts %{FAILURES:#{@failures.empty? ? ' []' : ''}}
|
69
|
-
@failures.reverse.each { |fails|
|
70
|
-
fails.reverse.each { |failure|
|
71
|
-
puts
|
72
|
-
puts %{ - test : #{failure.test_name}}
|
73
|
-
puts %{ location : #{failure.location}}
|
74
|
-
if failure.message.index("\n")
|
75
|
-
puts %{ message : >}
|
76
|
-
puts failure.message.tabto(6)
|
77
|
-
else
|
78
|
-
puts %{ message : #{failure.message}}
|
79
|
-
end
|
80
|
-
}
|
81
|
-
}
|
82
|
-
|
83
|
-
# Display Errors
|
84
|
-
puts
|
85
|
-
puts %{ERRORS:#{@errors.empty? ? ' []' : ''}}
|
86
|
-
@errors.reverse.each { |errs|
|
87
|
-
errs.reverse.each { |err|
|
88
|
-
puts
|
89
|
-
puts %{ - test : #{err.test_name}}
|
90
|
-
puts %{ message : #{err.exception.message}}
|
91
|
-
puts %{ backtrace :}
|
92
|
-
err.exception.backtrace[0...-1].each { |bt| puts %Q{ - #{bt}} }
|
93
|
-
}
|
94
|
-
}
|
95
|
-
|
96
|
-
# Display Final Results
|
97
|
-
puts
|
98
|
-
puts @results
|
99
|
-
puts
|
100
|
-
|
101
|
-
# old way (don't work right)
|
102
|
-
#puts %Q{ ruby %{-I#{test_libs} -e0 -r"test/unit" \\\n#{test_reqs}#{test_opts}} } if $DEBUG
|
103
|
-
#ruby %{-I#{test_libs} -e0 -r"test/unit" \\\n#{test_reqs}#{test_opts}}
|
104
|
-
#ruby %{-e0 -r"test/unit" \\\n#{test_reqs}#{test_opts}}
|
105
|
-
end
|
106
|
-
|
107
|
-
def dotest( test_file )
|
108
|
-
if ! File.file?( test_file )
|
109
|
-
r = nil
|
110
|
-
else
|
111
|
-
r = fork_test( test_file )
|
112
|
-
end
|
113
|
-
unless r.passed?
|
114
|
-
@errors << r.instance_variable_get('@errors')
|
115
|
-
@failures << r.instance_variable_get('@failures')
|
116
|
-
end
|
117
|
-
@results << r
|
118
|
-
end
|
119
|
-
|
120
|
-
# Currently send program output to null device.
|
121
|
-
# Could send to a logger in future version.
|
122
|
-
def fork_test( testfile )
|
123
|
-
src = ''
|
124
|
-
src << %{$:.unshift('lib')} unless against_installed
|
125
|
-
src << %{
|
126
|
-
#require 'test/unit'
|
127
|
-
require 'test/unit/collector'
|
128
|
-
require 'test/unit/collector/objectspace'
|
129
|
-
require 'test/unit/ui/testrunnermediator'
|
130
|
-
}
|
131
|
-
fixture.each do |fix|
|
132
|
-
src << %Q{
|
133
|
-
require '#{fix}'
|
134
|
-
}
|
135
|
-
end
|
136
|
-
src << %{
|
137
|
-
output = STDOUT.dup
|
138
|
-
STDOUT.reopen( PLATFORM =~ /mswin/ ? "NUL" : "/dev/null" )
|
139
|
-
|
140
|
-
load('#{testfile}')
|
141
|
-
tests = Test::Unit::Collector::ObjectSpace.new.collect
|
142
|
-
runner = Test::Unit::UI::TestRunnerMediator.new( tests )
|
143
|
-
result = runner.run_suite
|
144
|
-
output << Marshal.dump(result)
|
145
|
-
|
146
|
-
STDOUT.reopen(output)
|
147
|
-
output.close
|
148
|
-
}
|
149
|
-
result = IO.popen("ruby","w+") do |ruby|
|
150
|
-
ruby.puts src
|
151
|
-
ruby.close_write
|
152
|
-
ruby.read
|
153
|
-
end
|
154
|
-
p testfile if $VERBOSE
|
155
|
-
return Marshal.load(result)
|
156
|
-
end
|
157
|
-
|
158
|
-
#
|
159
|
-
# Support class for collecting test results
|
160
|
-
#
|
161
|
-
class TestResults
|
162
|
-
attr_reader :assertion_count, :run_count, :failure_count, :error_count
|
163
|
-
def initialize
|
164
|
-
@assertion_count = 0
|
165
|
-
@run_count = 0
|
166
|
-
@failure_count = 0
|
167
|
-
@error_count = 0
|
168
|
-
end
|
169
|
-
def <<( result )
|
170
|
-
@assertion_count += result.assertion_count
|
171
|
-
@run_count += result.run_count
|
172
|
-
@failure_count += result.failure_count
|
173
|
-
@error_count += result.error_count
|
174
|
-
end
|
175
|
-
def to_s
|
176
|
-
s = %{SUMMARY:\n\n}
|
177
|
-
s << %{ tests : #{@run_count}\n}
|
178
|
-
s << %{ assertions : #{@assertion_count}\n}
|
179
|
-
s << %{ failures : #{@failure_count}\n}
|
180
|
-
s << %{ errors : #{@error_count}\n}
|
181
|
-
s
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
end
|
186
|
-
|
data/lib/reap/task/testext.rb
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
require 'reap/task'
|
2
|
-
require 'facet/string/margin'
|
3
|
-
|
4
|
-
# Extract Test Task
|
5
|
-
#
|
6
|
-
# The Reap extract test task scans every package script
|
7
|
-
# looking for =begin testing ... =end sections.
|
8
|
-
# With appropriat headers, it copies these sections
|
9
|
-
# to files in the test dir, which then can be run
|
10
|
-
# using the Reap test taks.
|
11
|
-
#
|
12
|
-
class Reap::TestExt < Reap::Task
|
13
|
-
|
14
|
-
def task_desc
|
15
|
-
"Extract unit-tests from lib scripts."
|
16
|
-
end
|
17
|
-
|
18
|
-
attr_accessor :dir, :files, :options
|
19
|
-
|
20
|
-
def init
|
21
|
-
@dir ||= 'test'
|
22
|
-
@files ||= [ 'lib/**/*.rb' ]
|
23
|
-
#@options
|
24
|
-
end
|
25
|
-
|
26
|
-
def run
|
27
|
-
#test_libs = @libs.join(':')
|
28
|
-
files = FileList.new
|
29
|
-
files.include(*@files)
|
30
|
-
if files.empty?
|
31
|
-
puts "No script files found."
|
32
|
-
return
|
33
|
-
end
|
34
|
-
print "Reap is scanning and copying embedded tests..."
|
35
|
-
|
36
|
-
if @dir.strip.empty?
|
37
|
-
puts "Test directory must be specified."
|
38
|
-
return
|
39
|
-
end
|
40
|
-
|
41
|
-
unless File.directory?(@dir)
|
42
|
-
puts "Test directory doesn't exist: #{File.expand_path( @dir )}"
|
43
|
-
return
|
44
|
-
end
|
45
|
-
|
46
|
-
files.each { |file|
|
47
|
-
$stdout << '.'; $stdout.flush
|
48
|
-
testing = extract( file )
|
49
|
-
unless testing.strip.empty?
|
50
|
-
complete_test = create( testing, file )
|
51
|
-
fp = File.join(@dir,file)
|
52
|
-
unless File.directory?( File.dirname( fp ) )
|
53
|
-
FileUtils.mkdir_p( File.dirname(fp) )
|
54
|
-
end
|
55
|
-
File.open( fp, "w" ) { |fw| fw << complete_test }
|
56
|
-
end
|
57
|
-
}
|
58
|
-
puts "done."
|
59
|
-
end
|
60
|
-
|
61
|
-
def extract( file )
|
62
|
-
return nil if ! File.file?( file )
|
63
|
-
tests = ""; inside = false
|
64
|
-
fstr = File.read( file )
|
65
|
-
fstr.split(/\n/).each do |l|
|
66
|
-
if l =~ /^=[ ]*begin[ ]*testing/
|
67
|
-
tests << "\n"
|
68
|
-
inside = true
|
69
|
-
next
|
70
|
-
elsif inside and l =~ /^=[ ]*end/
|
71
|
-
inside = false
|
72
|
-
next
|
73
|
-
end
|
74
|
-
if inside
|
75
|
-
tests << l << "\n"
|
76
|
-
end
|
77
|
-
end
|
78
|
-
tests
|
79
|
-
end
|
80
|
-
|
81
|
-
def create( testing, file )
|
82
|
-
fp = file.split(/[\/]/)
|
83
|
-
if fp[0] == 'lib'
|
84
|
-
reqf = "require '#{fp[1..-1].join('/')}'"
|
85
|
-
else
|
86
|
-
reqf = ''
|
87
|
-
end
|
88
|
-
|
89
|
-
teststr = <<-HERE.margin
|
90
|
-
`# _____ _
|
91
|
-
`# |_ _|__ ___| |_
|
92
|
-
`# | |/ _ \\/ __| __|
|
93
|
-
`# | | __/\\__ \\ |_
|
94
|
-
`# |_|\\___||___/\\__|
|
95
|
-
`#
|
96
|
-
`# for #{file}
|
97
|
-
`#
|
98
|
-
`# Extracted #{Time.now}
|
99
|
-
`# Unit Tools Reap Test Extractor
|
100
|
-
`#
|
101
|
-
`
|
102
|
-
`#{reqf}
|
103
|
-
`
|
104
|
-
HERE
|
105
|
-
teststr << testing << "\n"
|
106
|
-
teststr
|
107
|
-
end
|
108
|
-
|
109
|
-
end
|
110
|
-
|