reap 6.0.2 → 9.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +6 -0
- data/COPYING +666 -395
- data/MANIFEST +139 -0
- data/NOTES +12 -0
- data/README +19 -163
- data/bin/reap-announce +7 -0
- data/bin/reap-check-load +8 -0
- data/bin/reap-check-syntax +7 -0
- data/bin/reap-clean +7 -0
- data/bin/reap-clobber +7 -0
- data/bin/reap-doc +7 -0
- data/bin/reap-doc-rdoc +7 -0
- data/bin/reap-doc-ri +7 -0
- data/bin/reap-init +69 -0
- data/bin/reap-inspect +7 -0
- data/bin/reap-install +8 -0
- data/bin/reap-install-gem +8 -0
- data/bin/reap-log +7 -0
- data/bin/reap-log-changes +8 -0
- data/bin/reap-log-notes +8 -0
- data/bin/reap-make +7 -0
- data/bin/reap-make-clean +7 -0
- data/bin/reap-make-distclean +7 -0
- data/bin/reap-make-extconf +7 -0
- data/bin/reap-make-static +8 -0
- data/bin/reap-package +8 -0
- data/bin/reap-package-gem +7 -0
- data/bin/reap-package-tgz +7 -0
- data/bin/reap-package-zip +7 -0
- data/bin/reap-prepare +7 -0
- data/bin/reap-publish +7 -0
- data/bin/reap-release +7 -0
- data/bin/reap-scaffold +8 -0
- data/bin/reap-scm-branch +7 -0
- data/bin/reap-scm-tag +7 -0
- data/bin/reap-spec +7 -0
- data/bin/reap-spec-doc +8 -0
- data/bin/reap-stamp +7 -0
- data/bin/reap-stats +7 -0
- data/bin/reap-test +7 -0
- data/bin/reap-test-cross +7 -0
- data/bin/reap-test-load +9 -0
- data/bin/reap-test-solo +7 -0
- data/bin/reap-uninstall +7 -0
- data/bin/reap-uninstall-gem +7 -0
- data/data/reap/base/CHANGES +19 -0
- data/data/reap/base/COPYING +674 -0
- data/data/reap/base/NOTES +12 -0
- data/data/reap/base/README +8 -0
- data/data/reap/build/rake/Rakefile +130 -0
- data/{forge/reference/installers → data/reap/build/rake}/setup.rb +155 -97
- data/data/reap/build/rake-lite/install.rb +79 -0
- data/data/reap/build/tasks/task/rdoc +211 -0
- data/data/reap/{setup.rb → build/tasks/task/setup} +248 -200
- data/data/reap/build/tasks/task/test +38 -0
- data/data/reap/init/meta/project.yaml +21 -0
- data/demo/README +15 -0
- data/demo/lib/foo/foo.rb +7 -0
- data/demo/meta/VERSION +1 -0
- data/demo/meta/project.yaml +21 -0
- data/lib/reap/application.rb +80 -0
- data/lib/reap/default.yaml +77 -0
- data/lib/reap/extensions/array.rb +50 -0
- data/lib/reap/extensions/hash.rb +63 -0
- data/lib/reap/extensions/string.rb +31 -0
- data/lib/reap/extensions.rb +6 -0
- data/lib/reap/iobject.rb +264 -0
- data/lib/reap/manager/announce.rb +193 -0
- data/lib/reap/manager/check.rb +109 -0
- data/lib/reap/manager/clean.rb +58 -0
- data/lib/reap/manager/gem.rb +200 -0
- data/lib/reap/manager/html.rb +69 -0
- data/lib/reap/manager/log.rb +214 -0
- data/lib/reap/manager/make.rb +109 -0
- data/lib/reap/manager/pack.rb +232 -0
- data/lib/reap/manager/publish.rb +72 -0
- data/lib/reap/manager/rdoc.rb +194 -0
- data/lib/reap/manager/release.rb +78 -0
- data/lib/reap/manager/rubyforge.rb +44 -0
- data/lib/reap/manager/scaffold.rb +138 -0
- data/lib/reap/manager/scm.rb +66 -0
- data/lib/reap/manager/site.rb +27 -0
- data/lib/reap/manager/spec.rb +94 -0
- data/lib/reap/manager/stats.rb +145 -0
- data/lib/reap/manager/svn.rb +76 -0
- data/lib/reap/manager/test.rb +389 -0
- data/lib/reap/manager.rb +74 -0
- data/lib/reap/metadata.rb +603 -0
- data/lib/reap/project.rb +165 -0
- data/lib/reap/settings.rb +67 -0
- data/lib/reap/systems/rubyforge.rb +737 -0
- data/lib/reap/systems/subversion.rb +333 -0
- data/lib/reap/utilities/fileutils.rb +304 -0
- data/lib/reap/utilities/netutils.rb +221 -0
- data/lib/reap/utilities/setuputils.rb +124 -0
- data/lib/reap/utilities/shellutils.rb +175 -0
- data/log/Changelog.txt +107 -0
- data/log/FIXME.txt +25 -0
- data/log/TODO.txt +72 -0
- data/meta/VERSION +1 -0
- data/meta/description +4 -0
- data/meta/project.yaml +20 -0
- data/task/man +14 -0
- data/task/rdoc +20 -0
- data/{data/reap/scaffold/standard/setup.rb → task/setup} +248 -200
- metadata +225 -153
- data/ProjectInfo +0 -105
- data/bin/reap +0 -5
- data/bin/rubytest +0 -5
- data/data/reap/install.rb +0 -62
- data/data/reap/scaffold/standard/COPYING +0 -403
- data/data/reap/scaffold/standard/ChangeLog +0 -0
- data/data/reap/scaffold/standard/INSTALL +0 -14
- data/data/reap/scaffold/standard/ProjectInfo +0 -77
- data/data/reap/scaffold/standard/README +0 -3
- data/data/reap/scaffold/standard/Rakefile +0 -10
- data/data/reap/scaffold/standard/TODO +0 -0
- data/data/reap/scaffold/subversion/trunk/COPYING +0 -403
- data/data/reap/scaffold/subversion/trunk/ChangeLog +0 -0
- data/data/reap/scaffold/subversion/trunk/INSTALL +0 -14
- data/data/reap/scaffold/subversion/trunk/ProjectInfo +0 -76
- data/data/reap/scaffold/subversion/trunk/README +0 -3
- data/data/reap/scaffold/subversion/trunk/Rakefile +0 -10
- data/data/reap/scaffold/subversion/trunk/TODO +0 -0
- data/data/reap/scaffold/subversion/trunk/setup.rb +0 -1568
- data/forge/ProjectInfo +0 -38
- data/forge/ProjectInfo.rb +0 -76
- data/forge/TODO +0 -10
- data/forge/installer.rb +0 -250
- data/forge/reference/Rakefile +0 -124
- data/forge/reference/Rakefile.htm +0 -69
- data/forge/reference/aRakefile +0 -60
- data/forge/reference/compositepublisher.rb +0 -24
- data/forge/reference/ftptools.rb +0 -139
- data/forge/reference/installers/package.rb +0 -629
- data/forge/reference/license-each.rb +0 -85
- data/forge/reference/publisher.rb +0 -75
- data/forge/reference/rubyforge.rb +0 -247
- data/forge/reference/rubyforgepublisher.rb +0 -18
- data/forge/reference/sshpublisher.rb +0 -47
- data/forge/reference/suby-cvs.rb +0 -46
- data/forge/scaffold.rb +0 -126
- data/forge/unit_runner/README +0 -6
- data/forge/unit_runner/commentrunner.rb +0 -62
- data/forge/unit_runner/cunit.rb +0 -17
- data/forge/unit_runner/forkedrunner.rb +0 -91
- data/forge/unit_runner/sample.rb +0 -16
- data/lib/reap/bin/reap.rb +0 -230
- data/lib/reap/bin/rubytest.rb +0 -53
- data/lib/reap/class/announce.rb +0 -220
- data/lib/reap/class/doap.rb +0 -80
- data/lib/reap/class/extest.rb +0 -146
- data/lib/reap/class/filer.rb +0 -62
- data/lib/reap/class/manifest.rb +0 -68
- data/lib/reap/class/package.rb +0 -576
- data/lib/reap/class/publish.rb +0 -152
- data/lib/reap/class/rdoc.rb +0 -123
- data/lib/reap/class/test.rb +0 -264
- data/lib/reap/projectinfo.rb +0 -208
- data/lib/reap/rake.rb +0 -42
- data/lib/reap/reap.rb +0 -89
- data/lib/reap/tasks.rb +0 -756
- data/lib/reap/taskutils.rb +0 -122
- data/note/LATEST +0 -44
- data/note/doap.xml +0 -28
- data/note/history/Rakefile-0.1 +0 -308
- data/sample/ProjectInfo +0 -96
- data/sample/Rakefile +0 -9
- data/sample/Reapfile +0 -11
- data/sample/task/demo.rb +0 -15
- data/setup.rb +0 -1568
- data/web/ProjectInfo.html +0 -75
- data/web/images/grape.jpg +0 -0
- data/web/index.html +0 -312
data/lib/reap/class/extest.rb
DELETED
@@ -1,146 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# _____ _ ___ _
|
3
|
-
# |_ _|__ __| |_ | __|_ _| |_
|
4
|
-
# | |/ -_|_-< _| | _|\ \ / _|_
|
5
|
-
# |_|\___/__/\__| |___/_\_\\__(_)
|
6
|
-
#
|
7
|
-
#++
|
8
|
-
|
9
|
-
require 'facet/string/margin'
|
10
|
-
require 'facet/progressbar'
|
11
|
-
require 'facet/filelist.rb' unless defined?( FileList )
|
12
|
-
|
13
|
-
module Reap
|
14
|
-
|
15
|
-
# = Test Extraction
|
16
|
-
#
|
17
|
-
# This task scans every package script looking for sections of the form:
|
18
|
-
#
|
19
|
-
# =begin test
|
20
|
-
# ...
|
21
|
-
# =end
|
22
|
-
#
|
23
|
-
# With appropriate headers, it copies these sections to files in your
|
24
|
-
# project's test/ dir, which then can be run using the Reap test task.
|
25
|
-
# The exact directory layout of the files to be tested is reflected in
|
26
|
-
# the test directory. You can then use Reap's test task to run the tests.
|
27
|
-
#
|
28
|
-
# Specific Settings:
|
29
|
-
#
|
30
|
-
# dir Specify the test directory. Default is 'test'.
|
31
|
-
# files Specify files to extract. Default is 'lib/**/*.rb'.
|
32
|
-
#
|
33
|
-
|
34
|
-
class ExTest
|
35
|
-
|
36
|
-
include TaskUtils
|
37
|
-
|
38
|
-
attr_accessor :dir, :files, :options
|
39
|
-
|
40
|
-
def initialize( tst )
|
41
|
-
@dir = 'test'
|
42
|
-
@files = [ 'lib/**/*.rb' ]
|
43
|
-
@options = {}
|
44
|
-
|
45
|
-
super
|
46
|
-
|
47
|
-
@files = [ @files ].flatten
|
48
|
-
end
|
49
|
-
|
50
|
-
# Extract tests.
|
51
|
-
|
52
|
-
def extract
|
53
|
-
extract_tests
|
54
|
-
end
|
55
|
-
|
56
|
-
alias_method :call, :extract
|
57
|
-
|
58
|
-
private
|
59
|
-
|
60
|
-
def extract_tests
|
61
|
-
#test_libs = @libs.join(':')
|
62
|
-
filelist = FileList.new
|
63
|
-
filelist.include(*@files)
|
64
|
-
if filelist.empty?
|
65
|
-
tell "No script files found."
|
66
|
-
return
|
67
|
-
end
|
68
|
-
#tell "Reap is scanning and copying embedded tests..."
|
69
|
-
if @dir.strip.empty?
|
70
|
-
tell "Test directory must be specified. Aborting."
|
71
|
-
return # TODO use #abort or sepcial method to do a nice exit?
|
72
|
-
end
|
73
|
-
unless File.directory?( @dir )
|
74
|
-
tell "Test directory doesn't exist: #{File.expand_path( @dir )}"
|
75
|
-
return
|
76
|
-
end
|
77
|
-
pbar = Console::ProgressBar.new( 'Extracting', filelist.size )
|
78
|
-
filelist.each { |file|
|
79
|
-
pbar.inc
|
80
|
-
testing = extract_from_file( file )
|
81
|
-
unless testing.strip.empty?
|
82
|
-
complete_test = create( testing, file )
|
83
|
-
libpath = File.dirname( file )
|
84
|
-
testfile = "test_" + File.basename( file )
|
85
|
-
fp = File.join( dir, libpath, testfile )
|
86
|
-
unless File.directory?( File.dirname( fp ) )
|
87
|
-
FileUtils.mkdir_p( File.dirname(fp) )
|
88
|
-
end
|
89
|
-
File.open( fp, "w" ) { |fw| fw << complete_test }
|
90
|
-
end
|
91
|
-
}
|
92
|
-
pbar.finish
|
93
|
-
end
|
94
|
-
|
95
|
-
private
|
96
|
-
|
97
|
-
def extract_from_file( file )
|
98
|
-
return nil if ! File.file?( file )
|
99
|
-
tests = ""; inside = false
|
100
|
-
fstr = File.read( file )
|
101
|
-
fstr.split(/\n/).each do |l|
|
102
|
-
if l =~ /^=begin[ ]*test/i
|
103
|
-
tests << "\n"
|
104
|
-
inside = true
|
105
|
-
next
|
106
|
-
elsif inside and l =~ /^=[ ]*end/
|
107
|
-
inside = false
|
108
|
-
next
|
109
|
-
end
|
110
|
-
if inside
|
111
|
-
tests << l << "\n"
|
112
|
-
end
|
113
|
-
end
|
114
|
-
tests
|
115
|
-
end
|
116
|
-
|
117
|
-
def create( testing, file )
|
118
|
-
fp = file.split(/[\/]/)
|
119
|
-
if fp[0] == 'lib'
|
120
|
-
reqf = "require '#{fp[1..-1].join('/')}'"
|
121
|
-
else
|
122
|
-
reqf = ''
|
123
|
-
end
|
124
|
-
teststr = <<-HERE.margin
|
125
|
-
`# _____ _
|
126
|
-
`# |_ _|__ ___| |_
|
127
|
-
`# | |/ _ \\/ __| __|
|
128
|
-
`# | | __/\\__ \\ |_
|
129
|
-
`# |_|\\___||___/\\__|
|
130
|
-
`#
|
131
|
-
`# for #{file}
|
132
|
-
`#
|
133
|
-
`# Extracted #{Time.now}
|
134
|
-
`# Unit Tools Reap Test Extractor
|
135
|
-
`#
|
136
|
-
`
|
137
|
-
`#{reqf}
|
138
|
-
`
|
139
|
-
HERE
|
140
|
-
teststr << testing << "\n"
|
141
|
-
teststr
|
142
|
-
end
|
143
|
-
|
144
|
-
end
|
145
|
-
|
146
|
-
end #module Reap
|
data/lib/reap/class/filer.rb
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
#++
|
3
|
-
|
4
|
-
#require 'digest/md5'
|
5
|
-
|
6
|
-
module Reap
|
7
|
-
|
8
|
-
# = Filer
|
9
|
-
#
|
10
|
-
#
|
11
|
-
|
12
|
-
class Filer
|
13
|
-
|
14
|
-
include TaskUtils
|
15
|
-
|
16
|
-
attr_accessor :source
|
17
|
-
|
18
|
-
def initialize( name, source, &build )
|
19
|
-
@name = name
|
20
|
-
@source = [source].flatten
|
21
|
-
@build = build
|
22
|
-
end
|
23
|
-
|
24
|
-
# Is this file task needed? Yes if it doesn't exist, or if its time
|
25
|
-
# stamp is out of date.
|
26
|
-
def needed?
|
27
|
-
return true unless ::File.exist?( @name )
|
28
|
-
return true if out_of_date?( timestamp( @name ) )
|
29
|
-
false
|
30
|
-
end
|
31
|
-
|
32
|
-
# Check timestamp.
|
33
|
-
def timestamp( name )
|
34
|
-
if ::File.exist?( name.to_s )
|
35
|
-
::File.mtime( name.to_s )
|
36
|
-
else
|
37
|
-
Time::EARLY # TODO replace with Facets' -Infinity class (?)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# Are there any sources with a later time than the given timestamp?
|
42
|
-
def out_of_date?( stamp )
|
43
|
-
@source.any? { |n| timestamp(n) > stamp }
|
44
|
-
end
|
45
|
-
|
46
|
-
# Build file.
|
47
|
-
|
48
|
-
def build
|
49
|
-
@build.call if needed?
|
50
|
-
end
|
51
|
-
|
52
|
-
alias_method :call, :build
|
53
|
-
|
54
|
-
private
|
55
|
-
|
56
|
-
#def salt( file )
|
57
|
-
# Digest::MD5.new( File.read( file ) ).hexdigest
|
58
|
-
#end
|
59
|
-
|
60
|
-
end
|
61
|
-
|
62
|
-
end #module Reap
|
data/lib/reap/class/manifest.rb
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# __ __ _ __ _
|
3
|
-
# | \/ |__ _ _ _ (_)/ _|___ __| |_
|
4
|
-
# | |\/| / _` | ' \| | _/ -_|_-< _|
|
5
|
-
# |_| |_\__,_|_||_|_|_| \___/__/\__|
|
6
|
-
#
|
7
|
-
#++
|
8
|
-
|
9
|
-
require 'digest/md5'
|
10
|
-
|
11
|
-
module Reap
|
12
|
-
|
13
|
-
# = Manifest
|
14
|
-
#
|
15
|
-
# Create a manifest file for the package. Presently it is a very simple
|
16
|
-
# md5 + filename manifest. In the future this will be exanded to build
|
17
|
-
# a varity of manifest formats.
|
18
|
-
#
|
19
|
-
# Task specific settings:
|
20
|
-
#
|
21
|
-
# include Files to include
|
22
|
-
# exclude Files to exclude
|
23
|
-
#
|
24
|
-
|
25
|
-
class Manifest
|
26
|
-
|
27
|
-
include TaskUtils
|
28
|
-
|
29
|
-
MUST_EXCLUDE = [ 'InstalledFiles', '**/CVS/**/*', '**/*~' ] #, 'dist', 'pkg' ]
|
30
|
-
|
31
|
-
attr_accessor :dir, :include, :exclude
|
32
|
-
|
33
|
-
def initialize( man )
|
34
|
-
@dir = '.'
|
35
|
-
@include = ['**/*']
|
36
|
-
@exclude = []
|
37
|
-
|
38
|
-
super
|
39
|
-
|
40
|
-
@exclude |= MUST_EXCLUDE
|
41
|
-
end
|
42
|
-
|
43
|
-
# Generate manifest file.
|
44
|
-
|
45
|
-
def generate #( type=nil )
|
46
|
-
manifest_file = File.join( File.expand_path( @dir ), 'MANIFEST' )
|
47
|
-
package_files = FileList.new
|
48
|
-
|
49
|
-
package_files.include(*@include)
|
50
|
-
package_files.exclude(*@exclude) #if @exclude and not @exclude.empty?
|
51
|
-
File.open( manifest_file, 'w+') do |f|
|
52
|
-
package_files.each do |pf|
|
53
|
-
f << "#{salt(pf)} #{pf}\n" if File.file?(pf)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
alias_method :call, :generate
|
59
|
-
|
60
|
-
private
|
61
|
-
|
62
|
-
def salt( file )
|
63
|
-
Digest::MD5.new( File.read( file ) ).hexdigest
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
end #module Reap
|