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,175 +1,49 @@
1
- #!/usr/bin/env ruby
2
1
 
3
2
  require 'reap/task'
4
- require 'shellwords'
5
3
 
6
- # ___ _ _ _ _ _____ _
7
- # | _ \_ _| |__| (_)__| |_ |_ _|_ _ __| |__
8
- # | _/ || | '_ \ | (_-< ' \ | |/ _` (_-< / /
9
- # |_| \_,_|_.__/_|_/__/_||_| |_|\__,_/__/_\_\
10
4
  #
11
-
12
- # = Publish Task
13
-
5
+ # Publish Task
6
+ #
14
7
  class Reap::Publish < Reap::Task
15
8
 
16
- task_desc "Publish documents to the web or host."
17
-
18
- task_help %{
19
-
20
- reap publish
21
-
22
- Publish documents to hosting service. Three means of
23
- publishing are current supported, ftp uploading, scp,
24
- and web convenience option that recognizes particular
25
- hosts (only RubyForge is currently supported).
26
-
27
- type Type of publishing, 'web', 'scp' or 'ftp'.
28
- host Host server, default is 'rubyforge.org'
29
- username Username for host.
30
- dir Directory of files to publish. Or,
31
- copy Files to publish using from and to.
32
- project Project name (used for Rubyforge)
33
-
34
- If the type is 'scp' or 'ftp' you will also need to provide
35
- the root directory parameter.
36
-
37
- root Document root directory at host.
38
-
39
- The dir parameter allows you to simply specify a local
40
- directory, the contents of which will be published to
41
- host's document root location (directory tree intact).
42
-
43
- If you need more control over which files to publish
44
- where, you can use the copy parameter instead. Provide
45
- an array of pattern strings in the form of "{from} {to}".
46
- If the desitination is the host's document root you do
47
- not need to specify the {to} part. For example:
48
-
49
- copy: [ 'web/*', 'doc/api/* doc/api' ]
50
-
51
- The first copies the files under your project's web directory
52
- to the host's document root. The second copies your projects
53
- doc/api files to the doc/api location on the host.
54
-
55
- When using the 'scp' type the internal template used for
56
- the outbound destination is 'username@host:root/'.
57
-
58
- }
59
-
60
- #attr_accessor :host, :type, :dir, :project, :username
61
- #attr_accessor :exclude # not using yet
62
-
63
- task_attr :pub
64
-
65
- # Run the publishing task.
66
-
67
- def run( target=nil, copy_from=nil, copy_to=nil )
68
-
69
- return nil if target and target != pub.target
70
-
71
- # setup
72
-
73
- pub.type ||= 'web'
74
- pub.host ||= 'rubyforge.org'
75
- pub.root ||= 'var/www/gforge-projects/'
76
- pub.project ||= master.rubyforge.project || master.name
77
- pub.username ||= master.rubyforge.username
78
- pub.copy ||= [ "#{pub.dir}/*" ]
79
-
80
- if copy_from
81
- pub.copy = [ "#{copy_from} #{copy_to}".strip ]
82
- end
83
-
84
- # validate
9
+ section_required true
85
10
 
86
- unless pub.project
87
- puts "Project not specified." ; return nil
88
- end
89
-
90
- unless pub.username
91
- puts "Username not specified." ; return nil
92
- end
11
+ def task_desc
12
+ "Publish documents to the web."
13
+ end
93
14
 
94
- # publish
15
+ attr_accessor :host, :type, :dir, :project, :username
16
+ attr_accessor :exclude # not using yet
95
17
 
96
- puts "Reap is passing off publishing work..."
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
97
25
 
98
- case pub.type
26
+ def run
27
+ cmd = ''; skip = false
99
28
 
100
- when 'web', 'www'
101
- case pub.host
102
- when 'rubyforge', 'rubyforge.org'
103
- pub.host = "rubyforge.org"
104
- pub.root = "/var/www/gforge-projects/#{pub.project}"
105
- run_scp
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}/}
106
34
  else
107
- puts %{Unrecognized publishing host '#{pub.host}'. Skipped.}
108
- return nil
35
+ puts %{Unrecognized publishing kind '#{@type}' for host '#{@host}'. Skipped.}
36
+ skip = true
109
37
  end
110
-
111
- when 'scp'
112
- run_scp
113
-
114
- when 'ftp'
115
- run_ftp
116
-
117
38
  else
118
- puts %{Unrecognized publishing type '#{pub.type}'. Skipped.}
119
- return nil
39
+ puts %{Unrecognized publishing host '#{@host}'. Skipped.}
40
+ skip = true
120
41
  end
121
42
 
