reap 6.0.2 → 9.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. data/CHANGES +6 -0
  2. data/COPYING +666 -395
  3. data/MANIFEST +139 -0
  4. data/NOTES +12 -0
  5. data/README +19 -163
  6. data/bin/reap-announce +7 -0
  7. data/bin/reap-check-load +8 -0
  8. data/bin/reap-check-syntax +7 -0
  9. data/bin/reap-clean +7 -0
  10. data/bin/reap-clobber +7 -0
  11. data/bin/reap-doc +7 -0
  12. data/bin/reap-doc-rdoc +7 -0
  13. data/bin/reap-doc-ri +7 -0
  14. data/bin/reap-init +69 -0
  15. data/bin/reap-inspect +7 -0
  16. data/bin/reap-install +8 -0
  17. data/bin/reap-install-gem +8 -0
  18. data/bin/reap-log +7 -0
  19. data/bin/reap-log-changes +8 -0
  20. data/bin/reap-log-notes +8 -0
  21. data/bin/reap-make +7 -0
  22. data/bin/reap-make-clean +7 -0
  23. data/bin/reap-make-distclean +7 -0
  24. data/bin/reap-make-extconf +7 -0
  25. data/bin/reap-make-static +8 -0
  26. data/bin/reap-package +8 -0
  27. data/bin/reap-package-gem +7 -0
  28. data/bin/reap-package-tgz +7 -0
  29. data/bin/reap-package-zip +7 -0
  30. data/bin/reap-prepare +7 -0
  31. data/bin/reap-publish +7 -0
  32. data/bin/reap-release +7 -0
  33. data/bin/reap-scaffold +8 -0
  34. data/bin/reap-scm-branch +7 -0
  35. data/bin/reap-scm-tag +7 -0
  36. data/bin/reap-spec +7 -0
  37. data/bin/reap-spec-doc +8 -0
  38. data/bin/reap-stamp +7 -0
  39. data/bin/reap-stats +7 -0
  40. data/bin/reap-test +7 -0
  41. data/bin/reap-test-cross +7 -0
  42. data/bin/reap-test-load +9 -0
  43. data/bin/reap-test-solo +7 -0
  44. data/bin/reap-uninstall +7 -0
  45. data/bin/reap-uninstall-gem +7 -0
  46. data/data/reap/base/CHANGES +19 -0
  47. data/data/reap/base/COPYING +674 -0
  48. data/data/reap/base/NOTES +12 -0
  49. data/data/reap/base/README +8 -0
  50. data/data/reap/build/rake/Rakefile +130 -0
  51. data/{forge/reference/installers → data/reap/build/rake}/setup.rb +155 -97
  52. data/data/reap/build/rake-lite/install.rb +79 -0
  53. data/data/reap/build/tasks/task/rdoc +211 -0
  54. data/data/reap/{setup.rb → build/tasks/task/setup} +248 -200
  55. data/data/reap/build/tasks/task/test +38 -0
  56. data/data/reap/init/meta/project.yaml +21 -0
  57. data/demo/README +15 -0
  58. data/demo/lib/foo/foo.rb +7 -0
  59. data/demo/meta/VERSION +1 -0
  60. data/demo/meta/project.yaml +21 -0
  61. data/lib/reap/application.rb +80 -0
  62. data/lib/reap/default.yaml +77 -0
  63. data/lib/reap/extensions/array.rb +50 -0
  64. data/lib/reap/extensions/hash.rb +63 -0
  65. data/lib/reap/extensions/string.rb +31 -0
  66. data/lib/reap/extensions.rb +6 -0
  67. data/lib/reap/iobject.rb +264 -0
  68. data/lib/reap/manager/announce.rb +193 -0
  69. data/lib/reap/manager/check.rb +109 -0
  70. data/lib/reap/manager/clean.rb +58 -0
  71. data/lib/reap/manager/gem.rb +200 -0
  72. data/lib/reap/manager/html.rb +69 -0
  73. data/lib/reap/manager/log.rb +214 -0
  74. data/lib/reap/manager/make.rb +109 -0
  75. data/lib/reap/manager/pack.rb +232 -0
  76. data/lib/reap/manager/publish.rb +72 -0
  77. data/lib/reap/manager/rdoc.rb +194 -0
  78. data/lib/reap/manager/release.rb +78 -0
  79. data/lib/reap/manager/rubyforge.rb +44 -0
  80. data/lib/reap/manager/scaffold.rb +138 -0
  81. data/lib/reap/manager/scm.rb +66 -0
  82. data/lib/reap/manager/site.rb +27 -0
  83. data/lib/reap/manager/spec.rb +94 -0
  84. data/lib/reap/manager/stats.rb +145 -0
  85. data/lib/reap/manager/svn.rb +76 -0
  86. data/lib/reap/manager/test.rb +389 -0
  87. data/lib/reap/manager.rb +74 -0
  88. data/lib/reap/metadata.rb +603 -0
  89. data/lib/reap/project.rb +165 -0
  90. data/lib/reap/settings.rb +67 -0
  91. data/lib/reap/systems/rubyforge.rb +737 -0
  92. data/lib/reap/systems/subversion.rb +333 -0
  93. data/lib/reap/utilities/fileutils.rb +304 -0
  94. data/lib/reap/utilities/netutils.rb +221 -0
  95. data/lib/reap/utilities/setuputils.rb +124 -0
  96. data/lib/reap/utilities/shellutils.rb +175 -0
  97. data/log/Changelog.txt +107 -0
  98. data/log/FIXME.txt +25 -0
  99. data/log/TODO.txt +72 -0
  100. data/meta/VERSION +1 -0
  101. data/meta/description +4 -0
  102. data/meta/project.yaml +20 -0
  103. data/task/man +14 -0
  104. data/task/rdoc +20 -0
  105. data/{data/reap/scaffold/standard/setup.rb → task/setup} +248 -200
  106. metadata +225 -153
  107. data/ProjectInfo +0 -105
  108. data/bin/reap +0 -5
  109. data/bin/rubytest +0 -5
  110. data/data/reap/install.rb +0 -62
  111. data/data/reap/scaffold/standard/COPYING +0 -403
  112. data/data/reap/scaffold/standard/ChangeLog +0 -0
  113. data/data/reap/scaffold/standard/INSTALL +0 -14
  114. data/data/reap/scaffold/standard/ProjectInfo +0 -77
  115. data/data/reap/scaffold/standard/README +0 -3
  116. data/data/reap/scaffold/standard/Rakefile +0 -10
  117. data/data/reap/scaffold/standard/TODO +0 -0
  118. data/data/reap/scaffold/subversion/trunk/COPYING +0 -403
  119. data/data/reap/scaffold/subversion/trunk/ChangeLog +0 -0
  120. data/data/reap/scaffold/subversion/trunk/INSTALL +0 -14
  121. data/data/reap/scaffold/subversion/trunk/ProjectInfo +0 -76
  122. data/data/reap/scaffold/subversion/trunk/README +0 -3
  123. data/data/reap/scaffold/subversion/trunk/Rakefile +0 -10
  124. data/data/reap/scaffold/subversion/trunk/TODO +0 -0
  125. data/data/reap/scaffold/subversion/trunk/setup.rb +0 -1568
  126. data/forge/ProjectInfo +0 -38
  127. data/forge/ProjectInfo.rb +0 -76
  128. data/forge/TODO +0 -10
  129. data/forge/installer.rb +0 -250
  130. data/forge/reference/Rakefile +0 -124
  131. data/forge/reference/Rakefile.htm +0 -69
  132. data/forge/reference/aRakefile +0 -60
  133. data/forge/reference/compositepublisher.rb +0 -24
  134. data/forge/reference/ftptools.rb +0 -139
  135. data/forge/reference/installers/package.rb +0 -629
  136. data/forge/reference/license-each.rb +0 -85
  137. data/forge/reference/publisher.rb +0 -75
  138. data/forge/reference/rubyforge.rb +0 -247
  139. data/forge/reference/rubyforgepublisher.rb +0 -18
  140. data/forge/reference/sshpublisher.rb +0 -47
  141. data/forge/reference/suby-cvs.rb +0 -46
  142. data/forge/scaffold.rb +0 -126
  143. data/forge/unit_runner/README +0 -6
  144. data/forge/unit_runner/commentrunner.rb +0 -62
  145. data/forge/unit_runner/cunit.rb +0 -17
  146. data/forge/unit_runner/forkedrunner.rb +0 -91
  147. data/forge/unit_runner/sample.rb +0 -16
  148. data/lib/reap/bin/reap.rb +0 -230
  149. data/lib/reap/bin/rubytest.rb +0 -53
  150. data/lib/reap/class/announce.rb +0 -220
  151. data/lib/reap/class/doap.rb +0 -80
  152. data/lib/reap/class/extest.rb +0 -146
  153. data/lib/reap/class/filer.rb +0 -62
  154. data/lib/reap/class/manifest.rb +0 -68
  155. data/lib/reap/class/package.rb +0 -576
  156. data/lib/reap/class/publish.rb +0 -152
  157. data/lib/reap/class/rdoc.rb +0 -123
  158. data/lib/reap/class/test.rb +0 -264
  159. data/lib/reap/projectinfo.rb +0 -208
  160. data/lib/reap/rake.rb +0 -42
  161. data/lib/reap/reap.rb +0 -89
  162. data/lib/reap/tasks.rb +0 -756
  163. data/lib/reap/taskutils.rb +0 -122
  164. data/note/LATEST +0 -44
  165. data/note/doap.xml +0 -28
  166. data/note/history/Rakefile-0.1 +0 -308
  167. data/sample/ProjectInfo +0 -96
  168. data/sample/Rakefile +0 -9
  169. data/sample/Reapfile +0 -11
  170. data/sample/task/demo.rb +0 -15
  171. data/setup.rb +0 -1568
  172. data/web/ProjectInfo.html +0 -75
  173. data/web/images/grape.jpg +0 -0
  174. data/web/index.html +0 -312
