reap 5.0.0 → 5.10.10
Sign up to get free protection for your applications and to get access to all the features.
- data/ANN +3 -0
- data/COPYING +11 -0
- data/ChangeLog +25 -0
- data/ProjectInfo +41 -66
- data/README +125 -0
- data/Rakefile +0 -10
- data/bin/reap +3 -4
- data/data/reap/scaffold/COPYING +11 -0
- data/data/reap/scaffold/{standard/ChangeLog → ChangeLog} +0 -0
- data/data/reap/scaffold/{standard/TODO → INSTALL} +0 -0
- data/data/reap/scaffold/{standard/ProjectInfo → ProjectInfo} +20 -20
- data/data/reap/scaffold/{subversion/trunk/ChangeLog → README} +0 -0
- data/data/reap/scaffold/Rakefile +146 -0
- data/data/reap/scaffold/{subversion/trunk/TODO → Todo} +0 -0
- data/{doc/note → data/reap/scaffold}/setup.rb +11 -18
- data/{doc/note/aRakefile → dev/Rakefile} +0 -0
- data/{doc/note → dev}/composite_task.rb +0 -0
- data/{doc/note → dev}/compositepublisher.rb +0 -0
- data/{doc/note → dev}/ftptools.rb +0 -0
- data/{doc/note → dev}/license-each.rb +0 -0
- data/{doc/note → dev}/publisher.rb +0 -0
- data/{doc/note → dev}/rubyforgepublisher.rb +0 -0
- data/{doc/note → dev}/sshpublisher.rb +0 -0
- data/{doc/note → dev}/suby-cvs.rb +0 -0
- data/{doc/note → dev}/template.rb +0 -0
- data/lib/reap/bin/reap.rb +67 -84
- data/{doc/note/interface/interface.rb → lib/reap/lint.rb} +0 -0
- data/lib/reap/projectinfo.rb +28 -206
- data/lib/reap/readymade.rb +21 -0
- data/lib/reap/task.rb +118 -184
- data/lib/reap/task/announce.rb +93 -181
- data/lib/reap/task/fileperm.rb +16 -46
- data/lib/reap/task/info.rb +7 -33
- data/lib/reap/task/install.rb +17 -52
- data/{task → lib/reap/task}/noop.rb +9 -4
- data/lib/reap/task/package.rb +102 -348
- data/lib/reap/task/publish.rb +29 -155
- data/lib/reap/task/rdoc.rb +40 -92
- data/lib/reap/task/scaffold.rb +98 -41
- data/lib/reap/task/test.rb +52 -147
- data/lib/reap/task/testext.rb +110 -0
- data/lib/reap/task/webpublish.rb +43 -0
- data/lib/reap/tasks.rb +13 -0
- data/lib/reap/test.rb +138 -0
- data/setup.rb +272 -287
- data/test/tc_reap.rb +1 -1
- data/web/ProjectInfo +57 -0
- data/web/images/appleboy.jpg +0 -0
- data/web/images/grape.jpg +0 -0
- data/web/index.html +124 -0
- data/web/rdoc/classes/Object.html +121 -0
- data/web/rdoc/classes/ProjectInfo.html +207 -0
- data/web/rdoc/classes/ProjectInfo.src/M000094.html +18 -0
- data/web/rdoc/classes/ProjectInfo.src/M000095.html +24 -0
- data/web/rdoc/classes/ProjectInfo.src/M000096.html +22 -0
- data/web/rdoc/classes/ProjectInfo.src/M000097.html +21 -0
- data/web/rdoc/classes/ProjectInfo.src/M000098.html +18 -0
- data/web/rdoc/classes/Reap.html +248 -0
- data/web/rdoc/classes/Reap.src/M000023.html +16 -0
- data/web/rdoc/classes/Reap.src/M000024.html +21 -0
- data/web/rdoc/classes/Reap.src/M000025.html +16 -0
- data/web/rdoc/classes/Reap.src/M000026.html +21 -0
- data/web/rdoc/classes/Reap/Announce.html +262 -0
- data/web/rdoc/classes/Reap/Announce.src/M000030.html +18 -0
- data/web/rdoc/classes/Reap/Announce.src/M000031.html +114 -0
- data/web/rdoc/classes/Reap/Announce.src/M000032.html +46 -0
- data/web/rdoc/classes/Reap/Info.html +176 -0
- data/web/rdoc/classes/Reap/Info.src/M000033.html +18 -0
- data/web/rdoc/classes/Reap/Info.src/M000034.html +17 -0
- data/web/rdoc/classes/Reap/Info.src/M000035.html +18 -0
- data/web/rdoc/classes/Reap/Install.html +193 -0
- data/web/rdoc/classes/Reap/Install.src/M000036.html +18 -0
- data/web/rdoc/classes/Reap/Install.src/M000037.html +20 -0
- data/web/rdoc/classes/Reap/Install.src/M000038.html +26 -0
- data/web/rdoc/classes/Reap/Noop.html +192 -0
- data/web/rdoc/classes/Reap/Noop.src/M000027.html +18 -0
- data/web/rdoc/classes/Reap/Noop.src/M000028.html +17 -0
- data/web/rdoc/classes/Reap/Noop.src/M000029.html +18 -0
- data/web/rdoc/classes/Reap/Package.html +310 -0
- data/web/rdoc/classes/Reap/Package.src/M000055.html +18 -0
- data/web/rdoc/classes/Reap/Package.src/M000056.html +68 -0
- data/web/rdoc/classes/Reap/Package.src/M000057.html +84 -0
- data/web/rdoc/classes/Reap/Package.src/M000058.html +61 -0
- data/web/rdoc/classes/Reap/Perm.html +236 -0
- data/web/rdoc/classes/Reap/Perm.src/M000078.html +18 -0
- data/web/rdoc/classes/Reap/Perm.src/M000079.html +21 -0
- data/web/rdoc/classes/Reap/Perm.src/M000080.html +42 -0
- data/web/rdoc/classes/Reap/Perm.src/M000081.html +26 -0
- data/web/rdoc/classes/Reap/Perm.src/M000082.html +18 -0
- data/web/rdoc/classes/Reap/Publish.html +213 -0
- data/web/rdoc/classes/Reap/Publish.src/M000070.html +18 -0
- data/web/rdoc/classes/Reap/Publish.src/M000071.html +22 -0
- data/web/rdoc/classes/Reap/Publish.src/M000072.html +37 -0
- data/web/rdoc/classes/Reap/RDoc.html +218 -0
- data/web/rdoc/classes/Reap/RDoc.src/M000059.html +18 -0
- data/web/rdoc/classes/Reap/RDoc.src/M000060.html +24 -0
- data/web/rdoc/classes/Reap/RDoc.src/M000061.html +70 -0
- data/web/rdoc/classes/Reap/Task.html +396 -0
- data/web/rdoc/classes/Reap/Task.src/M000039.html +18 -0
- data/web/rdoc/classes/Reap/Task.src/M000040.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000041.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000042.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000043.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000044.html +22 -0
- data/web/rdoc/classes/Reap/Task.src/M000045.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000046.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000047.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000048.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000049.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000050.html +27 -0
- data/web/rdoc/classes/Reap/Task.src/M000051.html +19 -0
- data/web/rdoc/classes/Reap/Task.src/M000052.html +18 -0
- data/web/rdoc/classes/Reap/Task.src/M000053.html +18 -0
- data/web/rdoc/classes/Reap/Task.src/M000054.html +19 -0
- data/web/rdoc/classes/Reap/Test.html +253 -0
- data/web/rdoc/classes/Reap/Test.src/M000062.html +18 -0
- data/web/rdoc/classes/Reap/Test.src/M000063.html +26 -0
- data/web/rdoc/classes/Reap/Test.src/M000064.html +77 -0
- data/web/rdoc/classes/Reap/Test.src/M000065.html +27 -0
- data/web/rdoc/classes/Reap/Test.src/M000066.html +50 -0
- data/web/rdoc/classes/Reap/Test/TestResults.html +205 -0
- data/web/rdoc/classes/Reap/Test/TestResults.src/M000067.html +21 -0
- data/web/rdoc/classes/Reap/Test/TestResults.src/M000068.html +21 -0
- data/web/rdoc/classes/Reap/Test/TestResults.src/M000069.html +23 -0
- data/web/rdoc/classes/Reap/TestExt.html +234 -0
- data/web/rdoc/classes/Reap/TestExt.src/M000073.html +18 -0
- data/web/rdoc/classes/Reap/TestExt.src/M000074.html +20 -0
- data/web/rdoc/classes/Reap/TestExt.src/M000075.html +49 -0
- data/web/rdoc/classes/Reap/TestExt.src/M000076.html +34 -0
- data/web/rdoc/classes/Reap/TestExt.src/M000077.html +27 -0
- data/web/rdoc/classes/Reap/WebPublish.html +213 -0
- data/web/rdoc/classes/Reap/WebPublish.src/M000083.html +18 -0
- data/web/rdoc/classes/Reap/WebPublish.src/M000084.html +21 -0
- data/web/rdoc/classes/Reap/WebPublish.src/M000085.html +32 -0
- data/web/rdoc/classes/ReapCommand.html +425 -0
- data/web/rdoc/classes/ReapCommand.src/M000001.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000003.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000005.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000007.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000009.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000011.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000013.html +18 -0
- data/web/rdoc/classes/ReapCommand.src/M000014.html +19 -0
- data/web/rdoc/classes/ReapCommand.src/M000015.html +19 -0
- data/web/rdoc/classes/ReapCommand.src/M000016.html +24 -0
- data/web/rdoc/classes/ReapCommand.src/M000018.html +29 -0
- data/web/rdoc/classes/Scaffold.html +211 -0
- data/web/rdoc/classes/Scaffold.src/M000086.html +16 -0
- data/web/rdoc/classes/Scaffold.src/M000087.html +28 -0
- data/web/rdoc/classes/Scaffold.src/M000088.html +32 -0
- data/web/rdoc/classes/Scaffold.src/M000089.html +18 -0
- data/web/rdoc/classes/UnitTestKernel.html +176 -0
- data/web/rdoc/classes/UnitTestKernel.src/M000019.html +18 -0
- data/web/rdoc/classes/UnitTestKernel.src/M000020.html +18 -0
- data/web/rdoc/classes/UnitTestKernel.src/M000021.html +22 -0
- data/web/rdoc/classes/UnitTestKernel.src/M000022.html +22 -0
- data/web/rdoc/classes/UnitTesting.html +165 -0
- data/web/rdoc/classes/UnitTesting.src/M000090.html +34 -0
- data/web/rdoc/classes/UnitTesting.src/M000091.html +18 -0
- data/web/rdoc/classes/UnitTesting/Failure.html +156 -0
- data/web/rdoc/classes/UnitTesting/Failure.src/M000092.html +18 -0
- data/web/rdoc/classes/UnitTesting/Failure.src/M000093.html +21 -0
- data/web/rdoc/created.rid +1 -0
- data/web/rdoc/files/ANN.html +107 -0
- data/web/rdoc/files/COPYING.html +119 -0
- data/web/rdoc/files/ChangeLog.html +144 -0
- data/web/rdoc/files/ProjectInfo.html +190 -0
- data/web/rdoc/files/README.html +274 -0
- data/web/rdoc/files/Rakefile.html +101 -0
- data/web/rdoc/files/lib/reap/bin/reap_rb.html +129 -0
- data/web/rdoc/files/lib/reap/lint_rb.html +101 -0
- data/web/rdoc/files/lib/reap/projectinfo_rb.html +110 -0
- data/web/rdoc/files/lib/reap/readymade_rb.html +123 -0
- data/web/rdoc/files/lib/reap/task/announce_rb.html +114 -0
- data/web/rdoc/files/lib/reap/task/fileperm_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/info_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/install_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/noop_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/package_rb.html +109 -0
- data/web/rdoc/files/lib/reap/task/publish_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/rdoc_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/scaffold_rb.html +107 -0
- data/web/rdoc/files/lib/reap/task/test_rb.html +110 -0
- data/web/rdoc/files/lib/reap/task/testext_rb.html +109 -0
- data/web/rdoc/files/lib/reap/task/webpublish_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task_rb.html +120 -0
- data/web/rdoc/files/lib/reap/tasks_rb.html +116 -0
- data/web/rdoc/files/lib/reap/test_rb.html +109 -0
- data/web/rdoc/fr_class_index.html +47 -0
- data/web/rdoc/fr_file_index.html +51 -0
- data/web/rdoc/fr_method_index.html +124 -0
- data/web/rdoc/index.html +24 -0
- data/web/rdoc/rdoc-style.css +208 -0
- metadata +257 -138
- data/bin/rubytest +0 -5
- data/data/reap/scaffold/standard/COPYING +0 -403
- data/data/reap/scaffold/standard/INSTALL +0 -14
- data/data/reap/scaffold/standard/README +0 -3
- data/data/reap/scaffold/standard/Rakefile +0 -10
- data/data/reap/scaffold/standard/setup.rb +0 -1568
- data/data/reap/scaffold/subversion/trunk/COPYING +0 -403
- data/data/reap/scaffold/subversion/trunk/INSTALL +0 -14
- data/data/reap/scaffold/subversion/trunk/ProjectInfo +0 -78
- data/data/reap/scaffold/subversion/trunk/README +0 -3
- data/data/reap/scaffold/subversion/trunk/Rakefile +0 -10
- data/data/reap/scaffold/subversion/trunk/setup.rb +0 -1568
- data/data/reap/setup.rb +0 -1568
- data/doc/COPYING +0 -403
- data/doc/ChangeLog +0 -18
- data/doc/LATEST +0 -29
- data/doc/README +0 -182
- data/doc/doap.xml +0 -27
- data/doc/note/ProjectInfo.rb +0 -88
- data/doc/note/Rakefile.0 +0 -118
- data/doc/note/Rakefile.htm +0 -69
- data/doc/note/application.rb +0 -124
- data/doc/note/interface/rubyforge.rb +0 -247
- data/doc/note/intro.txt +0 -42
- data/doc/note/package.rb +0 -629
- data/doc/note/package.rb.0 +0 -394
- data/doc/note/scaffold.rb +0 -123
- data/lib/reap/app.rb +0 -74
- data/lib/reap/bin/rubylint.rb +0 -1
- data/lib/reap/bin/rubytest.rb +0 -45
- data/lib/reap/rake.rb +0 -12
- data/lib/reap/rakeadapter.rb +0 -50
- data/lib/reap/reap.rb +0 -32
- data/lib/reap/task/custom.rb +0 -12
- data/lib/reap/task/doap.rb +0 -85
- data/lib/reap/task/extest.rb +0 -161
- data/lib/reap/task/manifest.rb +0 -70
- data/lib/reap/task/release.rb +0 -512
- data/lib/reap/task/template.rb +0 -46
- data/lib/reap/vendor/http-access2.rb +0 -1590
- data/lib/reap/vendor/http-access2/cookie.rb +0 -538
- data/lib/reap/vendor/http-access2/http.rb +0 -542
data/lib/reap/task/manifest.rb
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'reap/task'
|
3
|
-
require 'digest/md5'
|
4
|
-
|
5
|
-
# __ __ _ __ _ _____ _
|
6
|
-
# | \/ |__ _ _ _ (_)/ _|___ __| |_ |_ _|_ _ __| |__
|
7
|
-
# | |\/| / _` | ' \| | _/ -_|_-< _| | |/ _` (_-< / /
|
8
|
-
# |_| |_\__,_|_||_|_|_| \___/__/\__| |_|\__,_/__/_\_\
|
9
|
-
#
|
10
|
-
|
11
|
-
# = Manifest Task
|
12
|
-
|
13
|
-
class Reap::Manifest < Reap::Task
|
14
|
-
|
15
|
-
MUST_EXCLUDE = [ 'InstalledFiles', '**/CVS/**/*', '**/*~', 'dist', 'pkg' ]
|
16
|
-
|
17
|
-
task_desc "Create a MANIFEST file for this package."
|
18
|
-
|
19
|
-
task_help %{
|
20
|
-
|
21
|
-
reap manifest
|
22
|
-
|
23
|
-
Creates a manifest file for the package.
|
24
|
-
|
25
|
-
include user name to use
|
26
|
-
exclude group name to use
|
27
|
-
|
28
|
-
}
|
29
|
-
|
30
|
-
task_attr :man
|
31
|
-
|
32
|
-
def run
|
33
|
-
|
34
|
-
man.include ||= ['**/*']
|
35
|
-
|
36
|
-
man.exclude ||= []
|
37
|
-
man.exclude |= MUST_EXCLUDE
|
38
|
-
|
39
|
-
package_files = FileList.new
|
40
|
-
package_files.include(*man.include)
|
41
|
-
package_files.exclude(*man.exclude) if man.exclude and not man.exclude.empty?
|
42
|
-
|
43
|
-
File.open('MANIFEST', 'w+') do |f|
|
44
|
-
package_files.each do |pf|
|
45
|
-
f << "#{salt(pf)} #{pf}\n" if File.file?(pf)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
# support functions
|
52
|
-
def salt( file )
|
53
|
-
Digest::MD5.new( File.read( file ) ).hexdigest
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
|
59
|
-
# Rake interface.
|
60
|
-
|
61
|
-
if defined?(Rake)
|
62
|
-
|
63
|
-
#require 'reap/rake/adapter'
|
64
|
-
|
65
|
-
module Rake
|
66
|
-
ReapManifest = ::Reap::RakeAdapter( ::Reap::Manifest )
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
|
data/lib/reap/task/release.rb
DELETED
@@ -1,512 +0,0 @@
|
|
1
|
-
require "enumerator"
|
2
|
-
|
3
|
-
require 'reap/task'
|
4
|
-
require "reap/vendor/http-access2"
|
5
|
-
|
6
|
-
# ___ _ _____ _
|
7
|
-
# | _ \___| |___ __ _ ___ ___ |_ _|_ _ __| |__
|
8
|
-
# | / -_) / -_) _` (_-</ -_) | |/ _` (_-< / /
|
9
|
-
# |_|_\___|_\___\__,_/__/\___| |_|\__,_/__/_\_\
|
10
|
-
#
|
11
|
-
|
12
|
-
# = Release Task
|
13
|
-
#
|
14
|
-
# This task releases files to RubyForge and other GForge instaces
|
15
|
-
# or SourceForge clones. In its most simple usage it looks like:
|
16
|
-
#
|
17
|
-
# project = MetaProject::Project::XForge::RubyForge.new('xforge')
|
18
|
-
# # Create a new release of the xforge project on Rubyforge.
|
19
|
-
# task :release => [:gem] do
|
20
|
-
# Rake::XForge::Release.new(project) {}
|
21
|
-
# end
|
22
|
-
#
|
23
|
-
# The previous example will use defaults where it can. It will prompt
|
24
|
-
# you for your xForge user name and password before it uploads all
|
25
|
-
# gems under the pkg folder and creates a RubyForge release.
|
26
|
-
#
|
27
|
-
# While defaults are nice, you may want a little more control. You can
|
28
|
-
# specify additional attributes:
|
29
|
-
#
|
30
|
-
# * #user_name
|
31
|
-
# * #password
|
32
|
-
# * #changes_file
|
33
|
-
# * #version
|
34
|
-
# * #files
|
35
|
-
# * #release_name
|
36
|
-
# * #release_notes
|
37
|
-
# * #release_changes
|
38
|
-
# * #package_name
|
39
|
-
#
|
40
|
-
# Example:
|
41
|
-
# project = MetaProject::Project::XForge::RubyForge.new('xforge')
|
42
|
-
# task :release => [:gem] do
|
43
|
-
# release_files = FileList[ 'pkg/*.gem', 'CHANGES' ]
|
44
|
-
#
|
45
|
-
# Rake::XForge::Release.new(project) do |xf|
|
46
|
-
# # Never hardcode user name and password in the Rakefile!
|
47
|
-
# xf.user_name = ENV['RUBYFORGE_USER']
|
48
|
-
# xf.password = ENV['RUBYFORGE_PASSWORD']
|
49
|
-
# xf.files = release_files.to_a
|
50
|
-
# xf.release_name = "XForge 0.1"
|
51
|
-
# end
|
52
|
-
#
|
53
|
-
# This can be invoked from the command line:
|
54
|
-
#
|
55
|
-
# rake release RUBYFORGE_USER=myuser \
|
56
|
-
# RUBYFORGE_PASSWORD=mypassword
|
57
|
-
#
|
58
|
-
# If you don't like blocks, you can do like this:
|
59
|
-
#
|
60
|
-
# project = MetaProject::Project::XForge::RubyForge.new('xforge')
|
61
|
-
# task :release => [:gem] do
|
62
|
-
# xf = Rake::XForge::Release.new(project)
|
63
|
-
# ... # Set additional attributes
|
64
|
-
# xf.execute
|
65
|
-
# end
|
66
|
-
|
67
|
-
class Reap::Release < Reap::Task
|
68
|
-
|
69
|
-
task_desc "Release distribution files."
|
70
|
-
|
71
|
-
task_help %{
|
72
|
-
|
73
|
-
reap release
|
74
|
-
|
75
|
-
Release distribution to Rubyforge, or other
|
76
|
-
GForge based service.
|
77
|
-
|
78
|
-
host URL of host service
|
79
|
-
username Username of host service
|
80
|
-
project Project name at host
|
81
|
-
package Package name
|
82
|
-
groupid Group id number
|
83
|
-
architecture Architecture (Any, i386, PPC, etc.)
|
84
|
-
release Release name (default is "%s")
|
85
|
-
private Private release?
|
86
|
-
changelog Change log file
|
87
|
-
notelog Release notes file
|
88
|
-
dir Distribution directory
|
89
|
-
exclude Distribution types to exclude
|
90
|
-
|
91
|
-
The release option can be a template by using %s in the
|
92
|
-
string. The version number of your project will be sub'd
|
93
|
-
in for the %s. This saves you from having to update
|
94
|
-
the release name before every release.
|
95
|
-
|
96
|
-
}
|
97
|
-
|
98
|
-
task_attr :rel
|
99
|
-
|
100
|
-
def run
|
101
|
-
|
102
|
-
# setup
|
103
|
-
|
104
|
-
rel.host ||= 'rubyforge.org'
|
105
|
-
rel.host.chomp!('/')
|
106
|
-
|
107
|
-
rel.username ||= master.rubyforge.username
|
108
|
-
#rel.password ||= master.rubyforge.password
|
109
|
-
|
110
|
-
rel.project ||= master.rubyforge.project || master.name
|
111
|
-
rel.package ||= master.rubyforge.package
|
112
|
-
#rel.packageid ||= master.rubyforge.packageid
|
113
|
-
rel.groupid ||= master.rubyforge.groupid
|
114
|
-
rel.private ||= false
|
115
|
-
rel.processor ||= 'Any'
|
116
|
-
|
117
|
-
rel.date ||= Time::now.strftime('%Y-%m-%d %H:%M')
|
118
|
-
|
119
|
-
rel.exclude ||= []
|
120
|
-
rel.exclude << 'tar.gz' if rel.exclude.include?( 'tgz' )
|
121
|
-
rel.exclude << 'tgz' if rel.exclude.include?( 'tar.gz' )
|
122
|
-
rel.exclude << 'tar.bz2' if rel.exclude.include?( 'tbz' )
|
123
|
-
rel.exclude << 'tbz' if rel.exclude.include?( 'tar.bz2' )
|
124
|
-
|
125
|
-
rel.cookie_jar ||= File::join(File::expand_path("~"), ".rubyforge.cookie_jar")
|
126
|
-
|
127
|
-
# do not inherit these
|
128
|
-
|
129
|
-
rel.dir = section.dir || master.project.dir
|
130
|
-
rel.release = (section.release || "%s") % (master.version || rel.date)
|
131
|
-
|
132
|
-
# verify
|
133
|
-
|
134
|
-
abort "missing field -- package" unless rel.package
|
135
|
-
#abort "missing field -- packageid" unless rel.packageid
|
136
|
-
abort "missing field -- groupid" unless rel.groupid
|
137
|
-
# add more...
|
138
|
-
|
139
|
-
# case rel.host
|
140
|
-
# when 'rubyforge', 'rubyforge.org'
|
141
|
-
# else
|
142
|
-
# puts %{Unrecognized release host '#{rel.host}'. Skipped.}
|
143
|
-
# skip = true
|
144
|
-
# end
|
145
|
-
|
146
|
-
# release
|
147
|
-
|
148
|
-
puts "Reap is preparing release ..."
|
149
|
-
|
150
|
-
rtypes = [ 'tgz', 'tbz', 'tar.gz', 'tar.bz2', 'deb', 'gem', 'ebuild' ]
|
151
|
-
rtypes -= rel.exclude
|
152
|
-
rtypes = rtypes.collect { |rt| Regexp.escape( rt ) }
|
153
|
-
re_rtypes = Regexp.new( '[.](' << rtypes.join('|') << ')$' )
|
154
|
-
|
155
|
-
dir = File.join( rel.dir, "#{rel.name}-#{rel.version}" )
|
156
|
-
files = Dir.entries(dir).select { |f|
|
157
|
-
f =~ re_rtypes or f == 'PKGBUILD'
|
158
|
-
}
|
159
|
-
files = files.collect { |f| File.join( dir, f ) }
|
160
|
-
|
161
|
-
if files.empty?
|
162
|
-
puts "No files to release at #{dir}."
|
163
|
-
exit -1
|
164
|
-
end
|
165
|
-
|
166
|
-
# ask for password
|
167
|
-
unless $PASSWORD
|
168
|
-
print "Password for #{rel.username}: "
|
169
|
-
until passwd = $stdin.gets.strip ; sleep 1 ; end
|
170
|
-
@password = passwd
|
171
|
-
else
|
172
|
-
@password = $PASSWORD
|
173
|
-
end
|
174
|
-
|
175
|
-
login {
|
176
|
-
|
177
|
-
unless package?
|
178
|
-
puts "Package (#{rel.package}) does not exist."
|
179
|
-
puts "Use -f option to force package creation."
|
180
|
-
exit 0 unless $FORCE
|
181
|
-
create_package
|
182
|
-
puts "Created package -- #{rel.package}"
|
183
|
-
end
|
184
|
-
|
185
|
-
if release?
|
186
|
-
unless $FORCE
|
187
|
-
puts "Release (#{rel.release}) already exists."
|
188
|
-
puts "Use -f option to force re-release."
|
189
|
-
exit 0
|
190
|
-
end
|
191
|
-
files.each do |f|
|
192
|
-
remove_file( f ) if file?( f )
|
193
|
-
puts "Removed old file -- #{ f }"
|
194
|
-
add_file( f )
|
195
|
-
puts "Added new file -- #{ f }"
|
196
|
-
end
|
197
|
-
else
|
198
|
-
add_release( files.first )
|
199
|
-
unless release?
|
200
|
-
puts "Release creation failed -- #{rel.release}"
|
201
|
-
exit -1
|
202
|
-
end
|
203
|
-
puts "Added release -- #{ rel.release }"
|
204
|
-
puts "Added file -- #{ files.first }"
|
205
|
-
files[1..-1].each do |f|
|
206
|
-
add_file( f )
|
207
|
-
puts "Added file -- #{ f }"
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
|
-
}
|
212
|
-
|
213
|
-
puts "Release complete!"
|
214
|
-
end
|
215
|
-
|
216
|
-
private
|
217
|
-
|
218
|
-
FILETYPES = {
|
219
|
-
".deb" => 1000,
|
220
|
-
".rpm" => 2000,
|
221
|
-
".zip" => 3000,
|
222
|
-
".bz2" => 3100,
|
223
|
-
".gz" => 3110,
|
224
|
-
".src.zip" => 5000,
|
225
|
-
".src.bz2" => 5010,
|
226
|
-
".src.gz" => 5020,
|
227
|
-
".src.rpm" => 5100,
|
228
|
-
".src" => 5900,
|
229
|
-
".jpg" => 8000,
|
230
|
-
".txt" => 8100,
|
231
|
-
".text" => 8100,
|
232
|
-
".htm" => 8200,
|
233
|
-
".html" => 8200,
|
234
|
-
".pdf" => 8300,
|
235
|
-
".oth" => 9999,
|
236
|
-
".ebuild" => 1300,
|
237
|
-
".exe" => 1100,
|
238
|
-
".dmg" => 1200,
|
239
|
-
".tar.gz" => 5000,
|
240
|
-
".tgz" => 5000,
|
241
|
-
".gem" => 1400,
|
242
|
-
".pgp" => 8150,
|
243
|
-
".sig" => 8150,
|
244
|
-
}
|
245
|
-
|
246
|
-
PROCESSORS = {
|
247
|
-
"i386" => 1000,
|
248
|
-
"IA64" => 6000,
|
249
|
-
"Alpha" => 7000,
|
250
|
-
"Any" => 8000,
|
251
|
-
"PPC" => 2000,
|
252
|
-
"MIPS" => 3000,
|
253
|
-
"Sparc" => 4000,
|
254
|
-
"UltraSparc" => 5000,
|
255
|
-
"Other" => 9999,
|
256
|
-
}
|
257
|
-
|
258
|
-
# login
|
259
|
-
|
260
|
-
def login( &block )
|
261
|
-
# login
|
262
|
-
page = "/account/login.php"
|
263
|
-
method = "post_content"
|
264
|
-
form = {
|
265
|
-
"return_to" => "",
|
266
|
-
"form_loginname" => rel.username,
|
267
|
-
"form_pw" => @password,
|
268
|
-
"login" => "Login"
|
269
|
-
}
|
270
|
-
http_transaction( page, method, form )
|
271
|
-
|
272
|
-
# do whatever
|
273
|
-
block.call
|
274
|
-
|
275
|
-
# logout
|
276
|
-
page = "/account/logout.php"
|
277
|
-
method = "post_content"
|
278
|
-
form = {}
|
279
|
-
http_transaction( page, method, form )
|
280
|
-
end
|
281
|
-
|
282
|
-
# Package exists?
|
283
|
-
|
284
|
-
def package?
|
285
|
-
page = "/frs/"
|
286
|
-
method = "post_content"
|
287
|
-
form = {
|
288
|
-
"group_id" => rel.groupid
|
289
|
-
}
|
290
|
-
scrape = http_transaction( page, method, form )
|
291
|
-
|
292
|
-
restr = ''
|
293
|
-
restr << Regexp.escape( rel.package )
|
294
|
-
restr << '\s*'
|
295
|
-
restr << Regexp.escape( %{<a href="/frs/monitor.php?filemodule_id=} )
|
296
|
-
restr << '(\d+)'
|
297
|
-
restr << Regexp.escape( %{&group_id=#{rel.groupid}} )
|
298
|
-
re = Regexp.new( restr )
|
299
|
-
|
300
|
-
md = re.match( scrape )
|
301
|
-
if md
|
302
|
-
rel.packageid = md[1]
|
303
|
-
end
|
304
|
-
end
|
305
|
-
|
306
|
-
# Create a new package.
|
307
|
-
|
308
|
-
def create_package
|
309
|
-
page = "/frs/admin/index.php"
|
310
|
-
method = "post_content"
|
311
|
-
form = {
|
312
|
-
"group_id" => rel.groupid,
|
313
|
-
"package_name" => rel.package,
|
314
|
-
"func" => "add_package",
|
315
|
-
"is_public" => (rel.private ? 0 : 1),
|
316
|
-
"submit" => "Create This Package"
|
317
|
-
}
|
318
|
-
http_transaction( page, method, form )
|
319
|
-
end
|
320
|
-
|
321
|
-
# Release exits?
|
322
|
-
|
323
|
-
def release?
|
324
|
-
page = "/frs/admin/showreleases.php"
|
325
|
-
method = "post_content"
|
326
|
-
form = {
|
327
|
-
"package_id" => rel.packageid,
|
328
|
-
"group_id" => rel.groupid
|
329
|
-
}
|
330
|
-
scrape = http_transaction( page, method, form )
|
331
|
-
|
332
|
-
restr = ''
|
333
|
-
restr << Regexp.escape( %{"editrelease.php?group_id=#{rel.groupid}} )
|
334
|
-
restr << Regexp.escape( %{&package_id=#{rel.packageid}} )
|
335
|
-
restr << Regexp.escape( %{&release_id=} )
|
336
|
-
restr << '(\d+)'
|
337
|
-
restr << Regexp.escape( %{">#{rel.release}} )
|
338
|
-
re = Regexp.new( restr )
|
339
|
-
|
340
|
-
md = re.match( scrape )
|
341
|
-
if md
|
342
|
-
rel.releaseid = md[1]
|
343
|
-
end
|
344
|
-
end
|
345
|
-
|
346
|
-
# Add a new release.
|
347
|
-
|
348
|
-
def add_release( userfile )
|
349
|
-
page = "/frs/admin/qrs.php"
|
350
|
-
method = "post_content"
|
351
|
-
|
352
|
-
type_id = rel.type || userfile[%r|\.[^\./]+$|]
|
353
|
-
type_id = FILETYPES[type_id]
|
354
|
-
proc_id = PROCESSORS[rel.processor]
|
355
|
-
|
356
|
-
# how to use these?
|
357
|
-
notes = rel.notes ? rel.notes : ( rel.notelog ? open(rel.notelog) : nil )
|
358
|
-
changes = rel.changes ? rel.changes : ( rel.changelog ? open(rel.changelog) : nil )
|
359
|
-
|
360
|
-
userfile = open(userfile)
|
361
|
-
|
362
|
-
preformatted = '1'
|
363
|
-
|
364
|
-
form = {
|
365
|
-
"group_id" => rel.groupid,
|
366
|
-
"package_id" => rel.packageid,
|
367
|
-
"release_name" => rel.release,
|
368
|
-
"release_date" => rel.date,
|
369
|
-
"type_id" => type_id,
|
370
|
-
"processor_id" => proc_id,
|
371
|
-
"preformatted" => preformatted,
|
372
|
-
"userfile" => userfile,
|
373
|
-
"submit" => "Release File"
|
374
|
-
}
|
375
|
-
|
376
|
-
boundary = Array::new(8){ "%2.2d" % rand(42) }.join('__')
|
377
|
-
extheader = { 'content-type'=>"multipart/form-data; boundary=___#{ boundary }___" }
|
378
|
-
|
379
|
-
http_transaction( page, method, form, extheader )
|
380
|
-
end
|
381
|
-
|
382
|
-
# Does file exist?
|
383
|
-
|
384
|
-
# Note this is a little bit fragile.
|
385
|
-
# If two releases have the same exact file name in them
|
386
|
-
# there could be a problem --that's probably not likely,
|
387
|
-
# maybe even impossible, but as of yet, I can't yet rule it out.
|
388
|
-
|
389
|
-
def file?( file )
|
390
|
-
page = "/frs/"
|
391
|
-
method = "post_content"
|
392
|
-
form = {
|
393
|
-
"group_id" => rel.groupid
|
394
|
-
}
|
395
|
-
scrape = http_transaction( page, method, form )
|
396
|
-
|
397
|
-
restr = ''
|
398
|
-
restr << Regexp.escape( rel.package )
|
399
|
-
restr << '\s*'
|
400
|
-
restr << Regexp.escape( %{<a href="/frs/download.php/} )
|
401
|
-
restr << '(\d+)'
|
402
|
-
restr << Regexp.escape( %{/#{file}} )
|
403
|
-
re = Regexp.new( restr )
|
404
|
-
|
405
|
-
md = re.match( scrape )
|
406
|
-
if md
|
407
|
-
rel.fileid = md[1]
|
408
|
-
end
|
409
|
-
end
|
410
|
-
|
411
|
-
# Remove file from release.
|
412
|
-
|
413
|
-
def remove_file( file )
|
414
|
-
page="/frs/admin/editrelease.php"
|
415
|
-
method = "post_content"
|
416
|
-
form = {
|
417
|
-
"group_id" => rel.groupid,
|
418
|
-
"package_id" => rel.packageid,
|
419
|
-
"release_id" => rel.releaseid,
|
420
|
-
"file_id" => rel.fileid,
|
421
|
-
"step3" => "Delete File",
|
422
|
-
"im_sure" => '1',
|
423
|
-
"submit" => "Delete File "
|
424
|
-
}
|
425
|
-
|
426
|
-
http_transaction( page, method, form )
|
427
|
-
end
|
428
|
-
|
429
|
-
# Add file to release.
|
430
|
-
|
431
|
-
def add_file( userfile )
|
432
|
-
page = '/frs/admin/editrelease.php'
|
433
|
-
method = "post_content"
|
434
|
-
|
435
|
-
type_id = rel.type || userfile[%r|\.[^\./]+$|]
|
436
|
-
type_id = FILETYPES[type_id]
|
437
|
-
proc_id = PROCESSORS[rel.processor]
|
438
|
-
|
439
|
-
userfile = open( userfile )
|
440
|
-
|
441
|
-
form = {
|
442
|
-
"group_id" => rel.groupid,
|
443
|
-
"package_id" => rel.packageid,
|
444
|
-
"release_id" => rel.releaseid,
|
445
|
-
"step2" => '1',
|
446
|
-
"userfile" => userfile,
|
447
|
-
"type_id" => type_id,
|
448
|
-
"processor_id" => proc_id,
|
449
|
-
"submit" => "Add This File"
|
450
|
-
}
|
451
|
-
|
452
|
-
boundary = Array::new(8){ "%2.2d" % rand(42) }.join('__')
|
453
|
-
extheader = { 'content-type'=>"multipart/form-data; boundary=___#{ boundary }___" }
|
454
|
-
|
455
|
-
http_transaction( page, method, form, extheader )
|
456
|
-
end
|
457
|
-
|
458
|
-
# http transaction
|
459
|
-
|
460
|
-
def http_transaction( page, method, form, extheader={} )
|
461
|
-
client = HTTPAccess2::Client::new ENV['HTTP_PROXY']
|
462
|
-
client.debug_dev = STDERR if ENV['DEBUG']
|
463
|
-
client.set_cookie_store( rel.cookie_jar )
|
464
|
-
# fixes http-access2 bug
|
465
|
-
client.redirect_uri_callback = lambda do |res|
|
466
|
-
page = res.header['location'].first
|
467
|
-
page = page =~ %r/http/ ? page : "http://#{ rel.host }/#{ page }"
|
468
|
-
page
|
469
|
-
end
|
470
|
-
page.sub!(/^\//, '')
|
471
|
-
uri = "http://#{ rel.host }/#{ page }"
|
472
|
-
response = client.send method, uri, form, extheader
|
473
|
-
client.save_cookie_store
|
474
|
-
return response
|
475
|
-
end
|
476
|
-
|
477
|
-
end
|
478
|
-
|
479
|
-
# fixes http-access2 bug
|
480
|
-
BEGIN {
|
481
|
-
require "reap/vendor/http-access2"
|
482
|
-
module WebAgent::CookieUtils
|
483
|
-
def domain_match(host, domain)
|
484
|
-
case domain
|
485
|
-
when /\d+\.\d+\.\d+\.\d+/
|
486
|
-
return (host == domain)
|
487
|
-
when '.'
|
488
|
-
return true
|
489
|
-
when /^\./
|
490
|
-
#return tail_match?(domain, host)
|
491
|
-
return tail_match?(host, domain)
|
492
|
-
else
|
493
|
-
return (host == domain)
|
494
|
-
end
|
495
|
-
end
|
496
|
-
end
|
497
|
-
}
|
498
|
-
|
499
|
-
|
500
|
-
# Rake interface.
|
501
|
-
|
502
|
-
if defined?(Rake)
|
503
|
-
|
504
|
-
#require 'reap/rake/adapter'
|
505
|
-
|
506
|
-
module Rake
|
507
|
-
ReapRelease = ::Reap::RakeAdapter( ::Reap::Release )
|
508
|
-
end
|
509
|
-
|
510
|
-
end
|
511
|
-
|
512
|
-
|