122
- end
123
-
124
- private
125
-
126
- #--
127
- # SHELL OUT! Need a net/ssh library to fix.
128
- #++
129
-
130
- def run_scp
131
- pub.copy.each { |c|
132
- from, to = *Shellwords.shellwords(c)
133
- to = '' if to.nil?
134
- to = to[1..-1] if to[0,1] == '/'
135
- cmd = "scp -r #{from} #{pub.username}@#{pub.host}:#{pub.root}/#{to}"
136
- sh( cmd )
137
- }
138
- end
139
-
140
- def run_ftp
141
- require 'net/ftp'
142
- return if $PRETEND
143
- Net::FTP.open( pub.host ) do |ftp|
144
- ftp.login( pub.username )
145
- ftp.chdir( pub.root )
146
-
147
- pub.copy.each { |c|
148
- from, to = *Shellwords.shellwords(c)
149
- to = '' if to.nil?
150
- to = to[1..-1] if to[0,1] == '/'
151
- from.sub('*', '**/*') unless from =~ /\*\*/
152
- files = FileList.new( from )
153
- files.each { |f|
154
- t = File.join( to, f.basename )
155
- ftp.putbinaryfile( f, t, 1024 )
156
- }
157
- }
43
+ unless skip
44
+ puts "Reap is shelling out publishing work..."
45
+ sh(cmd) unless $PRETEND
158
46
  end
159
47
  end
160
48
 
161
49
  end
162
-
163
-
164
- # Rake interface.
165
-
166
- if defined?(Rake)
167
-
168
- #require 'reap/rake/adapter'
169
-
170
- module Rake
171
- ReapPublish = ::Reap::RakeAdapter( ::Reap::Publish )
172
- end
173
-
174
- end
175
-
@@ -1,84 +1,50 @@
1
1
 
2
2
  require 'reap/task'
3
3
 
4
- # ___ _ _____ _
5
- # | _ \__| |___ __ |_ _|_ _ __| |__
6
- # | / _` / _ \/ _| | |/ _` (_-< / /
7
- # |_|_\__,_\___/\__| |_|\__,_/__/_\_\
8
4
  #
9
-
10
- # = RDoc Task
11
- #
12
- # This task generates RDoc API documentation trom source
13
- # comments.
5
+ # RDoc Task
14
6
  #
15
- # rdoc:
16
- # dir Directory to store documentation [doc].
17
- # main File to use as main page of RDocs.
18
- # title Project title to use in RDocs.
19
- # template Which RDoc template to use.
20
- # include Files to include in RDocs.
21
- # exclude Files to exclude from those.
22
- # options Pass-thru extra options to RDoc command.
23
- #
24
-
25
7
  class Reap::RDoc < Reap::Task
26
8
 
27
- MUST_EXCLUDE = [ 'InstalledFiles', 'CVS/**/*', '_darcs/**/*' ]
28
-
29
- task_desc "Generate RDoc API documentation."
30
-
31
- task_help %{
32
-
33
- Generate RDoc doumentation.
34
-
35
- dir Directory to store documentation [doc].
36
- main File to use as main page of RDocs.
37
- title Project title to use in RDocs.
38
- template Which RDoc template to use.
39
- include Files to include in RDocs.
40
- exclude Files to exclude from those.
41
- options Pass-thru extra options to RDoc command.
42
-
43
- }
9
+ def task_desc
10
+ "Generate RDocs (in #{dir})."
11
+ end
44
12
 
45
- task_attr :doc
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
46
25
 
47
26
  def run
27
+ must_exclude = [ 'InstalledFiles', 'CVS/**/*' ]
48
28
 
49
- # setup
50
-
51
- doc.dir ||= 'doc'
52
- doc.main ||= 'README'
53
- doc.title ||= master.title
54
- doc.template ||= 'html' # 'jamis'
55
- doc.include ||= [ 'A-Z*', 'lib/**/*', 'ext/**/*', doc.main ]
56
- doc.exclude ||= [ 'demo/**/*', 'example/**/*', 'sample/**/*' ]
57
- doc.options ||= ['--merge', '--all']
58
-
59
- doc.include = [ doc.include ].flatten
60
- doc.exclude = [ doc.exclude ].flatten
61
- doc.options = [ doc.options ].flatten
62
-
63
- # document
64
-
65
- if !File.exists?(doc.main) or File.directory?(doc.main)
66
- warn "WARNING! Specified RDoc Main file #{doc.main} not found."
67
- doc.main = nil
29
+ if !File.exists?(@main) or File.directory?(@main)
30
+ warn "Specified RDoc Main file #{@main} not found. Ignored."
31
+ @main = nil
68
32
  end
69
33
 
70
- rdoc_dir = File.expand_path(doc.dir)
71
-
72
- if FileTest.directory?(doc.dir)
73
- q = "Directory '#{doc.dir}' already exists. Clobber?"
74
- #until inp = $stdin.gets[0,1] ; sleep 1 ; end ; puts
75
- inp = ask( q, 'yN' )
76
- case inp.downcase
77
- when 'y', 'yes', 'okay'
78
- tell "Removing old directory '#{rdoc_dir}'..."
79
- FileUtils.rm_r(doc.dir) unless $PRETEND
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
80
46
  else
81
- tell "Reap rdoc task canceled."
47
+ puts "Reap rdoc task canceled."
82
48
  return nil
83
49
  end
84
50
  end
