rake 0.4.11 → 13.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/History.rdoc +2454 -0
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +155 -0
  5. data/doc/command_line_usage.rdoc +171 -0
  6. data/doc/glossary.rdoc +40 -49
  7. data/doc/jamis.rb +135 -107
  8. data/doc/proto_rake.rdoc +22 -22
  9. data/doc/rake.1 +156 -0
  10. data/doc/rakefile.rdoc +428 -27
  11. data/doc/rational.rdoc +6 -6
  12. data/exe/rake +27 -0
  13. data/lib/rake/application.rb +847 -0
  14. data/lib/rake/backtrace.rb +25 -0
  15. data/lib/rake/clean.rb +57 -10
  16. data/lib/rake/cloneable.rb +17 -0
  17. data/lib/rake/cpu_counter.rb +122 -0
  18. data/lib/rake/default_loader.rb +15 -0
  19. data/lib/rake/dsl_definition.rb +196 -0
  20. data/lib/rake/early_time.rb +22 -0
  21. data/lib/rake/ext/core.rb +26 -0
  22. data/lib/rake/ext/string.rb +176 -0
  23. data/lib/rake/file_creation_task.rb +25 -0
  24. data/lib/rake/file_list.rb +435 -0
  25. data/lib/rake/file_task.rb +58 -0
  26. data/lib/rake/file_utils.rb +137 -0
  27. data/lib/rake/file_utils_ext.rb +135 -0
  28. data/lib/rake/invocation_chain.rb +57 -0
  29. data/lib/rake/invocation_exception_mixin.rb +17 -0
  30. data/lib/rake/late_time.rb +18 -0
  31. data/lib/rake/linked_list.rb +112 -0
  32. data/lib/rake/loaders/makefile.rb +54 -0
  33. data/lib/rake/multi_task.rb +14 -0
  34. data/lib/rake/name_space.rb +38 -0
  35. data/lib/rake/options.rb +31 -0
  36. data/lib/rake/packagetask.rb +124 -54
  37. data/lib/rake/phony.rb +16 -0
  38. data/lib/rake/private_reader.rb +21 -0
  39. data/lib/rake/promise.rb +100 -0
  40. data/lib/rake/pseudo_status.rb +30 -0
  41. data/lib/rake/rake_module.rb +67 -0
  42. data/lib/rake/rake_test_loader.rb +27 -0
  43. data/lib/rake/rule_recursion_overflow_error.rb +20 -0
  44. data/lib/rake/scope.rb +43 -0
  45. data/lib/rake/task.rb +434 -0
  46. data/lib/rake/task_argument_error.rb +8 -0
  47. data/lib/rake/task_arguments.rb +113 -0
  48. data/lib/rake/task_manager.rb +333 -0
  49. data/lib/rake/tasklib.rb +4 -16
  50. data/lib/rake/testtask.rb +110 -36
  51. data/lib/rake/thread_history_display.rb +49 -0
  52. data/lib/rake/thread_pool.rb +157 -0
  53. data/lib/rake/trace_output.rb +23 -0
  54. data/lib/rake/version.rb +10 -0
  55. data/lib/rake/win32.rb +17 -0
  56. data/lib/rake.rb +64 -992
  57. data/rake.gemspec +102 -0
  58. metadata +117 -89
  59. data/CHANGES +0 -153
  60. data/README +0 -209
  61. data/Rakefile +0 -215
  62. data/TODO +0 -19
  63. data/bin/rake +0 -8
  64. data/install.rb +0 -88
  65. data/lib/rake/contrib/compositepublisher.rb +0 -24
  66. data/lib/rake/contrib/ftptools.rb +0 -139
  67. data/lib/rake/contrib/publisher.rb +0 -75
  68. data/lib/rake/contrib/rubyforgepublisher.rb +0 -18
  69. data/lib/rake/contrib/sshpublisher.rb +0 -47
  70. data/lib/rake/contrib/sys.rb +0 -207
  71. data/lib/rake/gempackagetask.rb +0 -98
  72. data/lib/rake/rdoctask.rb +0 -128
  73. data/lib/rake/runtest.rb +0 -23
  74. data/test/contrib/testsys.rb +0 -47
  75. data/test/data/rbext/rakefile.rb +0 -3
  76. data/test/filecreation.rb +0 -26
  77. data/test/functional.rb +0 -82
  78. data/test/shellcommand.rb +0 -3
  79. data/test/testclean.rb +0 -13
  80. data/test/testfilelist.rb +0 -255
  81. data/test/testfileutils.rb +0 -83
  82. data/test/testftp.rb +0 -55
  83. data/test/testpackagetask.rb +0 -81
  84. data/test/testtasks.rb +0 -371
  85. data/test/testtesttask.rb +0 -71
