rake 0.9.2 → 13.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.rdoc +43 -0
  3. data/Gemfile +10 -0
  4. data/History.rdoc +2386 -0
  5. data/MIT-LICENSE +1 -1
  6. data/README.rdoc +64 -109
  7. data/Rakefile +22 -386
  8. data/bin/bundle +105 -0
  9. data/bin/console +7 -0
  10. data/bin/rake +20 -23
  11. data/bin/rdoc +29 -0
  12. data/bin/rubocop +29 -0
  13. data/bin/setup +6 -0
  14. data/doc/command_line_usage.rdoc +65 -21
  15. data/doc/glossary.rdoc +40 -49
  16. data/doc/jamis.rb +1 -0
  17. data/doc/rake.1 +156 -0
  18. data/doc/rakefile.rdoc +127 -62
  19. data/exe/rake +27 -0
  20. data/lib/rake.rb +37 -31
  21. data/lib/rake/application.rb +507 -272
  22. data/lib/rake/backtrace.rb +24 -0
  23. data/lib/rake/clean.rb +55 -8
  24. data/lib/rake/cloneable.rb +11 -19
  25. data/lib/rake/cpu_counter.rb +107 -0
  26. data/lib/rake/default_loader.rb +5 -0
  27. data/lib/rake/dsl_definition.rb +74 -46
  28. data/lib/rake/early_time.rb +5 -1
  29. data/lib/rake/ext/core.rb +5 -6
  30. data/lib/rake/ext/string.rb +61 -52
  31. data/lib/rake/file_creation_task.rb +4 -3
  32. data/lib/rake/file_list.rb +81 -49
  33. data/lib/rake/file_task.rb +15 -8
  34. data/lib/rake/file_utils.rb +69 -47
  35. data/lib/rake/file_utils_ext.rb +18 -26
  36. data/lib/rake/invocation_chain.rb +25 -19
  37. data/lib/rake/invocation_exception_mixin.rb +1 -0
  38. data/lib/rake/late_time.rb +18 -0
  39. data/lib/rake/linked_list.rb +112 -0
  40. data/lib/rake/loaders/makefile.rb +23 -9
  41. data/lib/rake/multi_task.rb +4 -6
  42. data/lib/rake/name_space.rb +36 -23
  43. data/lib/rake/packagetask.rb +71 -34
  44. data/lib/rake/phony.rb +16 -0
  45. data/lib/rake/private_reader.rb +21 -0
  46. data/lib/rake/promise.rb +100 -0
  47. data/lib/rake/pseudo_status.rb +8 -2
  48. data/lib/rake/rake_module.rb +41 -3
  49. data/lib/rake/rake_test_loader.rb +21 -7
  50. data/lib/rake/rule_recursion_overflow_error.rb +2 -2
  51. data/lib/rake/scope.rb +43 -0
  52. data/lib/rake/task.rb +186 -79
  53. data/lib/rake/task_argument_error.rb +1 -0
  54. data/lib/rake/task_arguments.rb +50 -15
  55. data/lib/rake/task_manager.rb +89 -65
  56. data/lib/rake/tasklib.rb +2 -12
  57. data/lib/rake/testtask.rb +61 -63
  58. data/lib/rake/thread_history_display.rb +49 -0
  59. data/lib/rake/thread_pool.rb +163 -0
  60. data/lib/rake/trace_output.rb +23 -0
  61. data/lib/rake/version.rb +7 -7
  62. data/lib/rake/win32.rb +14 -18
  63. data/rake.gemspec +43 -0
  64. metadata +82 -221
  65. data/.gemtest +0 -0
  66. data/CHANGES +0 -509
  67. data/RRR +0 -9
  68. data/TODO +0 -20
  69. data/doc/rake.1.gz +0 -0
  70. data/doc/release_notes/rake-0.4.14.rdoc +0 -23
  71. data/doc/release_notes/rake-0.4.15.rdoc +0 -35
  72. data/doc/release_notes/rake-0.5.0.rdoc +0 -53
  73. data/doc/release_notes/rake-0.5.3.rdoc +0 -78
  74. data/doc/release_notes/rake-0.5.4.rdoc +0 -46
  75. data/doc/release_notes/rake-0.6.0.rdoc +0 -141
  76. data/doc/release_notes/rake-0.7.0.rdoc +0 -119
  77. data/doc/release_notes/rake-0.7.1.rdoc +0 -59
  78. data/doc/release_notes/rake-0.7.2.rdoc +0 -121
  79. data/doc/release_notes/rake-0.7.3.rdoc +0 -47
  80. data/doc/release_notes/rake-0.8.0.rdoc +0 -114
  81. data/doc/release_notes/rake-0.8.2.rdoc +0 -165
  82. data/doc/release_notes/rake-0.8.3.rdoc +0 -112
  83. data/doc/release_notes/rake-0.8.4.rdoc +0 -147
  84. data/doc/release_notes/rake-0.8.5.rdoc +0 -53
  85. data/doc/release_notes/rake-0.8.6.rdoc +0 -55
  86. data/doc/release_notes/rake-0.8.7.rdoc +0 -55
  87. data/doc/release_notes/rake-0.9.0.rdoc +0 -112
  88. data/doc/release_notes/rake-0.9.1.rdoc +0 -52
  89. data/doc/release_notes/rake-0.9.2.rdoc +0 -49
  90. data/install.rb +0 -90
  91. data/lib/rake/alt_system.rb +0 -109
  92. data/lib/rake/classic_namespace.rb +0 -9
  93. data/lib/rake/contrib/compositepublisher.rb +0 -21
  94. data/lib/rake/contrib/ftptools.rb +0 -150
  95. data/lib/rake/contrib/publisher.rb +0 -69
  96. data/lib/rake/contrib/rubyforgepublisher.rb +0 -16
  97. data/lib/rake/contrib/sshpublisher.rb +0 -45
  98. data/lib/rake/contrib/sys.rb +0 -191
  99. data/lib/rake/ext/module.rb +0 -39
  100. data/lib/rake/ext/time.rb +0 -14
  101. data/lib/rake/gempackagetask.rb +0 -13
  102. data/lib/rake/pathmap.rb +0 -1
  103. data/lib/rake/rdoctask.rb +0 -230
  104. data/lib/rake/ruby182_test_unit_fix.rb +0 -25
  105. data/lib/rake/runtest.rb +0 -21
  106. data/test/check_expansion.rb +0 -5
  107. data/test/check_no_expansion.rb +0 -5
  108. data/test/data/access/Rakefile +0 -35
  109. data/test/data/chains/Rakefile +0 -15
  110. data/test/data/comments/Rakefile +0 -18
  111. data/test/data/default/Rakefile +0 -17
  112. data/test/data/deprecated_import/Rakefile +0 -1
  113. data/test/data/dryrun/Rakefile +0 -22
  114. data/test/data/extra/Rakefile +0 -1
  115. data/test/data/file_creation_task/Rakefile +0 -31
  116. data/test/data/imports/Rakefile +0 -19
  117. data/test/data/imports/deps.mf +0 -1
  118. data/test/data/multidesc/Rakefile +0 -15
  119. data/test/data/namespace/Rakefile +0 -64
  120. data/test/data/rakelib/test1.rb +0 -4
  121. data/test/data/rbext/rakefile.rb +0 -3
  122. data/test/data/sample.mf +0 -14
  123. data/test/data/statusreturn/Rakefile +0 -6
  124. data/test/data/unittest/Rakefile +0 -1
  125. data/test/data/verbose/Rakefile +0 -34
  126. data/test/file_creation.rb +0 -34
  127. data/test/helper.rb +0 -44
  128. data/test/in_environment.rb +0 -35
  129. data/test/reqfile.rb +0 -3
  130. data/test/reqfile2.rb +0 -3
  131. data/test/shellcommand.rb +0 -3
  132. data/test/test_rake.rb +0 -38
  133. data/test/test_rake_application.rb +0 -364
  134. data/test/test_rake_application_options.rb +0 -382
  135. data/test/test_rake_clean.rb +0 -12
  136. data/test/test_rake_definitions.rb +0 -80
  137. data/test/test_rake_directory_task.rb +0 -55
  138. data/test/test_rake_dsl.rb +0 -73
  139. data/test/test_rake_early_time.rb +0 -31
  140. data/test/test_rake_extension.rb +0 -59
  141. data/test/test_rake_file_creation_task.rb +0 -62
  142. data/test/test_rake_file_list.rb +0 -633
  143. data/test/test_rake_file_list_path_map.rb +0 -8
  144. data/test/test_rake_file_task.rb +0 -104
  145. data/test/test_rake_file_utils.rb +0 -252
  146. data/test/test_rake_ftp_file.rb +0 -59
  147. data/test/test_rake_functional.rb +0 -468
  148. data/test/test_rake_invocation_chain.rb +0 -52
  149. data/test/test_rake_makefile_loader.rb +0 -23
  150. data/test/test_rake_multi_task.rb +0 -51
  151. data/test/test_rake_name_space.rb +0 -43
  152. data/test/test_rake_package_task.rb +0 -78
  153. data/test/test_rake_path_map.rb +0 -157
  154. data/test/test_rake_path_map_explode.rb +0 -31
  155. data/test/test_rake_path_map_partial.rb +0 -18
  156. data/test/test_rake_pseudo_status.rb +0 -20
  157. data/test/test_rake_rdoc_task.rb +0 -81
  158. data/test/test_rake_require.rb +0 -35
  159. data/test/test_rake_rules.rb +0 -346
  160. data/test/test_rake_task.rb +0 -271
  161. data/test/test_rake_task_argument_parsing.rb +0 -116
  162. data/test/test_rake_task_arguments.rb +0 -86
  163. data/test/test_rake_task_lib.rb +0 -9
  164. data/test/test_rake_task_manager.rb +0 -145
  165. data/test/test_rake_task_manager_argument_resolution.rb +0 -36
  166. data/test/test_rake_task_with_arguments.rb +0 -162
  167. data/test/test_rake_test_task.rb +0 -122
  168. data/test/test_rake_top_level_functions.rb +0 -76
  169. data/test/test_rake_win32.rb +0 -83
  170. data/test/test_sys.rb +0 -20