@@ -86,13 +52,13 @@ class Reap::RDoc < Reap::Task
86
52
  rdoc_target = "#{rdoc_dir}/index.html"
87
53
 
88
54
  exc = []
89
- (doc.exclude + MUST_EXCLUDE).each{ |e|
55
+ (@exclude + must_exclude).each{ |e|
90
56
  exc << e
91
57
  exc |= Dir.glob(e+'/**/*')
92
58
  }
93
59
 
94
60
  inc = Dir.glob('[A-Z]*')
95
- doc.include.each{ |i| inc |= Dir.glob(i) }
61
+ @include.each{ |i| inc |= Dir.glob(i) }
96
62
  inc -= exc
97
63
 
98
64
  inc = inc.select{ |f| File.file?(f) }
@@ -102,33 +68,15 @@ class Reap::RDoc < Reap::Task
102
68
 
103
69
  # build options string
104
70
  build = []
105
- build += doc.options
106
- build << "--main '#{doc.main}'" if doc.main
107
- build << "--title '#{doc.title}'" if doc.title
108
- build << "-T '#{doc.template}'" if doc.template
71
+ build += @options
72
+ build << "--main '#{@main}'" if @main
73
+ build << "--title '#{@title}'" if @title
74
+ build << "-T '#{@template}'" if @template
109
75
  rdoc_opts = build.join(' ')
110
76
 
111
- #--
112
- # SHELL OUT! Can RDoc be called from code?
113
- #++
114
-
115
77
  # do it!
116
- tell "Reap is shelling work out to RDoc..."
78
+ puts "Reap is shelling work out to RDoc..."
117
79
  sh %{rdoc -o #{rdoc_dir} #{rdoc_opts} #{rdoc_files}}
118
80
  end
119
81
 
120
82
  end
121
-
122
-
123
- # Rake interface.
124
-
125
- if defined?(Rake)
126
-
127
- #require 'reap/rake/adapter'
128
-
129
- module Rake
130
- ReapRDoc = ::Reap::RakeAdapter( ::Reap::RDoc )
131
- end
132
-
133
- end
134
-
@@ -1,57 +1,114 @@
1
- require 'reap/task'
2
- require 'facet/gem/self/gempath'
3
1
 
4
- class Reap::Scaffold < Reap::Task
2
+ #require 'rbconfig'
3
+ #require 'reap/projectinfo'
5
4
 
6
- task_desc "Generate a project directory layout."
5
+ module Scaffold
6
+ extend self
7
7
 
8
- task_help %{
8
+ SCMPaths => %w{
9
+ trunk
10
+ branch
11
+ tag
12
+ scrap
13
+ package
14
+ }
9
15
 
10
- reap scaffold [type]
16
+ TrunkPaths = %w{
17
+ bin
18
+ lib
19
+ ext
20
+ dev
21
+ data
22
+ test
23
+ demo
24
+ }
11
25
 
12
- Generates a project directory layout within the current
13
- directory. The scaffolding includes all the standard
14
- features such as directories lib/ bin/ doc/
15
- and files such as README.
26
+ TrunkFiles = %w{
27
+ README
28
+ INSTALL
29
+ COPYING
30
+ ProjectInfo
31
+ ChangeLog
32
+ Todo
33
+ RakeFile
34
+ setup.rb
35
+ }
16
36
 
17
- To use this task you should first create an empty
18
- directory and than change into it. It will not generate
19
- a scaffolding into a directory with any files already in
20
- it unless you use the -f (force) option. Also, the scaffold
21
- task is not available if a ProjectInfo file exists.
37
+ def go(name) ; scaffold(name) ; end
22
38
 
23
- There are currently two types of supported scaffoldings:
24
- 'standard', which is the default if no type is given,
25
- and 'subversion' which creates a "trunk" hierarchy.
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}" )
26
44
 
27
- }
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
28
53
 
29
- task_available { |app| ! app.projectfile? }
54
+ private
30
55
 
31
- def run( type=nil )
32
- content = Dir.entries('.') - [ '.', '..' ]
33
- if not content.empty? and not $FORCE
34
- tell "Directory already has content. Use -f option to force scaffolding."
35
- return nil
36
- end
37
- type ||= 'standard'
38
- type = 'standard' if type == 'std'
39
- type = 'subversion' if type == 'svn'
40
- # gems workaround
41
- if dir = Gem.gempath('reap')
42
- dir = File.join( dir, 'data', 'reap', 'scaffold', type )
43
- else
44
- dir = File.join( ::Config::CONFIG['datadir'], 'reap', 'scaffold', type )
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."
45
64
  end
46
- #
47
- unless File.directory?( dir )
48
- tell "Unrecognized project type."
49
- else
50
- #FileUtils.mkdir_p( name )
51
- FileUtils.cp_r( File.join( dir, '.'), '.' )
52
- tell "Project ready."
65
+
66
+ if File.exists?(filename)
67
+ puts "#{filename} already exists."
68
+ return
53
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 )
54
78
  end
55
79
 
56
80
  end
57
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
+