@@ -1,75 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Copyright 2003, 2004 by Jim Weirich (jim@weirichhouse.org)
4
- # All rights reserved.
5
-
6
- # Permission is granted for use, copying, modification, distribution,
7
- # and distribution of modified versions of this work as long as the
8
- # above copyright notice is included.
9
-
10
- # Configuration information about an upload host system.
11
- # * name :: Name of host system.
12
- # * webdir :: Base directory for the web information for the
13
- # application. The application name (APP) is appended to
14
- # this directory before using.
15
- # * pkgdir :: Directory on the host system where packages can be
16
- # placed.
17
- HostInfo = Struct.new(:name, :webdir, :pkgdir)
18
-
19
- # Manage several publishers as a single entity.
20
- class CompositePublisher
21
- def initialize
22
- @publishers = []
23
- end
24
-
25
- # Add a publisher to the composite.
26
- def add(pub)
27
- @publishers << pub
28
- end
29
-
30
- # Upload all the individual publishers.
31
- def upload
32
- @publishers.each { |p| p.upload }
33
- end
34
- end
35
-
36
- # Publish an entire directory to an existing remote directory using
37
- # SSH.
38
- class SshDirPublisher
39
- def initialize(host, remote_dir, local_dir)
40
- @host = host
41
- @remote_dir = remote_dir
42
- @local_dir = local_dir
43
- end
44
-
45
- def upload
46
- run %{scp -rq #{@local_dir}/* #{@host}:#{@remote_dir}}
47
- end
48
- end
49
-
50
- # Publish an entire directory to a fresh remote directory using SSH.
51
- class SshFreshDirPublisher < SshDirPublisher
52
- def upload
53
- run %{ssh #{@host} rm -rf #{@remote_dir}} rescue nil
54
- run %{ssh #{@host} mkdir #{@remote_dir}}
55
- super
56
- end
57
- end
58
-
59
- # Publish a list of files to an existing remote directory.
60
- class SshFilePublisher
61
- # Create a publisher using the give host information.
62
- def initialize(host, remote_dir, local_dir, *files)
63
- @host = host
64
- @remote_dir = remote_dir
65
- @local_dir = local_dir
66
- @files = files
67
- end
68
-
69
- # Upload the local directory to the remote directory.
70
- def upload
71
- @files.each do |fn|
72
- run %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}}
73
- end
74
- end
75
- end
@@ -1,247 +0,0 @@
1
-
2
- require "enumerator"
3
- require "http-access2"
4
-
5
- require 'reap/iface/interface.rb'
6
-
7
-
8
- class RubyForgeInterface < Interface
9
-
10
- attr_accessor :username, :password, :cookie_jar
11
-
12
- def initialize( master, section )
13
-
14
- @name = master['name']
15
-
16
- @username = master['rubyforge']['username'] || section['username']
17
-
18
- @packge_id = section['package_id']
19
- @lockfile_id = section['lockfile_id']
20
-
21
- @group_id = section['group_id'] || 1024 # this is codeforpeople. it's just a default...
22
- @private = section['private'] ? 0 : 1
23
-
24
- # internal use
25
- @uri = "http://rubyforge.org"
26
- @cookie_jar = File::join(File::expand_path("~"), ".rubyforge.cookie_jar")
27
-
28
- end
29
-
30
-
31
- # config = {
32
- # "username" => "username", # this must be your username
33
- # "password" => "password", # this must be your password
34
- #
35
- # "group_id" => 1024, # this is codeforpeople. it's just a default...
36
- #
37
- # "package_ids" => { # configure shortcuts for your packages here
38
- # "traits" => 1241,
39
- # "lockfile" => 1242,
40
- # },
41
- #
42
- # "uri" => "http://rubyforge.org",
43
- # "cookie_jar" => File::join(File::expand_path("~"), ".rubyforge.cookie_jar"),
44
- # }
45
- #
46
- # opts =
47
- # GetoptLong::new(
48
- # [ "--username" , "-u" , GetoptLong::REQUIRED_ARGUMENT ] ,
49
- # [ "--password" , "-p" , GetoptLong::REQUIRED_ARGUMENT ] ,
50
- # [ "--cookie_jar" , "-c" , GetoptLong::REQUIRED_ARGUMENT ]
51
- # ).enum_for.inject({}){|h,kv| h.update Hash[*kv]}
52
- #
53
- # username = opts['username'] || config['username']
54
- # password = opts['password'] || config['password']
55
- # cookie_jar = opts["cookie_jar"] || config['cookie_jar']
56
- #
57
- # setup
58
- #
59
- # mode = ARGV.shift
60
- # abort "#{ $0 } [login|create_package (package_name)|add_package (package_id release_name release.ext)]" unless mode
61
-
62
- def setup
63
-
64
- page, form, method = nil
65
- extheader = {}
66
-
67
- case mode
68
-
69
- when %r/login/
70
- page = "/account/login.php"
71
- method = "post_content"
72
-
73
- form = {
74
- "return_to" => "",
75
- "form_loginname" => username,
76
- "form_pw" => password,
77
- "login" => "Login"
78
- }
79
-
80
- when %r/create_package/
81
- page = "/frs/admin/index.php"
82
- method = "post_content"
83
-
84
- opts =
85
- GetoptLong::new(
86
- [ "--group_id" , "-g" , GetoptLong::REQUIRED_ARGUMENT ] ,
87
- [ "--is_private" , "-P" , GetoptLong::REQUIRED_ARGUMENT ]
88
- ).enum_for.inject({}){|h,kv| h.update Hash[*kv]}
89
-
90
- package_name = ARGV.shift
91
- abort "#{ $0 } package_name" unless package_name
92
-
93
- group_id = opts["group_id"] || config["group_id"]
94
- is_public = opts["is_private"] ? 0 : 1
95
-
96
- form = {
97
- "group_id" => group_id,
98
- "package_name" => package_name,
99
- "func" => "add_package",
100
- "is_public" => is_public,
101
- "submit" => "Create This Package",
102
- }
103
-
104
- when %r/add_release/
105
- page = "/frs/admin/qrs.php"
106
- method = "post_content"
107
-
108
- opts =
109
- GetoptLong::new(
110
- [ "--group_id" , "-g" , GetoptLong::REQUIRED_ARGUMENT ] ,
111
- [ "--release_date" , "-r" , GetoptLong::REQUIRED_ARGUMENT ] ,
112
- [ "--type_id" , "-t" , GetoptLong::REQUIRED_ARGUMENT ] ,
113
- [ "--processor_id" , "-P" , GetoptLong::REQUIRED_ARGUMENT ] ,
114
- [ "--release_nots" , "-n" , GetoptLong::REQUIRED_ARGUMENT ] ,
115
- [ "--release_changes" , "-a" , GetoptLong::REQUIRED_ARGUMENT ]
116
- ).enum_for.inject({}){|h,kv| h.update Hash[*kv]}
117
-
118
- package_id, release_name, userfile, ignored = ARGV
119
- abort "#{ $0 } package_name" unless
120
- package_id and release_name and userfile
121
-
122
- package_id = config["package_ids"][package_id] unless
123
- package_id =~ %r/^\d+$/
124
-
125
- group_id = opts["group_id"] || config["group_id"]
126
- release_date = opts["release_date"] || Time::now.strftime('%Y-%m-%d %H:%M')
127
-
128
- type_id = opts['type_id'] || userfile[%r|\.[^\./]+$|]
129
- type_id = {
130
- ".deb" => 1000,
131
- ".rpm" => 2000,
132
- ".zip" => 3000,
133
- ".bz2" => 3100,
134
- ".gz" => 3110,
135
- ".src.zip" => 5000,
136
- ".src.bz2" => 5010,
137
- ".src.gz" => 5020,
138
- ".src.rpm" => 5100,
139
- ".src" => 5900,
140
- ".jpg" => 8000,
141
- ".txt" => 8100,
142
- ".text" => 8100,
143
- ".htm" => 8200,
144
- ".html" => 8200,
145
- ".pdf" => 8300,
146
- ".oth" => 9999,
147
- ".ebuild" => 1300,
148
- ".exe" => 1100,
149
- ".dmg" => 1200,
150
- ".tar.gz" => 5000,
151
- ".tgz" => 5000,
152
- ".gem" => 1400,
153
- ".pgp" => 8150,
154
- ".sig" => 8150,
155
- }[type_id]
156
-
157
- processor_id = opts['processor_id'] || 'Any'
158
- processor_id = {
159
- "i386" => 1000,
160
- "IA64" => 6000,
161
- "Alpha" => 7000,
162
- "Any" => 8000,
163
- "PPC" => 2000,
164
- "MIPS" => 3000,
165
- "Sparc" => 4000,
166
- "UltraSparc" => 5000,
167
- "Other" => 9999,
168
- }[processor_id]
169
-
170
- release_notes = opts['release_notes'] || nil
171
- release_notes = open(release_notes) if release_notes
172
-
173
- release_changes = opts['release_changes'] || nil
174
- release_changes = open(release_changes) if release_changes
175
-
176
- userfile = open(userfile)
177
-
178
- preformatted = '1'
179
-
180
- form = {
181
- "group_id" => group_id,
182
- "package_id" => package_id,
183
- "release_name" => release_name,
184
- "release_date" => release_date,
185
- "type_id" => type_id,
186
- "processor_id" => processor_id,
187
- "preformatted" => preformatted,
188
- "userfile" => userfile,
189
- "submit" => "Release File"
190
- }
191
-
192
- boundary = Array::new(8){ "%2.2d" % rand(42) }.join('__')
193
- extheader['content-type'] = "multipart/form-data; boundary=___#{ boundary }___"
194
-
195
- else
196
- abort "#{ $0 } login create_package add_release"
197
-
198
- end
199
- #
200
- # http transaction
201
- #
202
- client = HTTPAccess2::Client::new ENV['HTTP_PROXY']
203
- client.debug_dev = STDERR if ENV['DEBUG']
204
-
205
- client.set_cookie_store cookie_jar
206
-
207
- # fixes http-access2 bug
208
- client.redirect_uri_callback = lambda do |res|
209
- page = res.header['location'].first
210
- page = page =~ %r/http/ ? page : "#{ config['uri'] }/#{ page }"
211
- page
212
- end
213
-
214
- response = client.send "#{ method }", "#{ config['uri'] }/#{ page }", form, extheader
215
-
216
- client.save_cookie_store
217
-
218
- # fixes http-access2 bug
219
- BEGIN {
220
- require "http-access2"
221
- module WebAgent::CookieUtils
222
- def domain_match(host, domain)
223
- case domain
224
- when /\d+\.\d+\.\d+\.\d+/
225
- return (host == domain)
226
- when '.'
227
- return true
228
- when /^\./
229
- #return tail_match?(domain, host)
230
- return tail_match?(host, domain)
231
- else
232
- return (host == domain)
233
- end
234
- end
235
- end
236
-
237
- }
238
-
239
-
240
-
241
-
242
-
243
-
244
- end
245
-
246
-
247
-
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'rake/contrib/sshpublisher'
4
-
5
- module Rake
6
-
7
- class RubyForgePublisher < SshDirPublisher
8
- attr_reader :project, :proj_id, :user
9
-
10
- def initialize(projname, user)
11
- super(
12
- "#{user}@rubyforge.org",
13
- "/var/www/gforge-projects/#{projname}",
14
- "html")
15
- end
16
- end
17
-
18
- end
@@ -1,47 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'rake/contrib/compositepublisher'
4
-
5
- module Rake
6
-
7
- # Publish an entire directory to an existing remote directory using
8
- # SSH.
9
- class SshDirPublisher
10
- def initialize(host, remote_dir, local_dir)
11
- @host = host
12
- @remote_dir = remote_dir
13
- @local_dir = local_dir
14
- end
15
-
16
- def upload
17
- sh %{scp -rq #{@local_dir}/* #{@host}:#{@remote_dir}}
18
- end
19
- end
20
-
21
- # Publish an entire directory to a fresh remote directory using SSH.
22
- class SshFreshDirPublisher < SshDirPublisher
23
- def upload
24
- sh %{ssh #{@host} rm -rf #{@remote_dir}} rescue nil
25
- sh %{ssh #{@host} mkdir #{@remote_dir}}
26
- super
27
- end
28
- end
29
-
30
- # Publish a list of files to an existing remote directory.
31
- class SshFilePublisher
32
- # Create a publisher using the give host information.
33
- def initialize(host, remote_dir, local_dir, *files)
34
- @host = host
35
- @remote_dir = remote_dir
36
- @local_dir = local_dir
37
- @files = files
38
- end
39
-
40
- # Upload the local directory to the remote directory.
41
- def upload
42
- @files.each do |fn|
43
- sh %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}}
44
- end
45
- end
46
- end
47
- end
@@ -1,46 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- DEBUG = false
4
- URI = "-dtransami@cvs.suby.berlios.de:/cvsroot/suby"
5
-
6
- cmd = nil
7
-
8
- case ARGV[0]
9
- when 'checkout', 'co'
10
- if ARGV[1] and ARGV[1] != ''
11
- cmd = %Q{cvs -z3 #{URI} co "#{ARGV[1]}"}
12
- else
13
- puts "no module given"
14
- cmd = nil
15
- end
16
- when 'commit'
17
- if ARGV[1] and ARGV[1] != ''
18
- cmd = %Q{cvs -z3 #{URI} commit -m "#{ARGV[1]}"}
19
- else
20
- puts "no commit message given"
21
- cmd = nil
22
- end
23
- when 'update'
24
- cmd = %Q{cvs -z3 #{URI} update}
25
- when 'add'
26
- if ARGV[1]
27
- cmd = %Q{cvs -z3 #{URI} add #{ARGV[1..-1].join(' ')}}
28
- else
29
- puts "no files given to add"
30
- cmd = nil
31
- end
32
- when 'remove'
33
- if ARGV[1]
34
- cmd = %Q{cvs -z3 #{URI} remove #{ARGV[1..-1].join(' ')}}
35
- else
36
- puts "no file given to remove"
37
- cmd = nil
38
- end
39
- end
40
-
41
- if DEBUG
42
- puts cmd
43
- elsif cmd
44
- `#{cmd}`
45
- end
46
-
data/forge/scaffold.rb DELETED
@@ -1,126 +0,0 @@
1
- # ___ __ __ _ _ _____ _
2
- # / __| __ __ _ / _|/ _|___| |__| | |_ _|_ _ __| |__
3
- # \__ \/ _/ _` | _| _/ _ \ / _` | | |/ _` (_-< / /
4
- # |___/\__\__,_|_| |_| \___/_\__,_| |_|\__,_/__/_\_\
5
- #
6
-
7
- # Current scaffold task just copies a folder. This incomplete
8
- # version was an idea for dynamically creating the scaffolding
9
- # instead.
10
-
11
- #require 'rbconfig'
12
-
13
-
14
- module Scaffold
15
- extend self
16
-
17
- SVNPaths => %w{
18
- trunk
19
- branch
20
- tag
21
- scrap
22
- package
23
- }
24
-
25
- TrunkPaths = %w{
26
- bin
27
- lib
28
- ext
29
- conf
30
- data
31
- test
32
- note
33
- sample
34
- }
35
-
36
- TrunkFiles = %w{
37
- README
38
- INSTALL
39
- COPYING
40
- ProjectInfo
41
- ChangeLog
42
- Todo
43
- RakeFile
44
- setup.rb
45
- }
46
-
47
- def init( scf )
48
- scf.name ||= 'yourlib.projectdomain.org'
49
- end
50
-
51
- def run( scf )
52
- t = Time.now.strftime("%Y-%m-%d")
53
- libdir = File.join( 'lib', "#{@name},#{t}" )
54
-
55
- if @scm
56
- SCMPaths.each { |d| makedir( d ) }
57
- Dir.chdir 'trunk'
58
- end
59
- TrunkPaths.each { |d| makedir( d ) }
60
- makedir_with_check( libdir )
61
- TrunkFiles.each { |f| temlpate( f ) }
62
- end
63
-
64
- private
65
-
66
- # Copy a file from lib/data to the current dir.
67
-
68
- def template( filename )
69
- dir = File.join( File.dirname(__FILE__), 'data' )
70
- #dir = File.join( ::Config::CONFIG['datadir'], DATA_DIR )
71
- f = File.join( dir, filename )
72
- unless File.file?( f )
73
- puts f
74
- raise "Tempfile is missing."
75
- end
76
-
77
- if File.exists?(filename)
78
- puts "#{filename} already exists."
79
- return
80
- end
81
- # copy tmpf to Reapfile
82
- FileUtils.cp( f, filename )
83
- #puts "#{filename} created. You'll need to fill it out."
84
- end
85
-
86
- # Make a directory as long as it doesn't already exist.
87
-
88
- def makedir( dir )
89
- FileUtils.makedir_p( dir ) unless File.directory?( dir )
90
- end
91
-
92
- end
93
-
94
-
95
-
96
- =begin
97
- def scaffold
98
- require 'reap/scaffold'
99
- name =
100
- domain =
101
- Scaffold.go( name, domain )
102
- end
103
-
104
- def template( file_name = ProjectInfo )
105
- #dir = File.dirname(File.dirname(__FILE__))
106
- dir = File.join( ::Config::CONFIG['datadir'], DATA_DIR )
107
-
108
- tmpf = File.join( dir, 'template.yaml' )
109
- unless File.file?( tmpf )
110
- puts tmpf
111
- raise "Tempfile is missing."
112
- end
113
-
114
- if File.directory?(filename)
115
- puts "#{filename} a directory. Cannot comply."
116
- return
117
- elsif File.file?(filename)
118
- puts "#{filename} already exists."
119
- return
120
- end
121
- # copy tmpf to Reapfile
122
- FileUtils.cp( tmpf, filename )
123
- puts "#{filename} created. You'll need to fill it out."
124
- end
125
- =end
126
-
@@ -1,6 +0,0 @@
1
- I was playing with making Reaps forked tester
2
- and the rubytest comment tester part of Test::Unit.
3
- The code in this directory is the result of that
4
- playing. It's didn't work out so well so I gave-up
5
- on it. Just trash this code eventually. I left it here
6
- just in case anyone might want to think about the idea.
@@ -1,62 +0,0 @@
1
- require 'nano/string/pull'
2
-
3
- module Test
4
- module Unit
5
- class CommentAutoRunner < AutoRunner
6
- def self.run(current_file=nil, default_dir=nil, argv=ARGV, &block)
7
- if(!current_file || current_file == $0)
8
- r = new(!current_file, &block)
9
- if !r.process_args(argv) && default_dir
10
- r.to_run << default_dir
11
- end
12
- r.run
13
- end
14
- end
15
-
16
- def load_commented_tests( filepath )
17
- rbfile = File.read( filepath )
18
- rblines = rbfile.split("\n")
19
-
20
- tests = []
21
- intest = nil
22
- comment = nil
23
- hcomment = nil
24
-
25
- rblines.each_with_index do |l,i|
26
- if /^(\ *#\ *)?=\ *begin testing/ =~ l
27
- intest = true
28
- comment = true unless $1
29
- next
30
- elsif intest and /^(\ *#\ *)?=\ *end/ =~ l
31
- intest = false
32
- comment = false
33
- next
34
- end
35
- hcomment = true if /^\ *#/ =~ l
36
-
37
- if intest and (comment or hcomment)
38
- l.pull if hcomment
39
- tests << l
40
- end
41
- end
42
-
43
- tests = tests.join("\n")
44
- tests.gsub!( %r{^([ ]*)testcase[ ]+(\w+)} ) { "#{$1}class TC_#{$2} < Test::Unit::TestCase" }
45
- tests.gsub!( %r{^([ ]*)test[ ]+(\w+)} ) { |md| "#{$1}def test_#{$2}" }
46
-
47
- tests
48
- end
49
-
50
- end
51
- end
52
- end
53
-
54
- # Test::Unit::CommentAutoRunner.start( __FILE__ )
55
- #
56
- # puts tests, "\n" if $VERBOSE
57
- #
58
- # require 'test/unit'
59
- #
60
- # load ARGV[0]
61
- #
62
- # eval tests
@@ -1,17 +0,0 @@
1
-
2
- module Unit
3
- def self.run=(flag)
4
- @run = flag
5
- end
6
-
7
- def self.run?
8
- @run ||= false
9
- end
10
- end
11
- end
12
-
13
- at_exit do
14
- unless $! || Test::Unit.run?
15
- exit Test::Unit::CommentAutoRunner.run($0 != "-e" && $0)
16
- end
17
- end