rake 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rake might be problematic. Click here for more details.

Files changed (42) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGES +24 -0
  3. data/README +28 -11
  4. data/Rakefile +22 -30
  5. data/bin/rake +1 -1
  6. data/doc/jamis.rb +132 -105
  7. data/doc/release_notes/rake-0.6.0.rdoc +141 -0
  8. data/lib/rake.rb +661 -455
  9. data/lib/rake/classic_namespace.rb +8 -0
  10. data/lib/rake/gempackagetask.rb +5 -3
  11. data/lib/rake/packagetask.rb +0 -2
  12. data/lib/rake/rake_test_loader.rb +1 -1
  13. data/lib/rake/testtask.rb +8 -2
  14. data/test/data/chains/Rakefile +15 -0
  15. data/test/data/default/Rakefile +19 -0
  16. data/test/data/dryrun/Rakefile +22 -0
  17. data/test/data/file_creation_task/Rakefile +30 -0
  18. data/test/data/imports/Rakefile +19 -0
  19. data/test/data/imports/deps.mf +1 -0
  20. data/test/data/multidesc/Rakefile +14 -0
  21. data/test/data/sample.mf +9 -0
  22. data/test/filecreation.rb +18 -9
  23. data/test/functional.rb +2 -130
  24. data/test/session_functional.rb +159 -0
  25. data/test/{testclean.rb → test_clean.rb} +1 -0
  26. data/test/test_definitions.rb +82 -0
  27. data/test/test_earlytime.rb +31 -0
  28. data/test/test_file_creation_task.rb +56 -0
  29. data/test/test_file_task.rb +140 -0
  30. data/test/{testfilelist.rb → test_filelist.rb} +17 -2
  31. data/test/{testfileutils.rb → test_fileutils.rb} +10 -2
  32. data/test/{testftp.rb → test_ftp.rb} +0 -0
  33. data/test/test_makefile_loader.rb +2 -0
  34. data/test/{testpackagetask.rb → test_package_task.rb} +45 -0
  35. data/test/test_rake.rb +21 -0
  36. data/test/test_rules.rb +206 -0
  37. data/test/test_tasks.rb +77 -0
  38. data/test/{testtesttask.rb → test_test_task.rb} +5 -0
  39. metadata +72 -12
  40. metadata.gz.sig +2 -0
  41. data/TAGS +0 -126
  42. data/test/testtasks.rb +0 -400
data.tar.gz.sig ADDED
Binary file
data/CHANGES CHANGED
@@ -1,5 +1,29 @@
1
1
  = Rake Changelog
2
2
 
3
+ == PreVersion 0.5.5
4
+
5
+ * Fixed file creation bug in the unit tests (caused infinite loop on
6
+ windows).
7
+ * Fixed bug where session based functional tests were run under
8
+ windows.
9
+ * Fixed bug in directory tasks so that updating a directory will not
10
+ retrigger file tasks depending on the directory (see
11
+ FileCreationTask and EarlyTime).
12
+ * Added egrep to FileList
13
+ * ruby command now runs same ruby version as rake.
14
+ * Added investigation to task object. (suggested by Martin Fowler)
15
+ * Added ruby_opts to the test task to allow arbitrary ruby options to
16
+ be passed to the test script. (Greg Fast)
17
+ * Fixed the test loader to ignore options. (Greg Fast)
18
+ * Moved Task, FileTask, FileCreationTask and RakeApp into the Rake
19
+ module namespace. Old style namespace behavior can be invoked via
20
+ the --classic-namespace option. (requested by Kelly Felkins).
21
+ * GemTask is now sensitive to the gem platform (Masao Mutoh).
22
+ * A non-existing file prerequisite will no longer cause an exception
23
+ (Philipp Neubeck).
24
+ * Multiple prerequisites on Rake rules now allowed (initial patch
25
+ supplied by Stuart Jansen).
26
+
3
27
  == Version 0.5.4
4
28
 
5
29
  * Added double quotes to the test runner.
data/README CHANGED
@@ -1,5 +1,7 @@
1
1
  = RAKE -- Ruby Make
2
2
 
3
+ Supporting Rake version: 0.6
4
+
3
5
  This package contains Rake, a simple ruby build program with
4
6
  capabilities similar to make.
5
7
 
@@ -13,9 +15,11 @@ Rake has the following features:
13
15
 
14
16
  * Rake supports rule patterns to sythesize implicit tasks.
15
17
 
