reap 5.0.0 → 5.10.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. data/ANN +3 -0
  2. data/COPYING +11 -0
  3. data/ChangeLog +25 -0
  4. data/ProjectInfo +41 -66
  5. data/README +125 -0
  6. data/Rakefile +0 -10
  7. data/bin/reap +3 -4
  8. data/data/reap/scaffold/COPYING +11 -0
  9. data/data/reap/scaffold/{standard/ChangeLog → ChangeLog} +0 -0
  10. data/data/reap/scaffold/{standard/TODO → INSTALL} +0 -0
  11. data/data/reap/scaffold/{standard/ProjectInfo → ProjectInfo} +20 -20
  12. data/data/reap/scaffold/{subversion/trunk/ChangeLog → README} +0 -0
  13. data/data/reap/scaffold/Rakefile +146 -0
  14. data/data/reap/scaffold/{subversion/trunk/TODO → Todo} +0 -0
  15. data/{doc/note → data/reap/scaffold}/setup.rb +11 -18
  16. data/{doc/note/aRakefile → dev/Rakefile} +0 -0
  17. data/{doc/note → dev}/composite_task.rb +0 -0
  18. data/{doc/note → dev}/compositepublisher.rb +0 -0
  19. data/{doc/note → dev}/ftptools.rb +0 -0
  20. data/{doc/note → dev}/license-each.rb +0 -0
  21. data/{doc/note → dev}/publisher.rb +0 -0
  22. data/{doc/note → dev}/rubyforgepublisher.rb +0 -0
  23. data/{doc/note → dev}/sshpublisher.rb +0 -0
  24. data/{doc/note → dev}/suby-cvs.rb +0 -0
  25. data/{doc/note → dev}/template.rb +0 -0
  26. data/lib/reap/bin/reap.rb +67 -84
  27. data/{doc/note/interface/interface.rb → lib/reap/lint.rb} +0 -0
  28. data/lib/reap/projectinfo.rb +28 -206
  29. data/lib/reap/readymade.rb +21 -0
  30. data/lib/reap/task.rb +118 -184
  31. data/lib/reap/task/announce.rb +93 -181
  32. data/lib/reap/task/fileperm.rb +16 -46
  33. data/lib/reap/task/info.rb +7 -33
  34. data/lib/reap/task/install.rb +17 -52
  35. data/{task → lib/reap/task}/noop.rb +9 -4
  36. data/lib/reap/task/package.rb +102 -348
  37. data/lib/reap/task/publish.rb +29 -155
  38. data/lib/reap/task/rdoc.rb +40 -92
  39. data/lib/reap/task/scaffold.rb +98 -41
  40. data/lib/reap/task/test.rb +52 -147
  41. data/lib/reap/task/testext.rb +110 -0
  42. data/lib/reap/task/webpublish.rb +43 -0
  43. data/lib/reap/tasks.rb +13 -0
  44. data/lib/reap/test.rb +138 -0
  45. data/setup.rb +272 -287
  46. data/test/tc_reap.rb +1 -1
  47. data/web/ProjectInfo +57 -0
  48. data/web/images/appleboy.jpg +0 -0
  49. data/web/images/grape.jpg +0 -0
  50. data/web/index.html +124 -0
  51. data/web/rdoc/classes/Object.html +121 -0
  52. data/web/rdoc/classes/ProjectInfo.html +207 -0
  53. data/web/rdoc/classes/ProjectInfo.src/M000094.html +18 -0
  54. data/web/rdoc/classes/ProjectInfo.src/M000095.html +24 -0
  55. data/web/rdoc/classes/ProjectInfo.src/M000096.html +22 -0
  56. data/web/rdoc/classes/ProjectInfo.src/M000097.html +21 -0
  57. data/web/rdoc/classes/ProjectInfo.src/M000098.html +18 -0
  58. data/web/rdoc/classes/Reap.html +248 -0
  59. data/web/rdoc/classes/Reap.src/M000023.html +16 -0
  60. data/web/rdoc/classes/Reap.src/M000024.html +21 -0
  61. data/web/rdoc/classes/Reap.src/M000025.html +16 -0
  62. data/web/rdoc/classes/Reap.src/M000026.html +21 -0
  63. data/web/rdoc/classes/Reap/Announce.html +262 -0
  64. data/web/rdoc/classes/Reap/Announce.src/M000030.html +18 -0
  65. data/web/rdoc/classes/Reap/Announce.src/M000031.html +114 -0
  66. data/web/rdoc/classes/Reap/Announce.src/M000032.html +46 -0
  67. data/web/rdoc/classes/Reap/Info.html +176 -0
  68. data/web/rdoc/classes/Reap/Info.src/M000033.html +18 -0
  69. data/web/rdoc/classes/Reap/Info.src/M000034.html +17 -0
  70. data/web/rdoc/classes/Reap/Info.src/M000035.html +18 -0
  71. data/web/rdoc/classes/Reap/Install.html +193 -0
  72. data/web/rdoc/classes/Reap/Install.src/M000036.html +18 -0
  73. data/web/rdoc/classes/Reap/Install.src/M000037.html +20 -0
  74. data/web/rdoc/classes/Reap/Install.src/M000038.html +26 -0
  75. data/web/rdoc/classes/Reap/Noop.html +192 -0
  76. data/web/rdoc/classes/Reap/Noop.src/M000027.html +18 -0
  77. data/web/rdoc/classes/Reap/Noop.src/M000028.html +17 -0
  78. data/web/rdoc/classes/Reap/Noop.src/M000029.html +18 -0
  79. data/web/rdoc/classes/Reap/Package.html +310 -0
  80. data/web/rdoc/classes/Reap/Package.src/M000055.html +18 -0
  81. data/web/rdoc/classes/Reap/Package.src/M000056.html +68 -0
  82. data/web/rdoc/classes/Reap/Package.src/M000057.html +84 -0
  83. data/web/rdoc/classes/Reap/Package.src/M000058.html +61 -0
  84. data/web/rdoc/classes/Reap/Perm.html +236 -0
  85. data/web/rdoc/classes/Reap/Perm.src/M000078.html +18 -0
  86. data/web/rdoc/classes/Reap/Perm.src/M000079.html +21 -0
  87. data/web/rdoc/classes/Reap/Perm.src/M000080.html +42 -0
  88. data/web/rdoc/classes/Reap/Perm.src/M000081.html +26 -0
  89. data/web/rdoc/classes/Reap/Perm.src/M000082.html +18 -0
  90. data/web/rdoc/classes/Reap/Publish.html +213 -0
  91. data/web/rdoc/classes/Reap/Publish.src/M000070.html +18 -0
  92. data/web/rdoc/classes/Reap/Publish.src/M000071.html +22 -0
  93. data/web/rdoc/classes/Reap/Publish.src/M000072.html +37 -0
  94. data/web/rdoc/classes/Reap/RDoc.html +218 -0
  95. data/web/rdoc/classes/Reap/RDoc.src/M000059.html +18 -0
  96. data/web/rdoc/classes/Reap/RDoc.src/M000060.html +24 -0
  97. data/web/rdoc/classes/Reap/RDoc.src/M000061.html +70 -0
  98. data/web/rdoc/classes/Reap/Task.html +396 -0
  99. data/web/rdoc/classes/Reap/Task.src/M000039.html +18 -0
  100. data/web/rdoc/classes/Reap/Task.src/M000040.html +16 -0
  101. data/web/rdoc/classes/Reap/Task.src/M000041.html +16 -0
  102. data/web/rdoc/classes/Reap/Task.src/M000042.html +16 -0
  103. data/web/rdoc/classes/Reap/Task.src/M000043.html +16 -0
  104. data/web/rdoc/classes/Reap/Task.src/M000044.html +22 -0
  105. data/web/rdoc/classes/Reap/Task.src/M000045.html +16 -0
  106. data/web/rdoc/classes/Reap/Task.src/M000046.html +16 -0
  107. data/web/rdoc/classes/Reap/Task.src/M000047.html +16 -0
  108. data/web/rdoc/classes/Reap/Task.src/M000048.html +16 -0
  109. data/web/rdoc/classes/Reap/Task.src/M000049.html +16 -0
  110. data/web/rdoc/classes/Reap/Task.src/M000050.html +27 -0
  111. data/web/rdoc/classes/Reap/Task.src/M000051.html +19 -0
  112. data/web/rdoc/classes/Reap/Task.src/M000052.html +18 -0
  113. data/web/rdoc/classes/Reap/Task.src/M000053.html +18 -0
  114. data/web/rdoc/classes/Reap/Task.src/M000054.html +19 -0
  115. data/web/rdoc/classes/Reap/Test.html +253 -0
  116. data/web/rdoc/classes/Reap/Test.src/M000062.html +18 -0
  117. data/web/rdoc/classes/Reap/Test.src/M000063.html +26 -0
  118. data/web/rdoc/classes/Reap/Test.src/M000064.html +77 -0
  119. data/web/rdoc/classes/Reap/Test.src/M000065.html +27 -0
  120. data/web/rdoc/classes/Reap/Test.src/M000066.html +50 -0
  121. data/web/rdoc/classes/Reap/Test/TestResults.html +205 -0
  122. data/web/rdoc/classes/Reap/Test/TestResults.src/M000067.html +21 -0
  123. data/web/rdoc/classes/Reap/Test/TestResults.src/M000068.html +21 -0
  124. data/web/rdoc/classes/Reap/Test/TestResults.src/M000069.html +23 -0
  125. data/web/rdoc/classes/Reap/TestExt.html +234 -0
  126. data/web/rdoc/classes/Reap/TestExt.src/M000073.html +18 -0
  127. data/web/rdoc/classes/Reap/TestExt.src/M000074.html +20 -0
  128. data/web/rdoc/classes/Reap/TestExt.src/M000075.html +49 -0
  129. data/web/rdoc/classes/Reap/TestExt.src/M000076.html +34 -0
  130. data/web/rdoc/classes/Reap/TestExt.src/M000077.html +27 -0
  131. data/web/rdoc/classes/Reap/WebPublish.html +213 -0
  132. data/web/rdoc/classes/Reap/WebPublish.src/M000083.html +18 -0
  133. data/web/rdoc/classes/Reap/WebPublish.src/M000084.html +21 -0
  134. data/web/rdoc/classes/Reap/WebPublish.src/M000085.html +32 -0
  135. data/web/rdoc/classes/ReapCommand.html +425 -0
  136. data/web/rdoc/classes/ReapCommand.src/M000001.html +16 -0
  137. data/web/rdoc/classes/ReapCommand.src/M000003.html +16 -0
  138. data/web/rdoc/classes/ReapCommand.src/M000005.html +16 -0
  139. data/web/rdoc/classes/ReapCommand.src/M000007.html +16 -0
  140. data/web/rdoc/classes/ReapCommand.src/M000009.html +16 -0
  141. data/web/rdoc/classes/ReapCommand.src/M000011.html +16 -0
  142. data/web/rdoc/classes/ReapCommand.src/M000013.html +18 -0
  143. data/web/rdoc/classes/ReapCommand.src/M000014.html +19 -0
  144. data/web/rdoc/classes/ReapCommand.src/M000015.html +19 -0
  145. data/web/rdoc/classes/ReapCommand.src/M000016.html +24 -0
  146. data/web/rdoc/classes/ReapCommand.src/M000018.html +29 -0
  147. data/web/rdoc/classes/Scaffold.html +211 -0
  148. data/web/rdoc/classes/Scaffold.src/M000086.html +16 -0
  149. data/web/rdoc/classes/Scaffold.src/M000087.html +28 -0
  150. data/web/rdoc/classes/Scaffold.src/M000088.html +32 -0
  151. data/web/rdoc/classes/Scaffold.src/M000089.html +18 -0
  152. data/web/rdoc/classes/UnitTestKernel.html +176 -0
  153. data/web/rdoc/classes/UnitTestKernel.src/M000019.html +18 -0
  154. data/web/rdoc/classes/UnitTestKernel.src/M000020.html +18 -0
  155. data/web/rdoc/classes/UnitTestKernel.src/M000021.html +22 -0
  156. data/web/rdoc/classes/UnitTestKernel.src/M000022.html +22 -0
  157. data/web/rdoc/classes/UnitTesting.html +165 -0
  158. data/web/rdoc/classes/UnitTesting.src/M000090.html +34 -0
  159. data/web/rdoc/classes/UnitTesting.src/M000091.html +18 -0
  160. data/web/rdoc/classes/UnitTesting/Failure.html +156 -0
  161. data/web/rdoc/classes/UnitTesting/Failure.src/M000092.html +18 -0
  162. data/web/rdoc/classes/UnitTesting/Failure.src/M000093.html +21 -0
  163. data/web/rdoc/created.rid +1 -0
  164. data/web/rdoc/files/ANN.html +107 -0
  165. data/web/rdoc/files/COPYING.html +119 -0
  166. data/web/rdoc/files/ChangeLog.html +144 -0
  167. data/web/rdoc/files/ProjectInfo.html +190 -0
  168. data/web/rdoc/files/README.html +274 -0
  169. data/web/rdoc/files/Rakefile.html +101 -0
  170. data/web/rdoc/files/lib/reap/bin/reap_rb.html +129 -0
  171. data/web/rdoc/files/lib/reap/lint_rb.html +101 -0
  172. data/web/rdoc/files/lib/reap/projectinfo_rb.html +110 -0
  173. data/web/rdoc/files/lib/reap/readymade_rb.html +123 -0
  174. data/web/rdoc/files/lib/reap/task/announce_rb.html +114 -0
  175. data/web/rdoc/files/lib/reap/task/fileperm_rb.html +108 -0
  176. data/web/rdoc/files/lib/reap/task/info_rb.html +108 -0
  177. data/web/rdoc/files/lib/reap/task/install_rb.html +108 -0
  178. data/web/rdoc/files/lib/reap/task/noop_rb.html +108 -0
  179. data/web/rdoc/files/lib/reap/task/package_rb.html +109 -0
  180. data/web/rdoc/files/lib/reap/task/publish_rb.html +108 -0
  181. data/web/rdoc/files/lib/reap/task/rdoc_rb.html +108 -0
  182. data/web/rdoc/files/lib/reap/task/scaffold_rb.html +107 -0
  183. data/web/rdoc/files/lib/reap/task/test_rb.html +110 -0
  184. data/web/rdoc/files/lib/reap/task/testext_rb.html +109 -0
  185. data/web/rdoc/files/lib/reap/task/webpublish_rb.html +108 -0
  186. data/web/rdoc/files/lib/reap/task_rb.html +120 -0
  187. data/web/rdoc/files/lib/reap/tasks_rb.html +116 -0
  188. data/web/rdoc/files/lib/reap/test_rb.html +109 -0
  189. data/web/rdoc/fr_class_index.html +47 -0
  190. data/web/rdoc/fr_file_index.html +51 -0
  191. data/web/rdoc/fr_method_index.html +124 -0
  192. data/web/rdoc/index.html +24 -0
  193. data/web/rdoc/rdoc-style.css +208 -0
  194. metadata +257 -138
  195. data/bin/rubytest +0 -5
  196. data/data/reap/scaffold/standard/COPYING +0 -403
  197. data/data/reap/scaffold/standard/INSTALL +0 -14
  198. data/data/reap/scaffold/standard/README +0 -3
  199. data/data/reap/scaffold/standard/Rakefile +0 -10
  200. data/data/reap/scaffold/standard/setup.rb +0 -1568
  201. data/data/reap/scaffold/subversion/trunk/COPYING +0 -403
  202. data/data/reap/scaffold/subversion/trunk/INSTALL +0 -14
  203. data/data/reap/scaffold/subversion/trunk/ProjectInfo +0 -78
  204. data/data/reap/scaffold/subversion/trunk/README +0 -3
  205. data/data/reap/scaffold/subversion/trunk/Rakefile +0 -10
  206. data/data/reap/scaffold/subversion/trunk/setup.rb +0 -1568
  207. data/data/reap/setup.rb +0 -1568
  208. data/doc/COPYING +0 -403
  209. data/doc/ChangeLog +0 -18
  210. data/doc/LATEST +0 -29
  211. data/doc/README +0 -182
  212. data/doc/doap.xml +0 -27
  213. data/doc/note/ProjectInfo.rb +0 -88
  214. data/doc/note/Rakefile.0 +0 -118
  215. data/doc/note/Rakefile.htm +0 -69
  216. data/doc/note/application.rb +0 -124
  217. data/doc/note/interface/rubyforge.rb +0 -247
  218. data/doc/note/intro.txt +0 -42
  219. data/doc/note/package.rb +0 -629
  220. data/doc/note/package.rb.0 +0 -394
  221. data/doc/note/scaffold.rb +0 -123
  222. data/lib/reap/app.rb +0 -74
  223. data/lib/reap/bin/rubylint.rb +0 -1
  224. data/lib/reap/bin/rubytest.rb +0 -45
  225. data/lib/reap/rake.rb +0 -12
  226. data/lib/reap/rakeadapter.rb +0 -50
  227. data/lib/reap/reap.rb +0 -32
  228. data/lib/reap/task/custom.rb +0 -12
  229. data/lib/reap/task/doap.rb +0 -85
  230. data/lib/reap/task/extest.rb +0 -161
  231. data/lib/reap/task/manifest.rb +0 -70
  232. data/lib/reap/task/release.rb +0 -512
  233. data/lib/reap/task/template.rb +0 -46
  234. data/lib/reap/vendor/http-access2.rb +0 -1590
  235. data/lib/reap/vendor/http-access2/cookie.rb +0 -538
  236. data/lib/reap/vendor/http-access2/http.rb +0 -542