@@ -1,25 +0,0 @@
1
- # Local Rake override to fix bug in Ruby 0.8.2
2
- module Test # :nodoc:
3
- # Local Rake override to fix bug in Ruby 0.8.2
4
- module Unit # :nodoc:
5
- # Local Rake override to fix bug in Ruby 0.8.2
6
- module Collector # :nodoc:
7
- # Local Rake override to fix bug in Ruby 0.8.2
8
- class Dir # :nodoc:
9
- undef collect_file
10
- def collect_file(name, suites, already_gathered) # :nodoc:
11
- dir = File.dirname(File.expand_path(name))
12
- $:.unshift(dir) unless $:.first == dir
13
- if(@req)
14
- @req.require(name)
15
- else
16
- require(name)
17
- end
18
- find_test_cases(already_gathered).each{|t| add_suite(suites, t.suite)}
19
- ensure
20
- $:.delete_at $:.rindex(dir)
21
- end
22
- end
23
- end
24
- end
25
- end
data/lib/rake/runtest.rb DELETED
@@ -1,21 +0,0 @@
1
- require 'test/unit'
2
- require 'test/unit/assertions'
3
-
4
- module Rake
5
- include Test::Unit::Assertions
6
-
7
- def run_tests(pattern='test/test*.rb', log_enabled=false)
8
- Dir["#{pattern}"].each { |fn|
9
- $stderr.puts fn if log_enabled
10
- begin
11
- require fn
12
- rescue Exception => ex
13
- $stderr.puts "Error in #{fn}: #{ex.message}"
14
- $stderr.puts ex.backtrace
15
- assert false
16
- end
17
- }
18
- end
19
-
20
- extend self
21
- end
@@ -1,5 +0,0 @@
1
- if ARGV[0] != ARGV[1]
2
- exit 1
3
- else
4
- exit 0
5
- end
@@ -1,5 +0,0 @@
1
- if ARGV[0] != ARGV[1]
2
- exit 0
3
- else
4
- exit 1
5
- end
@@ -1,35 +0,0 @@
1
- TOP_LEVEL_CONSTANT = 0
2
-
3
- def a_top_level_function
4
- end
5
-
6
- task :default => [:work, :obj, :const]
7
-
8
- task :work do
9
- begin
10
- a_top_level_function
11
- puts "GOOD:M Top level methods can be called in tasks"
12
- rescue NameError => ex
13
- puts "BAD:M Top level methods can not be called in tasks"
14
- end
15
- end
16
-
17
- # TODO: remove `disabled_' when DeprecatedObjectDSL removed
18
- task :obj
19
- task :disabled_obj do
20
- begin
21
- Object.new.instance_eval { task :xyzzy }
22
- puts "BAD:D Rake DSL are polluting objects"
23
- rescue StandardError => ex
24
- puts "GOOD:D Rake DSL are not polluting objects"
25
- end
26
- end
27
-
28
- task :const do
29
- begin
30
- TOP_LEVEL_CONSTANT
31
- puts "GOOD:C Top level constants are available in tasks"
32
- rescue StandardError => ex
33
- puts "BAD:C Top level constants are NOT available in tasks"
34
- end
35
- end
@@ -1,15 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- task :default => "play.app"
4
-
5
- file "play.scpt" => "base" do |t|
6
- cp t.prerequisites.first, t.name
7
- end
8
-
9
- rule ".app" => ".scpt" do |t|
10
- cp t.source, t.name
11
- end
12
-
13
- file 'base' do
14
- touch 'base'
15
- end
@@ -1,18 +0,0 @@
1
- # comment for t1
2
- task :t1 do
3
- end
4
-
5
- # no comment or task because there's a blank line
6
-
7
- task :t2 do
8
- end
9
-
10
- desc "override comment for t3"
11
- # this is not the description
12
- multitask :t3 do
13
- end
14
-
15
- # this is not the description
16
- desc "override comment for t4"
17
- file :t4 do
18
- end
@@ -1,17 +0,0 @@
1
- if ENV['TESTTOPSCOPE']
2
- puts "TOPSCOPE"
3
- end
4
-
5
- task :default do
6
- puts "DEFAULT"
7
- end
8
-
9
- task :other => [:default] do
10
- puts "OTHER"
11
- end
12
-
13
- task :task_scope do
14
- if ENV['TESTTASKSCOPE']
15
- puts "TASKSCOPE"
16
- end
17
- end
@@ -1 +0,0 @@
1
- import "a"
@@ -1,22 +0,0 @@
1
- #
2
-
3
- task :default => ["temp_main"]
4
-
5
- file "temp_main" => [:all_apps] do touch "temp_main" end
6
-
7
- task :all_apps => [:one, :two]
8
- task :one => ["temp_one"]
9
- task :two => ["temp_two"]
10
-
11
- file "temp_one" do |t|
12
- touch "temp_one"
13
- end
14
- file "temp_two" do |t|
15
- touch "temp_two"
16
- end
17
-
18
- task :clean do
19
- ["temp_one", "temp_two", "temp_main"].each do |file|
20
- rm_f file
21
- end
22
- end
@@ -1 +0,0 @@
1
- task :default
@@ -1,31 +0,0 @@
1
- N = 2
2
-
3
- task :default => :run
4
-
5
- BUILD_DIR = 'build'
6
- task :clean do
7
- rm_rf 'build'
8
- rm_rf 'src'
9
- end
10
-
11
- task :run
12
-
13
- TARGET_DIR = 'build/copies'
14
-
15
- FileList['src/*'].each do |src|
16
- directory TARGET_DIR
17
- target = File.join TARGET_DIR, File.basename(src)
18
- file target => [src, TARGET_DIR] do
19
- cp src, target
20
- # sleep 3 if src !~ /foo#{N-1}$/ # I'm commenting out this sleep, it doesn't seem to do anything.
21
- end
22
- task :run => target
23
- end
24
-
25
- task :prep => :clean do
26
- mkdir_p 'src'
27
- N.times do |n|
28
- puts "DBG: Touching src/foo#{n}"
29
- touch "src/foo#{n}"
30
- end
31
- end
@@ -1,19 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- require 'rake/loaders/makefile'
4
-
5
- task :default
6
-
7
- task :other do
8
- puts "OTHER"
9
- end
10
-
11
- file "dynamic_deps" do |t|
12
- open(t.name, "w") do |f| f.puts "puts 'DYNAMIC'" end
13
- end
14
-
15
- import "dynamic_deps"
16
- import "static_deps"
17
- import "static_deps"
18
- import "deps.mf"
19
- puts "FIRST"
@@ -1 +0,0 @@
1
- default: other
@@ -1,15 +0,0 @@
1
- task :b
2
-
3
- desc "A"
4
- task :a
5
-
6
- desc "B"
7
- task :b
8
-
9
- desc "A2"
10
- task :a
11
-
12
- task :c
13
-
14
- desc "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
15
- task :d
@@ -1,64 +0,0 @@
1
- desc "copy"
2
- task :copy do
3
- puts "COPY"
4
- end
5
-
6
- namespace "nest" do
7
- desc "nest copy"
8
- task :copy do
9
- puts "NEST COPY"
10
- end
11
- task :xx => :copy
12
- end
13
-
14
- anon_ns = namespace do
15
- desc "anonymous copy task"
16
- task :copy do
17
- puts "ANON COPY"
18
- end
19
- end
20
-
21
- desc "Top level task to run the anonymous version of copy"
22
- task :anon => anon_ns[:copy]
23
-
24
- namespace "very" do
25
- namespace "nested" do
26
- task "run" => "rake:copy"
27
- end
28
- end
29
-
30
- namespace "a" do
31
- desc "Run task in the 'a' namespace"
32
- task "run" do
33
- puts "IN A"
34
- end
35
- end
36
-
37
- namespace "b" do
38
- desc "Run task in the 'b' namespace"
39
- task "run" => "a:run" do
40
- puts "IN B"
41
- end
42
- end
43
-
44
- namespace "file1" do
45
- file "xyz.rb" do
46
- puts "XYZ1"
47
- end
48
- end
49
-
50
- namespace "file2" do
51
- file "xyz.rb" do
52
- puts "XYZ2"
53
- end
54
- end
55
-
56
- namespace "scopedep" do
57
- task :prepare do
58
- touch "scopedep.rb"
59
- puts "PREPARE"
60
- end
61
- file "scopedep.rb" => [:prepare] do
62
- puts "SCOPEDEP"
63
- end
64
- end
@@ -1,4 +0,0 @@
1
-
2
- task :default do
3
- puts "TEST1"
4
- end
@@ -1,3 +0,0 @@
1
- task :default do
2
- puts "OK"
3
- end
data/test/data/sample.mf DELETED
@@ -1,14 +0,0 @@
1
- # Comments
2
- a: a1 a2 a3 a4
3
- b: b1 b2 b3 \
4
- b4 b5 b6\
5
- # Mid: Comment
6
- b7
7
-
8
- a : a5 a6 a7
9
- c: c1
10
- d: d1 d2 \
11
-
12
- e f : e1 f1
13
-
14
- g\ 0: g1 g\ 2 g\ 3 g4
@@ -1,6 +0,0 @@
1
- task :exit5 do
2
- exit(5)
3
- end
4
-
5
- task :normal do
6
- end
@@ -1 +0,0 @@
1
- # Empty Rakefile for Unit Test
@@ -1,34 +0,0 @@
1
-
2
- task :standalone_verbose_true do
3
- verbose true
4
- sh "ruby -e '0'"
5
- end
6
-
7
- task :standalone_verbose_false do
8
- verbose false
9
- sh "ruby -e '0'"
10
- end
11
-
12
- task :inline_verbose_default do
13
- sh "ruby -e '0'"
14
- end
15
-
16
- task :inline_verbose_false do
17
- sh "ruby -e '0'", :verbose => false
18
- end
19
-
20
- task :inline_verbose_true do
21
- sh "ruby -e '0'", :verbose => true
22
- end
23
-
24
- task :block_verbose_true do
25
- verbose(true) do
26
- sh "ruby -e '0'"
27
- end
28
- end
29
-
30
- task :block_verbose_false do
31
- verbose(false) do
32
- sh "ruby -e '0'"
33
- end
34
- end
@@ -1,34 +0,0 @@
1
- module FileCreation
2
- OLDFILE = "testdata/old"
3
- NEWFILE = "testdata/new"
4
-
5
- def create_timed_files(oldfile, *newfiles)
6
- return if (File.exist?(oldfile) &&
7
- newfiles.all? { |newfile|
8
- File.exist?(newfile) && File.stat(newfile).mtime > File.stat(oldfile).mtime
9
- })
10
- now = Time.now
11
-
12
- create_file(oldfile, now - 60)
13
-
14
- newfiles.each do |newfile|
15
- create_file(newfile, now)
16
- end
17
- end
18
-
19
- def create_dir(dirname)
20
- FileUtils.mkdir_p(dirname) unless File.exist?(dirname)
21
- File.stat(dirname).mtime
22
- end
23
-
24
- def create_file(name, file_time=nil)
25
- create_dir(File.dirname(name))
26
- FileUtils.touch(name) unless File.exist?(name)
27
- File.utime(file_time, file_time, name) unless file_time.nil?
28
- File.stat(name).mtime
29
- end
30
-
31
- def delete_file(name)
32
- File.delete(name) rescue nil
33
- end
34
- end
data/test/helper.rb DELETED
@@ -1,44 +0,0 @@
1
- require 'rubygems'
2
- require 'minitest/unit'
3
- require 'flexmock/test_unit_integration'
4
- require 'minitest/autorun'
5
- require 'rake'
6
- require File.expand_path('../file_creation', __FILE__)
7
- require File.expand_path('../in_environment', __FILE__)
8
-
9
- class Rake::TestCase < MiniTest::Unit::TestCase
10
- include FlexMock::ArgumentTypes
11
- include FlexMock::MockContainer
12
-
13
- include InEnvironment
14
- include FileCreation
15
-
16
- include Rake::DSL
17
-
18
- class TaskManager
19
- include Rake::TaskManager
20
- end
21
-
22
- def setup
23
- @orig_PWD = Dir.pwd
24
- end
25
-
26
- def teardown
27
- flexmock_teardown
28
-
29
- Dir.chdir @orig_PWD
30
- end
31
-
32
- def ignore_deprecations
33
- Rake.application.options.ignore_deprecate = true
34
- yield
35
- ensure
36
- Rake.application.options.ignore_deprecate = false
37
- end
38
-
39
- end
40
-
41
- # workarounds for 1.8
42
- $" << 'test/helper.rb'
43
- Test::Unit.run = true if Test::Unit.respond_to? :run=
44
-