16
- * Rake is lightweight. It can be distributed with other projects as a
17
- single file. Projects that depend upon rake do not require that
18
- rake be installed on target systems.
18
+ * Flexible FileLists that act like arrays but know about manipulating
19
+ file names and paths.
20
+
21
+ * A library of prepackaged tasks to make building rakefiles easier.
22
+
19
23
 
20
24
  == Download
21
25
 
@@ -23,12 +27,6 @@ The latest version of rake can be found at
23
27
 
24
28
  * http://rubyforge.org/project/showfiles.php?group_id=50
25
29
 
26
- Online Resources can be found at ...
27
-
28
- * Online Rake Documentation: http://rake.rubyforge.org
29
- * Rake Project Page: http://rubyforge.org/projects/rake
30
- * Rake Project Wiki: http://rake.rubyforge.org/wiki/wiki.pl
31
-
32
30
  == Installation
33
31
 
34
32
  === Normal Installation
@@ -45,7 +43,20 @@ Download and install rake with the following.
45
43
 
46
44
  gem install --remote rake
47
45
 
48
- == Roadmap
46
+ == Online Resources
47
+
48
+ == Rake References
49
+
50
+ * Rake Documentation Home: http://docs.rubyrake.org
51
+ * Rake Project Page: http://rubyforge.org/projects/rake
52
+ * Rake API Documents: http://rake.rubyforge.org
53
+
54
+ == Presentations and Articles about Rake
55
+
56
+ * Jim Weirich\u2019s 2003 RubyConf presentation: http://onestepback.org/articles/buildingwithrake/
57
+ * Martin Fowler\u2019s article on Rake: http://martinfowler.com/articles/rake.html
58
+
59
+ === Road Map
49
60
 
50
61
  * If you want to see how to invoke rake to build your projects, read on.
51
62
  * If you want to see the format of a Rakefile, see
@@ -55,7 +66,6 @@ Download and install rake with the following.
55
66
  * If you want to see a glossary of terms, see