@@ -1,40 +1,27 @@
1
1
 
2
- # NOTE This task needs work!
3
- # It needs to generalize more to give greater control
4
- # over which files get what permissions.
5
- # It also might be extended to do copyright tagging.
6
-
7
2
  require 'reap/task'
8
3
 
9
- # ___ _ _ _____ _
10
- # | _ \___ _ _ _ __ (_)_____(_)___ _ _ ___ |_ _|_ _ __| |__
11
- # | _/ -_) '_| ' \| (_-<_-< / _ \ ' \(_-< | |/ _` (_-< / /
12
- # |_| \___|_| |_|_|_|_/__/__/_\___/_||_/__/ |_|\__,_/__/_\_\
13
4
  #
14
-
15
- # = File Permissions Task
16
-
5
+ # File Permissions Task
6
+ #
17
7
  class Reap::Perm < Reap::Task
18
8
 
19
- task_desc "Normalize ownership and permissions of files."
20
-
21
- task_help %{
9
+ attr_accessor :user, :group, :filemod, :dirmod
22
10
 
23
- Normalizes file permissions.
11
+ section_required true
24
12
 
25
- user user name to use
26
- group group name to use
27
-
28
- }
13
+ def task_desc
14
+ "Normalize ownership and permissions of package files."
15
+ end
29
16
 