@@ -1,207 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- #--
4
- # Copyright (c) 2003, 2004 Jim Weirich
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining
7
- # a copy of this software and associated documentation files (the
8
- # "Software"), to deal in the Software without restriction, including
9
- # without limitation the rights to use, copy, modify, merge, publish,
10
- # distribute, sublicense, and/or sell copies of the Software, and to
11
- # permit persons to whom the Software is furnished to do so, subject to
12
- # the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be
15
- # included in all copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
- #++
25
- #
26
- require 'ftools'
27
- require 'rbconfig'
28
-
29
- ######################################################################
30
- # Sys provides a number of file manipulation tools for the convenience
31
- # of writing Rakefiles. All commands in this module will announce
32
- # their activity on standard output if the $verbose flag is set
33
- # ($verbose = true is the default). You can control this by globally
34
- # setting $verbose or by using the +verbose+ and +quiet+ methods.
35
- #
36
- # Sys has been deprecated in favor of the FileUtils module available
37
- # in Ruby 1.8.
38
- #
39
- module Sys
40
- RUBY = Config::CONFIG['ruby_install_name']
41
-
42
- # Install all the files matching +wildcard+ into the +dest_dir+
43
- # directory. The permission mode is set to +mode+.
44
- def install(wildcard, dest_dir, mode)
45
- Dir[wildcard].each do |fn|
46
- File.install(fn, dest_dir, mode, $verbose)
47
- end
48
- end
49
-
50
- # Run the system command +cmd+.
51
- def run(cmd)
52
- log cmd
53
- system(cmd) or fail "Command Failed: [#{cmd}]"
54
- end
55
-
56
- # Run a Ruby interpreter with the given arguments.
57
- def ruby(*args)
58
- run "#{RUBY} #{args.join(' ')}"
59
- end
60
-
61
- # Copy a single file from +file_name+ to +dest_file+.
62
- def copy(file_name, dest_file)
63
- log "Copying file #{file_name} to #{dest_file}"
64
- File.copy(file_name, dest_file)
65
- end
66
-
67
- # Copy all files matching +wildcard+ into the directory +dest_dir+.
68
- def copy_files(wildcard, dest_dir)
69
- for_matching_files(wildcard, dest_dir) { |from, to| copy(from, to) }
70
- end
71
-
72
- # Link +file_name+ to +dest_file+.
73
- def link(file_name, dest_file)
74
- log "Linking file #{file_name} to #{dest_file}"
75
- File.link(file_name, dest_file)
76
- end
77
-
78
- # Link all files matching +wildcard+ into the directory +dest_dir+.
79
- def link_files(wildcard, dest_dir)
80
- for_matching_files(wildcard, dest_dir) { |from, to| link(from, to) }
81
- end
82
-
83
- # Symlink +file_name+ to +dest_file+.
84
- def symlink(file_name, dest_file)
85
- log "Symlinking file #{file_name} to #{dest_file}"
86
- File.symlink(file_name, dest_file)
87
- end
88
-
89
- # Symlink all files matching +wildcard+ into the directory +dest_dir+.
90
- def symlink_files(wildcard, dest_dir)
91
- for_matching_files(wildcard, dest_dir) { |from, to| link(from, to) }
92
- end
93
-
94
- # Remove all files matching +wildcard+. If a matching file is a
95
- # directory, it must be empty to be removed. used +delete_all+ to
96
- # recursively delete directories.
97
- def delete(*wildcards)
98
- wildcards.each do |wildcard|
99
- Dir[wildcard].each do |fn|
100
- if File.directory?(fn)
101
- log "Deleting directory #{fn}"
102
- Dir.delete(fn)
103
- else
104
- log "Deleting file #{fn}"
105
- File.delete(fn)
106
- end
107
- end
108
- end
109
- end
110
-
111
- # Recursively delete all files and directories matching +wildcard+.
112
- def delete_all(*wildcards)
113
- wildcards.each do |wildcard|
114
- Dir[wildcard].each do |fn|
115
- next if ! File.exist?(fn)
116
- if File.directory?(fn)
117
- Dir["#{fn}/*"].each do |subfn|
118
- next if subfn=='.' || subfn=='..'
119
- delete_all(subfn)
120
- end
121
- log "Deleting directory #{fn}"
122
- Dir.delete(fn)
123
- else
124
- log "Deleting file #{fn}"
125
- File.delete(fn)
126
- end
127
- end
128
- end
129
- end
130
-
131
- # Make the directories given in +dirs+.
132
- def makedirs(*dirs)
133
- dirs.each do |fn|
134
- log "Making directory #{fn}"
135
- File.makedirs(fn)
136
- end
137
- end
138
-
139
- # Make +dir+ the current working directory for the duration of
140
- # executing the given block.
141
- def indir(dir)
142
- olddir = Dir.pwd
143
- Dir.chdir(dir)
144
- yield
145
- ensure
146
- Dir.chdir(olddir)
147
- end
148
-
149
- # Split a file path into individual directory names.
150
- #
151
- # For example:
152
- # split_all("a/b/c") => ['a', 'b', 'c']
153
- def split_all(path)
154
- head, tail = File.split(path)
155
- return [tail] if head == '.' || tail == '/'
156
- return [head, tail] if head == '/'
157
- return split_all(head) + [tail]
158
- end
159
-
160
- # Write a message to standard out if $verbose is enabled.
161
- def log(msg)
162
- print " " if $trace && $verbose
163
- puts msg if $verbose
164
- end
165
-
166
- # Perform a block with $verbose disabled.
167
- def quiet(&block)
168
- with_verbose(false, &block)
169
- end
170
-
171
- # Perform a block with $verbose enabled.
172
- def verbose(&block)
173
- with_verbose(true, &block)
174
- end
175
-
176
- # Perform a block with each file matching a set of wildcards.
177
- def for_files(*wildcards)
178
- wildcards.each do |wildcard|
179
- Dir[wildcard].each do |fn|
180
- yield(fn)
181
- end
182
- end
183
- end
184
-
185
- extend(self)
186
-
187
- private # ----------------------------------------------------------
188
-
189
- def for_matching_files(wildcard, dest_dir)
190
- Dir[wildcard].each do |fn|
191
- dest_file = File.join(dest_dir, fn)
192
- parent = File.dirname(dest_file)
193
- makedirs(parent) if ! File.directory?(parent)
194
- yield(fn, dest_file)
195
- end
196
- end
197
-
198
- def with_verbose(v)
199
- oldverbose = $verbose
200
- $verbose = v
201
- yield
202
- ensure
203
- $verbose = oldverbose
204
- end
205
-
206
- end
207
-
@@ -1,98 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Define a package task library to aid in the definition of GEM
4
- # packages.
5
-
6
- require 'rubygems'
7
- require 'rake'
8
- require 'rake/packagetask'
9
-
10
- begin
11
- Gem.manage_gems
12
- rescue NoMethodError => ex
13
- # Using rubygems prior to 0.6.1
14
- end
15
-
16
- module Rake
17
-
18
- # Create a package based upon a Gem spec. Gem packages, as well as
19
- # zip files and tar/gzipped packages can be produced by this task.
20
- #
21
- # In addition to the Rake targets generated by PackageTask, a
22
- # GemPackageTask will also generate the following tasks:
23
- #
24
- # [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.gem"</b>]
25
- # Create a Ruby GEM package with the given name and version.
26
- #
27
- # Example using a Ruby GEM spec:
28
- #
29
- # require 'rubygems'
30
- #
31
- # spec = Gem::Specification.new do |s|
32
- # s.platform = Gem::Platform::RUBY
33
- # s.summary = "Ruby based make-like utility."
34
- # s.name = 'rake'
35
- # s.version = PKG_VERSION
36
- # s.requirements << 'none'
37
- # s.require_path = 'lib'
38
- # s.autorequire = 'rake'
39
- # s.files = PKG_FILES
40
- # s.description = <<EOF
41
- # Rake is a Make-like program implemented in Ruby. Tasks
42
- # and dependencies are specified in standard Ruby syntax.
43
- # EOF
44
- # end
45
- #
46
- # Rake::GemPackageTask.new(spec) do |pkg|
47
- # pkg.need_zip = true
48
- # pkg.need_tar = true
49
- # end
50
- #
51
- class GemPackageTask < PackageTask
52
- # Ruby GEM spec containing the metadata for this package. The
53
- # name, version and package_files are automatically determined
54
- # from the GEM spec and don't need to be explicitly provided.
55
- attr_accessor :gem_spec
56
-
57
- # Create a GEM Package task library. Automatically define the gem
58
- # if a block is given. If no block is supplied, then +define+
59
- # needs to be called to define the task.
60
- def initialize(gem_spec)
61
- init(gem_spec)
62
- yield self if block_given?
63
- define if block_given?
64
- end
65
-
66
- # Initialization tasks without the "yield self" or define
67
- # operations.
68
- def init(gem)
69
- super(gem.name, gem.version)
70
- @gem_spec = gem
71
- @package_files += gem_spec.files if gem_spec.files
72
- end
73
-
74
- # Create the Rake tasks and actions specified by this
75
- # GemPackageTask. (+define+ is automatically called if a block is
76
- # given to +new+).
77
- def define
78
- super
79
- task :package => [:gem]
80
- task :gem => ["#{package_dir}/#{gem_file}"]
81
- file "#{package_dir}/#{gem_file}" => [package_dir] + @gem_spec.files do
82
- when_writing("Creating GEM") {
83
- Gem::Builder.new(gem_spec).build
84
- verbose(true) {
85
- mv gem_file, "#{package_dir}/#{gem_file}"
86
- }
87
- }
88
- end
89
- end
90
-
91
- private
92
-
93
- def gem_file
94
- "#{package_name}.gem"
95
- end
96
-
97
- end
98
- end
data/lib/rake/rdoctask.rb DELETED
@@ -1,128 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'rake'
4
- require 'rake/tasklib'
5
-
6
- module Rake
7
-
8
- # Create a documentation task that will generate the RDoc files for
9
- # a project.
10
- #
11
- # The PackageTask will create the following targets:
12
- #
13
- # [<b><em>rdoc</em></b>]
14
- # Main task for this RDOC task.
15
- #
16
- # [<b>:clobber_<em>rdoc</em></b>]
17
- # Delete all the package files. This target is automatically
18
- # added to the main clobber target.
19
- #
20
- # [<b>:re<em>rdoc</em></b>]
21
- # Rebuild the package files from scratch, even if they are not out
22
- # of date.
23
- #
24
- # Simple Example:
25
- #
26
- # RDocTask.new do |rd|
27
- # rd.main = "README.rdoc"
28
- # rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
29
- # end
30
- #
31
- # You may wish to give the task a different name, such as if you are
32
- # generating two sets of documentation. For instance, if you want to have a
33
- # development set of documentation including private methods:
34
- #
35
- # RDocTask.new(:rdoc_dev) do |rd|
36
- # rd.main = "README.doc"
37
- # rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
38
- # rd.options << "--all"
39
- # end
40
- #
41
- # The tasks would then be named :<em>rdoc_dev</em>, :clobber_<em>rdoc_dev</em>, and
42
- # :re<em>rdoc_dev</em>.
43
- #
44
- class RDocTask < TaskLib
45
- # Name of the main, top level task. (default is :rdoc)
46
- attr_accessor :name
47
-
48
- # Name of directory to receive the html output files. (default is "html")
49
- attr_accessor :rdoc_dir
50
-
51
- # Title of RDoc documentation. (default is none)
52
- attr_accessor :title
53
-
54
- # Name of file to be used as the main, top level file of the
55
- # RDoc. (default is none)
56
- attr_accessor :main
57
-
58
- # Name of template to be used by rdoc. (default is 'html')
59
- attr_accessor :template
60
-
61
- # List of files to be included in the rdoc generation. (default is [])
62
- attr_accessor :rdoc_files
63
-
64
- # List of options to be passed rdoc. (default is [])
65
- attr_accessor :options
66
-
67
- # Create an RDoc task named <em>rdoc</em>. Default task name is +rdoc+.
68
- def initialize(name=:rdoc) # :yield: self
69
- @name = name
70
- @rdoc_files = Rake::FileList.new
71
- @rdoc_dir = 'html'
72
- @main = nil
73
- @title = nil
74
- @template = 'html'
75
- @options = []
76
- yield self if block_given?
77
- define
78
- end
79
-
80
- # Create the tasks defined by this task lib.
81
- def define
82
- if name.to_s != "rdoc"
83
- desc "Build the RDOC HTML Files"
84
- end
85
-
86
- desc "Build the #{name} HTML Files"
87
- task name
88
-
89
- desc "Force a rebuild of the RDOC files"
90
- task paste("re", name) => [paste("clobber_", name), name]
91
-
92
- desc "Remove rdoc products"
93
- task paste("clobber_", name) do
94
- rm_r rdoc_dir rescue nil
95
- end
96
-
97
- task :clobber => [paste("clobber_", name)]
98
-
99
- directory @rdoc_dir
100
- task name => [rdoc_target]
101
- file rdoc_target => @rdoc_files + [$rakefile] do
102
- rm_r @rdoc_dir rescue nil
103
- opts = option_list.join(' ')
104
- sh %{rdoc -o #{@rdoc_dir} #{opts} #{@rdoc_files}}
105
- end
106
- self
107
- end
108
-
109
- def option_list
110
- result = @options.dup
111
- result << "--main" << "'#{main}'" if main
112
- result << "--title" << "'#{title}'" if title
113
- result << "-T" << "'#{template}'" if template
114
- result
115
- end
116
-
117
- def option_string
118
- option_list.join(' ')
119
- end
120
-
121
- private
122
-
123
- def rdoc_target
124
- "#{rdoc_dir}/index.html"
125
- end
126
-
127
- end
128
- end
data/lib/rake/runtest.rb DELETED
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'test/unit'
4
- require 'test/unit/assertions'
5
-
6
- module Rake
7
- include Test::Unit::Assertions
8
-
9
- def run_tests(pattern='test/test*.rb', log_enabled=false)
10
- Dir["#{pattern}"].each { |fn|
11
- puts fn if log_enabled
12
- begin
13
- load fn
14
- rescue Exception => ex
15
- puts "Error in #{fn}: #{ex.message}"
16
- puts ex.backtrace
17
- assert false
18
- end
19
- }
20
- end
21
-
22
- extend self
23
- end
@@ -1,47 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'test/unit'
4
- require 'test/filecreation'
5
- require 'rake/contrib/sys'
6
-
7
- class TestSys < Test::Unit::TestCase
8
- include FileCreation
9
-
10
- # def test_delete
11
- # create_file("testdata/a")
12
- # Sys.delete_all("testdata/a")
13
- # assert ! File.exist?("testdata/a")
14
- # end
15
-
16
- # def test_copy
17
- # create_file("testdata/a")
18
- # Sys.copy("testdata/a", "testdata/b")
19
- # assert File.exist?("testdata/b")
20
- # end
21
-
22
- # def test_for_files
23
- # test_files = ["testdata/a.pl", "testdata/c.pl", "testdata/b.rb"]
24
- # test_files.each { |fn| create_file(fn) }
25
- # list = []
26
- # Sys.for_files("testdata/*.pl", "testdata/*.rb") { |fn|
27
- # list << fn
28
- # }
29
- # assert_equal test_files.sort, list.sort
30
- # end
31
-
32
- # def test_indir
33
- # here = Dir.pwd
34
- # Sys.makedirs("testdata/dir")
35
- # assert_equal "#{here}/testdata/dir", Sys.indir("testdata/dir") { Dir.pwd }
36
- # assert_equal here, Dir.pwd
37
- # end
38
-
39
- def test_split_all
40
- assert_equal ['a'], Sys.split_all('a')
41
- assert_equal ['..'], Sys.split_all('..')
42
- assert_equal ['/'], Sys.split_all('/')
43
- assert_equal ['a', 'b'], Sys.split_all('a/b')
44
- assert_equal ['/', 'a', 'b'], Sys.split_all('/a/b')
45
- assert_equal ['..', 'a', 'b'], Sys.split_all('../a/b')
46
- end
47
- end
@@ -1,3 +0,0 @@
1
- task :default do
2
- puts "OK"
3
- end
data/test/filecreation.rb DELETED
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'ftools'
4
-
5
- module FileCreation
6
- def create_timed_files(oldfile, newfile)
7
- return if File.exist?(oldfile) && File.exist?(newfile)
8
- old_time = create_file(oldfile)
9
- while create_file(newfile) <= old_time
10
- sleep(0.1)
11
- File.delete(newfile) rescue nil
12
- end
13
- end
14
-
15
- def create_file(name)
16
- dirname = File.dirname(name)
17
- FileUtils.mkdir_p(dirname) unless File.exist?(dirname)
18
- open(name, "w") {|f| f.puts "HI" } unless File.exist?(name)
19
- File.new(name).mtime
20
- end
21
-
22
- def delete_file(name)
23
- File.delete(name) rescue nil
24
- end
25
- end
26
-
data/test/functional.rb DELETED
@@ -1,82 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- begin
4
- require 'rubygems'
5
- require_gem 'session'
6
- rescue LoadError
7
- puts "UNABLE TO RUN FUNCTIONAL TESTS"
8
- puts "No Session Found"
9
- end
10
-
11
- require 'test/unit'
12
- require 'fileutils'
13
-
14
- class FunctionalTest < Test::Unit::TestCase
15
- def setup
16
- @rake_path = File.expand_path("bin/rake")
17
- lib_path = File.expand_path("lib")
18
- @ruby_options = "-I#{lib_path} -I."
19
- @verbose = true if ENV['VERBOSE']
20
- end
21
-
22
- def test_rake_default
23
- Dir.chdir("test/data/default") do rake end
24
- assert_match /^DEFAULT$/, @out
25
- assert_status
26
- end
27
-
28
- def test_rake_error_on_bad_task
29
- Dir.chdir("test/data/default") do rake "xyz" end
30
- assert_match /rake aborted/, @out
31
- assert_status(1)
32
- end
33
-
34
- def test_env_availabe_at_top_scope
35
- Dir.chdir("test/data/default") do rake "TESTTOPSCOPE=1" end
36
- assert_match /^TOPSCOPE$/, @out
37
- assert_status
38
- end
39
-
40
- def test_env_availabe_at_task_scope
41
- Dir.chdir("test/data/default") do rake "TESTTASKSCOPE=1 task_scope" end
42
- assert_match /^TASKSCOPE$/, @out
43
- assert_status
44
- end
45
-
46
- def test_multi_desc
47
- Dir.chdir("test/data/multidesc") do rake "-T" end
48
- assert_match %r{^rake a *# A / A2 *$}, @out
49
- assert_match %r{^rake b *# B *$}, @out
50
- assert_no_match %r{^rake c}, @out
51
- end
52
-
53
- def test_rbext
54
- Dir.chdir("test/data/rbext") do rake "-N" end
55
- assert_match %r{^OK$}, @out
56
- end
57
-
58
- def test_nosearch
59
- Dir.chdir("test/data/nosearch") do rake "-N" end
60
- assert_match %r{^No Rakefile found}, @out
61
- end
62
-
63
- private
64
-
65
- def rake(options="")
66
- shell = Session::Shell.new
67
- command = "ruby #{@ruby_options} #{@rake_path} #{options}"
68
- puts "COMMAND: [#{command}]" if @verbose
69
- @out, @err = shell.execute command
70
- @status = shell.exit_status
71
- puts "STATUS: [#{@status}]" if @verbose
72
- puts "OUTPUT: [#{@out}]" if @verbose
73
- puts "ERROR: [#{@err}]" if @verbose
74
- puts "PWD: [#{Dir.pwd}]" if @verbose
75
- shell.close
76
- end
77
-
78
- def assert_status(expected_status=0)
79
- assert_equal expected_status, @status
80
- end
81
-
82
- end
data/test/shellcommand.rb DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- exit((ARGV[0] || "0").to_i)
data/test/testclean.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'test/unit'
4
- require 'rake/clean'
5
-
6
- class TestClean < Test::Unit::TestCase
7
- def test_clean
8
- assert Task['clean'], "Should define clean"
9
- assert Task['clobber'], "Should define clobber"
10
- assert Task['clobber'].prerequisites.include?("clean"),
11
- "Clobber should require clean"
12
- end
13
- end