56
67
  doc/glossary.rdoc[http://rake.rubyforge.org/files/doc/glossary_rdoc.html].
57
68
 
58
-
59
69
  == Simple Example
60
70
 
61
71
  Once installed, you can run rake as follows ...
@@ -136,6 +146,13 @@ Options are:
136
146
  during the execution of the <b>rake</b> command. You can access
137
147
  the value by using ENV['<em>name</em>'].
138
148
 
149
+ [<tt>--classic-namespace</tt> (-n)]
150
+ Import the Task, FileTask, and FileCreateTask into the top-level
151
+ scope to be compatible with older versions of Rake. Alternatively
152
+ you can include the line <code>require
153
+ 'rake/classic_namespace'</code> in your Rakefile to get the
154
+ classic behavior.
155
+
139
156
  [<tt>--dry-run</tt> (-n)]
140
157
  Do a dry run. Print the tasks invoked and executed, but do not
141
158
  actually execute any of the actions.
data/Rakefile CHANGED
@@ -20,7 +20,9 @@ CLEAN.include('**/*.o')
20
20
  CLOBBER.include('doc/example/main', 'testdata')
21
21
  CLOBBER.include('test/data/**/temp_*')
22
22
  CLOBBER.include('test/data/chains/play.*')
23
-
23
+ CLOBBER.include('test/data/file_creation_task/build')
24
+ CLOBBER.include('test/data/file_creation_task/src')
25
+ CLOBBER.include('TAGS')
24
26
 
25
27
  def announce(msg='')
26
28
  STDERR.puts msg
@@ -50,10 +52,11 @@ task :default => :alltests
50
52
 
51
53
  # Test Tasks ---------------------------------------------------------
52
54
 
53
- task :a => :alltests
54
- task :f => :funtests
55
- task :u => :unittests
56
- task :c => :contribtests
55
+ task :ta => :alltests
56
+ task :tf => :funtests
57
+ task :tu => :unittests
58
+ task :tc => :contribtests
59
+ task :test => :unittests
57
60
 
58
61
  Rake::TestTask.new(:alltests) do |t|
59
62
  t.test_files = FileList[
@@ -62,7 +65,7 @@ Rake::TestTask.new(:alltests) do |t|
62
65
  'test/fun*.rb'
63
66
  ]
64
67
  t.warning = true
65
- t.verbose = false
68
+ t.verbose = true
66
69
  end
67
70
 
68
71
  Rake::TestTask.new(:unittests) do |t|
@@ -88,13 +91,6 @@ directory 'testdata'
88
91
  task t => ['testdata']
89
92
  end
90
93
 
91
- # Abbreviations
92
-
93
- task :a => [:alltests]
94
- task :u => [:unittests]
95
- task :f => [:funtests]
96
- task :c => [:contribtests]
97
-
98
94
  # CVS Tasks ----------------------------------------------------------
99
95
 
100
96
  # Install rake using the standard install.rb script.
@@ -128,6 +124,9 @@ PKG_FILES = FileList[
128
124
  'bin/**/*',
129
125
  'lib/**/*.rb',
130
126
  'test/**/*.rb',
127
+ 'test/**/*.rf',
128
+ 'test/**/*.mf',
129
+ 'test/**/Rakefile',
131
130
  'doc/**/*'
132
131
  ]
133
132
  PKG_FILES.exclude('doc/example/*.o')
@@ -184,9 +183,13 @@ else
184
183
  s.email = "jim@weirichhouse.org"
185
184
  s.homepage = "http://rake.rubyforge.org"
186
185
  s.rubyforge_project = "rake"
186
+ if ENV['CERT_DIR']
187
+ s.signing_key = File.join(ENV['CERT_DIR'], 'gem-private_key.pem')
188
+ s.cert_chain = [File.join(ENV['CERT_DIR'], 'gem-public_cert.pem')]
189
+ end
187
190
  end
188
191
 
189
- Rake::GemPackageTask.new(spec) do |pkg|
192
+ package_task = Rake::GemPackageTask.new(spec) do |pkg|
190
193
  pkg.need_zip = true
191
194
  pkg.need_tar = true
192
195
  end
@@ -239,28 +242,14 @@ load "publish.rf" if File.exist? "publish.rf"
239
242
 
240
243
  # Support Tasks ------------------------------------------------------
241
244
 
242
- def egrep(pattern)
243
- Dir['**/*.rb'].each do |fn|
244
- count = 0
245
- open(fn) do |f|
246
- while line = f.gets
247
- count += 1
248
- if line =~ pattern
249
- puts "#{fn}:#{count}:#{line}"
250
- end
251
- end
252
- end
253
- end
254
- end
255
-
256
245
  desc "Look for TODO and FIXME tags in the code"
257
246
  task :todo do
258
- egrep /#.*(FIXME|TODO|TBD)/
247
+ FileList['**/*.rb'].egrep /#.*(FIXME|TODO|TBD)/
259
248
  end
260
249
 
261
250
  desc "Look for Debugging print lines"
262
251
  task :dbg do
263
- egrep /\bDBG|\bbreakpoint\b/
252
+ FileList['**/*.rb'].egrep /\bDBG|\bbreakpoint\b/
264
253
  end
265
254
 
266
255
  desc "List all ruby files"
@@ -359,3 +348,6 @@ task :tag => [:prerelease] do
359
348
  end
360
349
  end
361
350
 
351
+ # Require experimental XForge/Metaproject support.
352
+
353
+ load 'xforge.rf' if File.exist?('xforge.rf')
data/bin/rake CHANGED
@@ -4,5 +4,5 @@ rescue LoadError
4
4
  require 'rubygems'
5
5
  require_gem 'rake'
6
6
  end
7
- RakeApp.new.run
7
+ Rake::Application.new.run
8
8
 
data/doc/jamis.rb CHANGED
@@ -182,30 +182,39 @@ h3, h4, h5, h6 {
182
182
 
183
183
  CSS
184
184
 
185
- BODY = <<HTML
185
+ XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
186
+ <!DOCTYPE html
187
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
188
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
189
+ }
190
+
191
+ HEADER = XHTML_PREAMBLE + <<ENDHEADER
186
192
  <html>
187
193
  <head>
188
194
  <title>%title%</title>
189
195
  <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
190
196
  <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
191
197
 
192
- <script type="text/javascript" language="JavaScript">
193
- <!--
198
+ <script language="JavaScript" type="text/javascript">
199
+ // <![CDATA[
200
+
194
201
  function toggleSource( id )
195
202
  {
196
203
  var elem
197
204
  var link
198
205
 
199
- if( document.all )
206
+ if( document.getElementById )
207
+ {
208
+ elem = document.getElementById( id )
209
+ link = document.getElementById( "l_" + id )
210
+ }
211
+ else if ( document.all )
200
212
  {
201
213
  elem = eval( "document.all." + id )
202
214
  link = eval( "document.all.l_" + id )
203
215
  }
204
216
  else
205
- {
206
- elem = document.getElementById( id )
207
- link = document.getElementById( "l_" + id )
208
- }
217
+ return false;
209
218
 
210
219
  if( elem.style.display == "block" )
211
220
  {
@@ -223,89 +232,12 @@ BODY = <<HTML
223
232
  {
224
233
  window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
225
234
  }
226
- //-->
235
+ // ]]>
227
236
  </script>
228
237
  </head>
229
238
 
230
239
  <body>
231
- !INCLUDE! <!-- banner header -->
232
-
233
- <div id="content">
234
- IF:diagram
235
- <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center">
236
- %diagram%
237
- </td></tr></table>
238
- ENDIF:diagram
239
-
240
- IF:description
241
- <div class="description">%description%</div>
242
- ENDIF:description
243
-
244
- IF:requires
245
- <div class="sectiontitle">Required Files</div>
246
- <ul>
247
- START:requires
248
- <li>HREF:aref:name:</li>
249
- END:requires
250
- </ul>
251
- ENDIF:requires
252
-
253
- IF:methods
254
- <div class="sectiontitle">Methods</div>
255
- <ul>
256
- START:methods
257
- <li>HREF:aref:name:</li>
258
- END:methods
259
- </ul>
260
- ENDIF:methods
261
-
262
- IF:constants
263
- <div class="sectiontitle">Constants</div>
264
- <table border='0' cellpadding='5'>
265
- START:constants
266
- <tr valign='top'>
267
- <td class="attr-name">%name%</td>
268
- <td>=</td>
269
- <td class="attr-value">%value%</td>
270
- </tr>
271
- IF:desc
272
- <tr valign='top'>
273
- <td>&nbsp;</td>
274
- <td colspan="2" class="attr-desc">%desc%</td>
275
- </tr>
276
- ENDIF:desc
277
- END:constants
278
- </table>
279
- ENDIF:constants
280
-
281
- IF:attributes
282
- <div class="sectiontitle">Attributes</div>
283
- <table border='0' cellpadding='5'>
284
- START:attributes
285
- <tr valign='top'>
286
- <td class='attr-rw'>
287
- IF:rw
288
- [%rw%]
289
- ENDIF:rw
290
- </td>
291
- <td class='attr-name'>%name%</td>
292
- <td class='attr-desc'>%a_desc%</td>
293
- </tr>
294
- END:attributes
295
- </table>
296
- ENDIF:attributes
297
-
298
- IF:classlist
299
- <div class="sectiontitle">Classes and Modules</div>
300
- %classlist%
301
- ENDIF:classlist
302
-
303
- !INCLUDE! <!-- method descriptions -->
304
-
305
- </div>
306
- </body>
307
- </html>
308
- HTML
240
+ ENDHEADER
309
241
 
310
242
  FILE_PAGE = <<HTML
311
243
  <table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'>
@@ -374,6 +306,44 @@ HTML
374
306
  ###################################################################
375
307
 
376
308
  METHOD_LIST = <<HTML
309
+ <div id="content">
310
+ IF:diagram
311
+ <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center">
312
+ %diagram%
313
+ </td></tr></table>
314
+ ENDIF:diagram
315
+
316
+ IF:description
317
+ <div class="description">%description%</div>
318
+ ENDIF:description
319
+
320
+ IF:requires
321
+ <div class="sectiontitle">Required Files</div>
322
+ <ul>
323
+ START:requires
324
+ <li>HREF:aref:name:</li>
325
+ END:requires
326
+ </ul>
327
+ ENDIF:requires
328
+
329
+ IF:toc
330
+ <div class="sectiontitle">Contents</div>
331
+ <ul>
332
+ START:toc
333
+ <li><a href="#%href%">%secname%</a></li>
334
+ END:toc
335
+ </ul>
336
+ ENDIF:toc
337
+
338
+ IF:methods
339
+ <div class="sectiontitle">Methods</div>
340
+ <ul>
341
+ START:methods
342
+ <li>HREF:aref:name:</li>
343
+ END:methods
344
+ </ul>
345
+ ENDIF:methods
346
+
377
347
  IF:includes
378
348
  <div class="sectiontitle">Included Modules</div>
379
349
  <ul>
@@ -383,6 +353,57 @@ END:includes
383
353
  </ul>
384
354
  ENDIF:includes
385
355
 
356
+ START:sections
357
+ IF:sectitle
358
+ <div class="sectiontitle"><a nem="%secsequence%">%sectitle%</a></div>
359
+ IF:seccomment
360
+ <div class="description">
361
+ %seccomment%
362
+ </div>
363
+ ENDIF:seccomment
364
+ ENDIF:sectitle
365
+
366
+ IF:classlist
367
+ <div class="sectiontitle">Classes and Modules</div>
368
+ %classlist%
369
+ ENDIF:classlist
370
+
371
+ IF:constants
372
+ <div class="sectiontitle">Constants</div>
373
+ <table border='0' cellpadding='5'>
374
+ START:constants
375
+ <tr valign='top'>
376
+ <td class="attr-name">%name%</td>
377
+ <td>=</td>
378
+ <td class="attr-value">%value%</td>
379
+ </tr>
380
+ IF:desc
381
+ <tr valign='top'>
382
+ <td>&nbsp;</td>
383
+ <td colspan="2" class="attr-desc">%desc%</td>
384
+ </tr>
385
+ ENDIF:desc
386
+ END:constants
387
+ </table>
388
+ ENDIF:constants
389
+
390
+ IF:attributes
391
+ <div class="sectiontitle">Attributes</div>
392
+ <table border='0' cellpadding='5'>
393
+ START:attributes
394
+ <tr valign='top'>
395
+ <td class='attr-rw'>
396
+ IF:rw
397
+ [%rw%]
398
+ ENDIF:rw
399
+ </td>
400
+ <td class='attr-name'>%name%</td>
401
+ <td class='attr-desc'>%a_desc%</td>
402
+ </tr>
403
+ END:attributes
404
+ </table>
405
+ ENDIF:attributes
406
+
386
407
  IF:method_list
387
408
  START:method_list
388
409
  IF:methods
@@ -415,8 +436,8 @@ END:aka
415
436
  ENDIF:aka
416
437
  IF:sourcecode
417
438
  <div class="sourcecode">
418
- <p class="source-link">[ <a href="javascript:toggleSource('%aref%-source')" id="l_%aref%-source">show source</a> ]</p>
419
- <div id="%aref%-source" class="dyn-source">
439
+ <p class="source-link">[ <a href="javascript:toggleSource('%aref%_source')" id="l_%aref%_source">show source</a> ]</p>
440
+ <div id="%aref%_source" class="dyn-source">
420
441
  <pre>
421
442
  %sourcecode%
422
443
  </pre>
@@ -428,14 +449,28 @@ END:methods
428
449
  ENDIF:methods
429
450
  END:method_list
430
451
  ENDIF:method_list
452
+ END:sections
453
+ </div>
431
454
  HTML
432
455
 
433
- =begin
434
- =end
456
+ FOOTER = <<ENDFOOTER
457
+ </body>
458
+ </html>
459
+ ENDFOOTER
460
+
461
+ BODY = HEADER + <<ENDBODY
462
+ !INCLUDE! <!-- banner header -->
463
+
464
+ <div id="bodyContent">
465
+ #{METHOD_LIST}
466
+ </div>
467
+
468
+ #{FOOTER}
469
+ ENDBODY
435
470
 
436
471
  ########################## Source code ##########################
437
472
 
438
- SRC_PAGE = <<HTML
473
+ SRC_PAGE = XHTML_PREAMBLE + <<HTML
439
474
  <html>
440
475
  <head><title>%title%</title>
441
476
  <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
@@ -467,7 +502,7 @@ FR_INDEX_BODY = <<HTML
467
502
  !INCLUDE!
468
503
  HTML
469
504
 
470
- FILE_INDEX = <<HTML
505
+ FILE_INDEX = XHTML_PREAMBLE + <<HTML
471
506
  <html>
472
507
  <head>
473
508
  <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
@@ -494,6 +529,7 @@ FILE_INDEX = <<HTML
494
529
  a {
495
530
  color: #00F;
496
531
  text-decoration: none;
532
+ white-space: nowrap;
497
533
  }
498
534
  a:hover {
499
535
  color: #77F;
@@ -516,8 +552,8 @@ HTML
516
552
  CLASS_INDEX = FILE_INDEX
517
553
  METHOD_INDEX = FILE_INDEX
518
554
 
519
- INDEX = <<HTML
520
- <html>
555
+ INDEX = XHTML_PREAMBLE + <<HTML
556
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
521
557
  <head>
522
558
  <title>%title%</title>
523
559
  <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
@@ -549,16 +585,7 @@ ENDIF:inline_source
549
585
  </html>
550
586
  HTML
551
587
 
552
- # and a blank page to use as a target
553
- BLANK = %{
554
- <html><body bgcolor="white"></body></html>
555
- }
556
-
557
- def write_extra_pages
558
- template = TemplatePage.new(BLANK)
559
- File.open("blank.html", "w") { |f| template.write_html_on(f, {}) }
560
- end
561
-
562
588
  end
563
589
  end
564
590
 
591
+