30
- task_attr :perm
17
+ def init
18
+ @user = section['user']
19
+ @group ||= @user
20
+ @filemod ||= 644
21
+ @dirmod ||= 755
22
+ end
31
23
 
32
24
  def run
33
-
34
- perm.group ||= perm.user
35
- perm.filemod ||= 644
36
- perm.dirmod ||= 755
37
-
38
25
  puts "Reap is shelling out work to chmod..."
39
26
 
40
27
  # misc
@@ -68,15 +55,11 @@ class Reap::Perm < Reap::Task
68
55
  dirs, files = file_list.partition{ |l| File.directory?(l) }
69
56
  unless files.empty?
70
57
  fstr = '"' + files.join('" "') + '"'
71
- #sh %{chmod #{file_mode} #{fstr}}
72
- tell %{chmod #{file_mode} #{fstr}}
73
- File.chmod( file_mode, fstr ) unless $PRETEND
58
+ sh %{chmod #{file_mode} #{fstr}}
74
59
  end
75
60
  unless dirs.empty?
76
61
  fstr = '"' + dirs.join('" "') + '"'
77
- #sh %{chmod #{dir_mode} #{fstr}}
78
- tell %{chmod #{dir_mode} #{fstr}}
79
- File.chmod( dir_mode, fstr ) unless $PRETEND
62
+ sh %{chmod #{dir_mode} #{fstr}}
80
63
  end
81
64
  end
82
65
 
@@ -96,17 +79,4 @@ class Reap::Perm < Reap::Task
96
79
 
97
80
  end
98
81
 
99
-
100
- # Rake interface.
101
-
102
- if defined?(Rake)
103
-
104
- #require 'reap/rake/adapter'
105
-
106
- module Rake
107
- ReapPerm = ::Reap::RakeAdapter( ::Reap::Perm )
108
- end
109
-
110
- end
111
-
112
-
82
+ #Reap.register( Reap::Perm )
@@ -1,46 +1,20 @@
1
1
 
2
2
  require 'reap/task'
3
3
 
4
- # ___ __ _____ _
5
- # |_ _|_ _ / _|___ |_ _|_ _ __| |__
6
- # | || ' \| _/ _ \ | |/ _` (_-< / /
7
- # |___|_||_|_| \___/ |_|\__,_/__/_\_\
8
4
  #
9
-
10
- # = Info Task
5
+ # Info Task - Displays the ProjectInfo file.
11
6
  #
12
- # Displays the ProjectInfo file.
13
-
14
7
  class Reap::Info < Reap::Task
15
8
 
16
- task_desc "Display ProjectInfo file."
17
-
18
- task_help %{
19
-
20
- reap info
21
-
22
- Display ProjectInfo file.
23
-
24
- }
25
-
26
- task_available { |app| app.projectfile? }
27
-
28
- def run
29
- puts ProjectInfo.instance.info_stream
9
+ def task_desc
10
+ "Display ProjectInfo file."
30
11
  end
31
12
 
32
- end
33
-
34
-
35
- # Rake interface.
36
-
37
- if defined?(Rake)
38
-
39
- #require 'reap/rake/adapter'
13
+ def init
14
+ end
40
15
 
41
- module Rake
42
- ReapInfo = ::Reap::RakeAdapter( ::Reap::Info )
16
+ def run
17
+ puts ProjectInfo.info_stream
43
18
  end
44
19
 
45
20
  end
46
-
@@ -1,68 +1,33 @@
1
- #!/usr/bin/env ruby
2
1
 
3
2
  require 'reap/task'
4
3
 
5
- # ___ _ _ _ _____ _
6
- # |_ _|_ __ ___| |_ __ _| | | |_ _|_ _ ___| | __
7
- # | || '_ \/ __| __/ _` | | | | |/ _` / __| |/ /
8
- # | || | | \__ \ || (_| | | | | | (_| \__ \ <
9
- # |___|_| |_|___/\__\__,_|_|_| |_|\__,_|___/_|\_\
10
4
  #
11
-
5
+ # Install Task
6
+ #
12
7
  class Reap::Install < Reap::Task
13
8
 
14
- task_desc "Locally install package using built-in setup.rb."
15
-
16
- task_help %{
17
-
18
- reap install
19
-
20
- This task manually installs a project using setup.rb.
21
- If setup.rb doesn't exist it will be created.
22
-
23
- }
24
-
25
- task_attr :ins
26
-
27
- def run
28
-
29
- ins.options ||= []
30
-
31
- #exe = %w{ setup.rb install.rb }.find{ |f| File.exists?(f) }
32
- #raise "setup.rb or install.rb not found" if exe == nil
33
-
34
- unless provide_setup_rb
35
- puts "Setup.rb is missing. Forced to skip debian package creation."
36
- return nil
37
- end
38
-
39
- puts "Reap is shelling out work to setup.rb..."
40
-
41
- #--
42
- # SHELL OUT! This will be fixed with swtich to package.rb instead of setup.rb.
43
- #++
44
-
45
- exe = %{ruby setup.rb}
46
- exe << ' -q ' unless $VERBOSE
47
- exe << ins.options.join(' ')
48
- exe << ' all'
49
- sh exe
50
-
51
- puts "Setup complete!"
9
+ def task_desc
10
+ "Locally install package using setup.rb or install.rb."
52
11
  end
53
12
 
54
- end
13
+ attr_accessor :options, :quiet #, :sudo
55
14
 
15
+ def init
16
+ @quiet ||= !$VERBOSE
17
+ @options ||= []
18
+ #@sudo ||= true
19
+ end
56
20
 
57
- # Rake interface.
21
+ def run
22
+ exe = %w{ setup.rb install.rb }.find{ |f| File.exists?(f) }
23
+ raise "setup.rb or install.rb not found" if exe == nil
58
24
 
59
- if defined?(Rake)
25
+ puts "Reap is shelling out work to #{exe}..."
60
26
 
61
- #require 'reap/rake/adapter'
27
+ options << '-q' if @quiet
62
28
 
63
- module Rake
64
- ReapInstall = ::Reap::RakeAdapter( ::Reap::Install )
29
+ c = "sudo ruby #{exe} #{options.join(' ')}"
30
+ sh c
65
31
  end
66
32
 
67
33
  end
68
-
@@ -1,7 +1,7 @@
1
- #!/usr/bin/env ruby
2
1
 
3
2
  require 'reap/task'
4
3
 
4
+ #
5
5
  # Noop Task
6
6
  #
7
7
  # This task doesn't do anything except
@@ -10,12 +10,17 @@ require 'reap/task'
10
10
  #
11
11
  class Reap::Noop < Reap::Task
12
12
 
13
- task_desc "A no-op task to help debug reap itself."
13
+ def task_desc
14
+ "A no-op task to help debug reap itself."
15
+ end
16
+
17
+ attr_accessor :message
14
18
 
15
- task_attr :msg
19
+ def init
20
+ end
16
21
 
17
22
  def run
18
- puts ( msg.message || 'No message field in noop section.' )
23
+ puts ( message || 'No message field in noop section.' )
19
24
  end
20
25
 
21
26
  end
@@ -1,173 +1,110 @@
1
1
 
2
2
  require 'reap/task'
3
3
 
4
- # ___ _ _____ _
5
- # | _ \__ _ __| |____ _ __ _ ___ |_ _|_ _ __| |__
6
- # | _/ _` / _| / / _` / _` / -_) | |/ _` (_-< / /
7
- # |_| \__,_\__|_\_\__,_\__, \___| |_|\__,_/__/_\_\
8
- # |___/
4
+ begin
5
+ require 'rubygems'
6
+ rescue
7
+ # no rubygems
8
+ end
9
9
 
10
- # = Package Task
10
+ ##
11
+ # Package Task
11
12
  #
12
13
  # This task creates standard .zip, .tgz, or .tbz
13
- # packages, plus .gem or .deb distributions.
14
-
15
-
14
+ # packages, plus .gem distributions.
15
+ #
16
16
  class Reap::Package < Reap::Task
17
17
 
18
- MUST_EXCLUDE = [ 'InstalledFiles', '**/CVS/**/*', '**/*~', 'dist', 'pkg' ]
19
- LOCATIONS = [ 'dist', 'pkg', '../packages', '../dist', '../pkg' ]
20
-
21
- #section_required true
22
-
23
- # Task line description
24
-
25
- task_desc "Create distribution packages."
26
- # if master.package
27
- # disttypes = master.package.distribute || master.distribute || [ 'gem', 'tar.bz2', 'zip' ]
28
- # else
29
- # disttypes = master.distribute || [ 'gem', 'tar.bz2', 'zip' ]
30
- # end
31
- # "Build distribution packages (#{disttypes.join(', ')})."
32
- # end
33
-
34
- # Help information
35
-
36
- task_help %{
37
-
38
- reap package
39
-
40
- Builds distribution packages. The package task supports
41
- tar.gz, tar.bz2, zip source packages and gem, pacman and
42
- debian ditribution packages.
43
-
44
- dir Directory in which to store distributions.
45
- include Files to include in distribution.
46
- exclude Files to exclude from those.
47
- distribute Distribution types.
48
- tgz, tar.gz, tbz, tar.bz2, zip
49
- gem, deb, pac
50
- project Project name.
51
- category Software category.
52
- architecture Can be any, i368, i686, ppc, etc.
53
- dependencies List of packages this program depends.
54
- recommends List of packages that can be used with this package.
55
- replaces List of packages this one replaces.
56
- executables Executable files in this distribution.
57
- source URL of source package (typically a tar.gz file).
58
- md5 MD% checksum of source file.
59
-
60
- These are RubyGems specific.
61
- autorequire
62
- platform
63
- require_paths
18
+ attr_accessor :dir, :name, :date, :series, :status,
19
+ :author, :email, :summary, :project, :homepage,
20
+ :exclude, :types, :platform, :autorequire,
21
+ :dependencies, :requirements, :executables
64
22
 
65
- The package task also has subsection for each type of distribution.
66
- These can be used to override settings in the package information
67
- if they in some way differ. Possible subsections are:
23
+ attr_reader :package_name, :include
68
24
 
69
- gems
70
- pacman
71
- debian
25
+ MUST_EXCLUDE = [ 'InstalledFiles', '**/CVS/**/*', '**/*~' ]
72
26
 
73
- }
74
-
75
- # Alternate for task properties accessor.
27
+ def task_desc
28
+ "Build distribution packages (#{(types||[]).join(', ')})."
29
+ end
76
30
 
77
- task_attr :pkg
31
+ def init
32
+ @dir ||= ( File.directory?('../leaf') ? '../leaf' : 'pkg')
78
33
 
79
- def run
34
+ @name ||= master['name']
35
+ @status ||= master['status'] || 'beta/stable'
36
+ @date ||= master['date'] || Time.now.strftime("%Y-%m-%d")
80
37
 
81
- # load rubygems if available
82
- # (only do this if need be in future?)
38
+ @series ||= master['series']
39
+ @version ||= master['version']
83
40
 
84
- begin
85
- require 'rubygems'
86
- rescue LoadError
87
- # no rubygems
41
+ unless @series || @version
42
+ puts "Series or Version is a required field."
43
+ exit 0
88
44
  end
89
45
 
90
- # setup package defaults
91
-
92
- # Do not look in master information for this
93
- pkg.dir = section.dir || LOCATIONS.find { |f| File.directory?(f) } || 'dist'
94
-
95
- pkg.status ||= 'beta/stable'
96
- pkg.date ||= Time.now.strftime("%Y-%m-%d")
97
- pkg.series ||= '1'
98
- pkg.author ||= "Anonymous"
99
- pkg.maintainer ||= pkg.author
100
- pkg.email ||= ""
101
- pkg.summary ||= ""
102
- pkg.architecture ||= 'any'
103
- pkg.license ||= 'Ruby/GPL'
104
- pkg.project ||= master.rubyforge.project
105
- pkg.homepage ||= master.rubyforge.homepage
106
-
107
- d = pkg.date.split('-').collect{ |e| e.to_i }
108
- #d[0] = d[0] - 2000 # No need to keep the 2000
109
- pkg.version ||= d.join('.')
110
-
111
- if $BUILD_VERSION
112
- pkg.buildno = Time.now.strftime("%H*60+%M")
113
- pkg.version += ".#{pkg.buildno}"
46
+ if @version
47
+ @package_name ||= @name + '-' + @version
48
+ else
49
+ @package_name ||= @name + ',' + @date
114
50
  end
115
51
 
116
- pkg.package_name ||= "#{pkg.name}-#{pkg.version}"
117
-
118
- pkg.exclude ||= []
119
- pkg.exclude |= MUST_EXCLUDE
120
-
121
- pkg.include ||= ['**/*']
52
+ @author ||= master['author']
53
+ @email ||= master['email']
54
+ @summary ||= master['summary']
55
+ @project ||= master['rubyforge']['project']
56
+ @homepage ||= master['homepage'] || master['rubyforge']['homepage']
122
57
 
123
- # distribute types include 'tgz', 'tbz', 'zip', 'tar.gz' 'tar.bz2', 'gem', 'pac' and 'deb'.
58
+ @exclude ||= []
59
+ @exclude |= MUST_EXCLUDE
124
60
 
125
- pkg.distribute ||= [ 'gem', 'tar.bz2', 'zip' ]
126
- pkg.distribute = [pkg.distribute].flatten.collect { |t| t.to_s.strip.downcase }
61
+ # types include 'tgz', 'tbz', 'zip', 'tar.gz' 'tar.bz2' and 'gem'.
62
+ @types ||= master['distribute'] || [ 'gem', 'tar.gz', 'zip' ]
63
+ @types.collect! { |t| t.to_s.strip.downcase }
127
64
 
128
- pkg.dependencies ||= []
129
- pkg.executables ||= []
130
- pkg.requirements ||= []
131
- pkg.recommends ||= []
132
- pkg.conflicts ||= []
133
- pkg.replaces ||= []
65
+ # not setable
66
+ @include ||= ['**/*']
134
67
 
135
- # Gem specific properties
136
-
137
- if defined?(::Gem) and pkg.gem
138
- if pkg.gem.platform
68
+ # gem specific (at least in this context)
69
+ if defined?(Gem)
70
+ if @platform
139
71
  begin
140
- pkg.gem.platform = ::Gem::Platform.const_get(pkg.gem.platform.upcase)
72
+ @gem_platform = ::Gem.const_get(@platform)
141
73
  rescue NameError
142
- pkg.gem.platform = ::Gem::Platform::RUBY
74
+ @platform = nil
143
75
  end
144
- else
145
- pkg.gem.platform = ::Gem::Platform::RUBY
146
76
  end
77
+ @platform = ::Gem::Platform::RUBY unless @plaform
147
78
  #@autorequire
79
+ @requirements ||= master['requirements'] || []
80
+ @dependencies ||= master['dependencies'] || []
81
+ @executables ||= master['executables'] || []
148
82
  end
83
+ end
149
84
 
150
- # package it up
151
-
152
- group_dir_path = File.join( pkg.dir, pkg.package_name )
153
- package_dir_path = File.join( pkg.dir, pkg.package_name, pkg.package_name )
154
-
155
- if FileTest.directory?(group_dir_path)
156
- if $FORCE
157
- puts "Removing old directory '#{File.expand_path(group_dir_path)}'..."
158
- FileUtils.rm_r(group_dir_path)
85
+ def run
86
+ # create package image
87
+ package_dir_path = "#{@dir}/#{@package_name}"
88
+
89
+ if FileTest.directory?(package_dir_path)
90
+ print "Package '#{package_name}' already exists. Clobber? [y/N] "
91
+ until inp = $stdin.gets[0,1] ; sleep 1 ; end
92
+ if (inp || 'y').downcase == 'y'
93
+ puts "Removing old directory '#{File.expand_path(package_dir_path)}'..."
94
+ FileUtils.rm_r(package_dir_path)
95
+ #FileUtils.rm("#{package_dir_path}/*")
96
+ #trash_dir = ".trash/#{File.basename(@dir)}"
97
+ #FileUtils.mkdir_p(".trash") unless FileTest.directory?(".trash")
98
+ #FileUtils.mv(@dir, trash_dir)
159
99
  else
160
- puts "Package directory '#{pkg.package_name}' already exists. Use -f option to overwrite."
161
- return nil
100
+ puts "Reap package task canceled."
101
+ exit 0
162
102
  end
163
103
  end
164
-
165
- puts "Creating #{pkg.distribute.join(',')} packages..."
166
-
167
104
  package_files = FileList.new
168
- package_files.include(*pkg.include)
169
- package_files.exclude(*pkg.exclude) if pkg.exclude and not pkg.exclude.empty?
170
- FileUtils.mkdir_p pkg.dir #rescue nil
105
+ package_files.include(*@include)
106
+ package_files.exclude(*@exclude) if @exclude and not @exclude.empty?
107
+ FileUtils.mkdir_p @dir #rescue nil
171
108
  package_files.each do |f|
172
109
  pkgf = File.join(package_dir_path, f)
173
110
  fdir = File.dirname(pkgf)
@@ -181,8 +118,8 @@ class Reap::Package < Reap::Task
181
118
  end
182
119
 
183
120
  # create standard package files
184
- FileUtils.chdir( File.join( pkg.dir, pkg.package_name ) ) do
185
- pkg.distribute.each do |t|
121
+ FileUtils.chdir(@dir) do
122
+ @types.each do |t|
186
123
  sh_cmd = nil
187
124
  prefix = 'ERROR' # in case of unforseen bug
188
125
  case t
@@ -198,63 +135,37 @@ class Reap::Package < Reap::Task
198
135
  prefix = 'zip'
199
136
  sh_cmd = 'zip -r'
200
137
  puts "\nReap is shelling out work to zip..."
201
- when 'gem', 'deb', 'pac'
138
+ when 'gem'
202
139
  sh_cmd = nil
203
140
  else
204
141
  puts "Unknown package type '#{t}' skipped."
205
142
  sh_cmd = nil
206
143
  end
207
- sh %{#{sh_cmd} #{pkg.package_name}.#{prefix} #{pkg.package_name}} if sh_cmd
144
+ sh %{#{sh_cmd} #{@package_name}.#{prefix} #{@package_name}} if sh_cmd
208
145
  end
209
146
  puts
210
147
  end
211
148
 
212
149
  # create gem package
213
-
214
- if pkg.distribute.include?('gem')
215
- if defined?(::Gem)
216
- run_gem
217
- else
218
- tell "Package .gem requested, but rubygems not found (skipped)."
219
- end
220
- end
221
-
222
- # create debian package
223
-
224
- if pkg.distribute.include?('deb')
225
- if true # TODO ensure required debian tools here
226
- run_deb
227
- else
228
- tell "Package .deb requested, but debian tools not found (skipped)."
229
- end
230
- end
231
-
232
- # create PKGBUILD (pacman, archlinux)
233
-
234
- if pkg.distribute.include?('pac')
235
- if true # TODO ensure required tools here
236
- run_pacman
237
- else
238
- tell "Pacman package requested, but required tools not found (skipped)."
239
- end
240
- end
150
+ run_gem if defined?(Gem) and @types.include?('gem')
241
151
 
242
152
  return true
243
153
  end
244
154
 
245
- private
246
-
247
- # This builds the gem package.
248
-
249
155
  def run_gem
250
-
251
- use_subsection :gems
252
-
253
156
  spec = Gem::Specification.new { |s|
254
- s.name = pkg.name
255
- s.version = pkg.version
256
157
 
257
- pkg.dependencies.each { |d,v|
158
+ s.name = @name
159
+
160
+ if @version
161
+ s.version = @version
162
+ else
163
+ d = @date.split('-').collect{ |e| e.to_i }
164
+ d[0] = d[0] - 2000
165
+ s.version = d.join('.')
166
+ end
167
+
168
+ @dependencies.each{ |d,v|
258
169
  if v
259
170
  s.add_dependency(d, v)
260
171
  else
@@ -262,189 +173,32 @@ private
262
173
  end
263
174
  }
264
175
 
265
- s.summary = pkg.summary
266
- s.requirements = pkg.requirements
176
+ s.platform = @platform
177
+ s.summary = @summary
178
+ s.requirements = @requirements
267
179
 
268
180
  # s.files = Dir.glob("lib/**/*").delete_if {|item| item.include?("CVS")}
269
181
  # s.files.concat Dir.glob("bin/**/*").delete_if {|item| item.include?("CVS")}
270
182
  package_files = FileList.new
271
- package_files.include(*pkg.include)
272
- package_files.exclude(*pkg.exclude) if pkg.exclude and not pkg.exclude.empty?
183
+ package_files.include(*@include)
184
+ package_files.exclude(*@exclude) if @exclude and not @exclude.empty?
273
185
  s.files = package_files.to_a
274
186
 
275
- s.author = pkg.author
276
- s.email = pkg.email
277
- s.rubyforge_project = pkg.project
278
- s.homepage = pkg.homepage
279
-
280
187
  s.require_path = 'lib'
281
- s.require_paths = pkg.require_paths if pkg.require_paths
282
-
283
- s.autorequire = pkg.autorequire if pkg.autorequire
284
- s.platform = pkg.platform
285
-
286
- s.executables = pkg.executables
188
+ s.autorequire = @autorequire if @autorequire
189
+ s.author = @author
190
+ s.email = @email
191
+ s.rubyforge_project = @project
192
+ s.homepage = @homepage
193
+ s.executables = @executables
287
194
  s.bindir = "bin"
288
195
 
289
- s.has_rdoc = true
290
196
  }
291
197
 
292
- tell "Reap is shelling out work to the Gem Package Manager..."
198
+ puts "Reap is shelling out work to the Gem Package Manager..."
293
199
  Gem.manage_gems
294
200
  Gem::Builder.new(spec).build
295
- gems = Dir.glob( './*.gem' )
296
- gems.each{ |f|
297
- FileUtils.mv( f, File.join( pkg.dir, pkg.package_name ) )
298
- }
299
- puts
300
- end
301
-
302
-
303
- # This build the Debiam package.
304
-
305
- def run_deb
306
-
307
- use_subsection :debian
308
-
309
- # build the debian control file
310
-
311
- dep = pkg.dependencies.collect{ |d, v|
312
- if v
313
- "#{d} (#{v})"
314
- else
315
- d
316
- end
317
- }.join(', ')
318
-
319
- # Some debian fields not yet used:
320
- # Installed-Size: 1024
321
- # Replaces: sam-sheepdog
322
- # Pre-Depends: perl, ...
323
- # Suggests: docbook
324
-
325
- arch = pkg.architecture.downcase
326
- arch = (arch == 'any' ? 'all' : arch)
327
-
328
- ctrl = %{
329
- Package: #{pkg.name}
330
- Version: #{pkg.version}
331
- Priority: optional
332
- Architecture: #{arch}
333
- Essential: no
334
- }.tabto(0)
335
- ctrl << "Section: #{pkg.category}\n" if pkg.category
336
- ctrl << "Depends: #{dep}\n" unless dep.empty?
337
- ctrl << "Recommends: #{pkg.recommends.join(' | ')}\n" unless pkg.recommends.empty?
338
- ctrl << "Conflicts: #{pkg.conflicts.join(', ')}\n" unless pkg.conflicts.empty?
339
- ctrl << "Maintainer: #{pkg.maintainer} <#{pkg.email}>\n"
340
- ctrl << "Provides: #{pkg.name}\n"
341
- ctrl << "Description: #{pkg.summary}\n"
342
- ctrl << " #{pkg.description}\n"
343
-
344
- if arch == 'all'
345
- debname = "#{pkg.name}-ruby_#{pkg.version}.deb"
346
- else
347
- debname = "#{pkg.name}-ruby_#{pkg.version}_#{pkg.architecture}.deb"
348
- end
349
- pkgdir = File.join( pkg.dir, pkg.package_name )
350
- debdir = File.join( pkgdir, 'debian' )
351
-
352
- #debdebdir = File.join( debdir, 'DEBIAN' )
353
- debfile = File.join( pkgdir, debname )
354
-
355
- unless provide_setup_rb
356
- puts "Setup.rb is missing. Forced to skip debian package creation."
357
- return nil
358
- end
359
-
360
- puts "Reap is shelling out work to the deb-pkg..."
361
-
362
- cmd = %{ruby setup.rb }
363
- cmd << '-q ' unless $VERBOSE
364
- cmd << %{all --installdirs=std --root=#{debdir}}
365
-
366
- FileUtils.mkdir_p(debdir)
367
- sh cmd
368
-
369
- FileUtils.mkdir_p( File.join(debdir, 'DEBIAN') )
370
- File.open( File.join(debdir, 'DEBIAN', 'control'), 'w') { |f| f << ctrl }
371
-
372
- sh %{dpkg-deb -b #{debdir} #{debfile}}
373
- puts
374
- end
375
-
376
- # This builds a pacman (archlinux) PKGBUILD script.
377
-
378
- def run_pacman
379
-
380
- use_subsection :pacman
381
-
382
- unless @source
383
- tell "URL 'source' is require for proto package."
384
- return nil
385
- end
386
-
387
- _dep = pkg.dependencies.collect{ |d| "'#{d}'" }.join(' ')
388
- _rep = pkg.replaces.collect{ |d| "'#{d}'" }.join(' ')
389
- _con = pkg.conflicts.collect{ |d| "'#{d}'" }.join(' ')
390
-
391
- proto = %{
392
- pkgname=#{pkg.name}
393
- pkgver=#{pkg.version}
394
- pkgrel=#{pkg.series}
395
- pkgdesc="#{pkg.summary}"
396
- url="#{pkg.homepage}"
397
- license="#{pkg.license}"
398
- depends=(#{_dep})
399
- conflicts=(#{_con})
400
- replaces=(#{_rep})
401
- source=(#{pkg.source})
402
- md5sums=(#{pkg.md5})
403
- }.tabto(0)
404
-
405
- # What are these for?
406
- # install=
407
- # backup=()
408
-
409
- if pkg.usemake
410
- s << %{
411
- makedepends=()"
412
- build() {
413
- cd $startdir/src/$pkgname-$pkgver
414
- ./ruby setup.rb --prefix=/usr
415
- make || return 1
416
- make DESTDIR=$startdir/pkg install
417
- }
418
- }.tabto(0)
419
- else
420
- s << %{
421
- build() {
422
- cd $startdir/src/$pkgname-$pkgver
423
- ./ruby setup.rb --prefix=/usr
424
- }
425
- }
426
- end
427
-
428
- pacdir = File.join( pkg.dir, pkg.package_name, 'pacman' )
429
- pacpacdir = File.join( pacdir, 'PACMAN' )
430
- pacfile = File.join( pacdir, 'PKGBUILD' )
431
-
432
- tell "Reap is shelling out work to the pacman..."
433
- FileUtils.mkdir_p(pacdir)
434
- File.open( pacfile, 'w') { |f| f << proto }
435
- puts
436
- end
437
-
438
- end
439
-
440
-
441
- # Rake interface.
442
-
443
- if defined?(Rake)
444
-
445
- module Rake
446
- ReapPackage = ::Reap::RakeAdapter( ::Reap::Package )
201
+ sh %{mv ./*.gem #{@dir}/}
447
202
  end
448
203
 
449
204
  end
450
-