rake 10.0.2 → 10.0.3

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.

data/Rakefile CHANGED
@@ -60,7 +60,7 @@ task :default => :test
60
60
 
61
61
  Rake::TestTask.new do |t|
62
62
  files = FileList['test/helper.rb', 'test/test_*.rb']
63
- t.loader = :testrb
63
+ t.loader = :rake
64
64
  t.test_files = files
65
65
  t.libs << "."
66
66
  t.warning = true
data/bin/rake CHANGED
@@ -28,10 +28,6 @@ begin
28
28
  rescue LoadError
29
29
  end
30
30
 
31
- module Rake
32
- REDUCE_COMPAT = true if ARGV.include?("--reduce-compat")
33
- end
34
-
35
31
  require 'rake'
36
32
 
37
33
  Rake.application.run
@@ -0,0 +1,127 @@
1
+ = Rake 0.9.6 Released
2
+
3
+ Rake version 0.9.6 contains a number of fixes mainly for merging
4
+ Rake into the Ruby source tree and fixing tests.
5
+
6
+ == Changes
7
+
8
+ === New Features (in 0.9.3)
9
+
10
+ * Multitask tasks now use a thread pool. Use -j to limit the number of
11
+ available threads.
12
+
13
+ * Use -m to turn regular tasks into multitasks (use at your own risk).
14
+
15
+ * You can now do "Rake.add_rakelib 'dir'" in your Rakefile to
16
+ programatically add rake task libraries.
17
+
18
+ * You can specific backtrace suppression patterns (see
19
+ --supress-backtrace)
20
+
21
+ * Directory tasks can now take prerequisites and actions
22
+
23
+ * Use --backtrace to request a full backtrace without the task trace.
24
+
25
+ * You can say "--backtrace=stdout" and "--trace=stdout" to route trace
26
+ output to standard output rather than standard error.
27
+
28
+ * Optional 'phony' target (enable with 'require 'rake/phony'") for
29
+ special purpose builds.
30
+
31
+ * Task#clear now clears task comments as well as actions and
32
+ prerequisites. Task#clear_comment will specifically target comments.
33
+
34
+ * The --all option will force -T and -D to consider all the tasks,
35
+ with and without descriptions.
36
+
37
+ === Bug Fixes (0.9.3)
38
+
39
+ * Semi-colons in windows rakefile paths now work.
40
+
41
+ * Improved Control-C support when invoking multiple test suites.
42
+
43
+ * egrep method now reads files in text mode (better support for
44
+ Windows)
45
+
46
+ * Better deprecation line number reporting.
47
+
48
+ * The -W option now works with all tasks, whether they have a
49
+ description or not.
50
+
51
+ * File globs in rake should not be sorted alphabetically, independent
52
+ of file system and platform.
53
+
54
+ * Numerous internal improvements.
55
+
56
+ * Documentation typos and fixes.
57
+
58
+ === Bug Fixes (0.9.4)
59
+
60
+ * Exit status with failing tests is not correctly set to non-zero.
61
+
62
+ * Simplified syntax for phony task (for older versions of RDoc).
63
+
64
+ * Stand alone FileList usage gets glob function (without loading in
65
+ extra dependencies)
66
+
67
+ === Bug Fixes (0.9.5)
68
+
69
+ * --trace and --backtrace no longer swallow following task names.
70
+
71
+ === Bug Fixes (0.9.6)
72
+
73
+ * Better trace output when using a multi-threaded Rakefile.
74
+ * Arg parsing is now consistent for tasks and multitasks.
75
+ * Skip exit code test in versions of Ruby that don't support it well.
76
+
77
+ Changes for better integration with the Ruby source tree:
78
+
79
+ * Fix version literal for Ruby source tree build.
80
+ * Better loading of libraries for testing in Ruby build.
81
+ * Use the ruby version provided by Ruby's tests.
82
+
83
+ == What is Rake
84
+
85
+ Rake is a build tool similar to the make program in many ways. But
86
+ instead of cryptic make recipes, Rake uses standard Ruby code to
87
+ declare tasks and dependencies. You have the full power of a modern
88
+ scripting language built right into your build tool.
89
+
90
+ == Availability
91
+
92
+ The easiest way to get and install rake is via RubyGems ...
93
+
94
+ gem install rake (you may need root/admin privileges)
95
+
96
+ Otherwise, you can get it from the more traditional places:
97
+
98
+ Home Page:: http://github.com/jimweirich/rake
99
+ Download:: http://rubyforge.org/project/showfiles.php?group_id=50
100
+ GitHub:: git://github.com/jimweirich/rake.git
101
+
102
+ == Thanks
103
+
104
+ As usual, it was input from users that drove a alot of these changes. The
105
+ following people either contributed patches, made suggestions or made
106
+ otherwise helpful comments. Thanks to ...
107
+
108
+ * Aaron Patterson
109
+ * Dylan Smith
110
+ * Jo Liss
111
+ * Jonas Pfenniger
112
+ * Kazuki Tsujimoto
113
+ * Michael Bishop
114
+ * Michael Elufimov
115
+ * NAKAMURA Usaku
116
+ * Ryan Davis
117
+ * Sam Grönblom
118
+ * Sam Phippen
119
+ * Sergio Wong
120
+ * Tay Ray Chuan
121
+ * grosser
122
+ * quix
123
+
124
+ Also, many thanks to Eric Hodel for assisting with getting this release
125
+ out the door.
126
+
127
+ -- Jim Weirich
@@ -0,0 +1,191 @@
1
+ = Rake 10.0.3 Released
2
+
3
+ "Jim, when will Rake reach version 1.0?"
4
+
5
+ Over the past several years I've been asked that question at
6
+ conferences, panels and over twitter. Due to historical reasons (or
7
+ maybe just plain laziness) Rake has (incorrectly) been treating the
8
+ second digit of the version as the major release number. So in my head
9
+ Rake was already at version 9.
10
+
11
+ Well, it's time to fix things. This next version of Rake drops old,
12
+ crufty, backwards compatibility hacks such as top level constants, DSL
13
+ methods defined in Object and numerous other features that are just no
14
+ longer desired. It's also time to drop the leading zero from the
15
+ version number as well and call this new version of rake what it
16
+ really is: Version 10.
17
+
18
+ So, welcome to Rake 10.0!
19
+
20
+ Rake 10 is actually feature identical to the latest version of Rake 9
21
+ (that would be the version spelled 0.9.3), *except* that Rake 10 drops
22
+ all the sundry deprecated features that have accumulated over the years.
23
+
24
+ If your Rakefile is up to date and current with all the new features
25
+ of Rake 10, you are ready to go. If your Rakefile still uses a few
26
+ deprecated feeatures, feel free to use Rake 9 (0.9.3) with the same
27
+ feature set. Just be aware that future features will be in Rake 10
28
+ family line.
29
+
30
+ == Changes in Version 10
31
+
32
+ As mentioned above, there are no new features in Rake 10. However,
33
+ there are a number of features missing:
34
+
35
+ * Classic namespaces are now gone. Rake is no longer able to reflect
36
+ the options settings in the global variables ($rakefile, $show_tasks,
37
+ $show_prereqs, $trace, $dryrun and $silent). The
38
+ <tt>--classic-namespace</tt> option is no longer supported.
39
+
40
+ * Global constants are no longer supported. This includes
41
+ <tt>Task</tt>, <tt>FileTask</tt>, <tt>FileCreationTask</tt> and
42
+ <tt>RakeApp</tt>). The constant missing hook to warn about using
43
+ global rake constants has been removed.
44
+
45
+ * The Rake DSL methods (task, file, directory, etc) are in their own
46
+ module (Rake::DSL). The stub versions of these methods (that printed
47
+ warnings) in Object have been removed. However, the DSL methods are
48
+ added to the top-level <tt>main</tt> object. Since <tt>main</tt> is
49
+ not in the inheritance tree, the presence of the DSL methods in main
50
+ should be low impact on other libraries.
51
+
52
+ If you want to use the Rake DSL commands from your own code, just
53
+ include <tt>Rake::DSL</tt> into your own classes and modules.
54
+
55
+ * The deprecated syntax for task arguments (the one using
56
+ <tt>:needs</tt>) has been removed.
57
+
58
+ * The <tt>--reduce-compat</tt> flag has been removed (it's not needed
59
+ anymore).
60
+
61
+ * The deprecated <tt>rake/sys.rb</tt> library has been removed.
62
+
63
+ * The deprecated <tt>rake/rdoctask.rb</tt> library has been removed.
64
+ RDoc supplies its own rake task now.
65
+
66
+ * The deprecated <tt>rake/gempackagetask.rb</tt> library has been
67
+ removed. Gem supplies its own package task now.
68
+
69
+ There is one small behavioral change:
70
+
71
+ * Non-file tasks now always report the current time as their time
72
+ stamp. This is different from the previous behavior where non-file
73
+ tasks reported current time only if there were no prerequisites, and
74
+ the max prerequisite timestamp otherwise. This lead to inconsistent
75
+ and surprising behavior when adding prerequisites to tasks that in
76
+ turn were prequisites to file tasks. The new behavior is more
77
+ consistent and predictable.
78
+
79
+ == Changes (from 0.9.3, 0.9.4, 0.9.5)
80
+
81
+ Since Rake 10 includes the changes from the last version of Rake 9,
82
+ we'll repeat the changes for versions 0.9.3 through 0.9.5 here.
83
+
84
+ === New Features (in 0.9.3)
85
+
86
+ * Multitask tasks now use a thread pool. Use -j to limit the number of
87
+ available threads.
88
+
89
+ * Use -m to turn regular tasks into multitasks (use at your own risk).
90
+
91
+ * You can now do "Rake.add_rakelib 'dir'" in your Rakefile to
92
+ programatically add rake task libraries.
93
+
94
+ * You can specific backtrace suppression patterns (see
95
+ --supress-backtrace)
96
+
97
+ * Directory tasks can now take prerequisites and actions
98
+
99
+ * Use --backtrace to request a full backtrace without the task trace.
100
+
101
+ * You can say "--backtrace=stdout" and "--trace=stdout" to route trace
102
+ output to standard output rather than standard error.
103
+
104
+ * Optional 'phony' target (enable with 'require 'rake/phony'") for
105
+ special purpose builds.
106
+
107
+ * Task#clear now clears task comments as well as actions and
108
+ prerequisites. Task#clear_comment will specifically target comments.
109
+
110
+ * The --all option will force -T and -D to consider all the tasks,
111
+ with and without descriptions.
112
+
113
+ === Bug Fixes (in 0.9.3)
114
+
115
+ * Semi-colons in windows rakefile paths now work.
116
+
117
+ * Improved Control-C support when invoking multiple test suites.
118
+
119
+ * egrep method now reads files in text mode (better support for
120
+ Windows)
121
+
122
+ * Better deprecation line number reporting.
123
+
124
+ * The -W option now works with all tasks, whether they have a
125
+ description or not.
126
+
127
+ * File globs in rake should not be sorted alphabetically, independent
128
+ of file system and platform.
129
+
130
+ * Numerous internal improvements.
131
+
132
+ * Documentation typos and fixes.
133
+
134
+ === Bug Fixes (in 0.9.4)
135
+
136
+ * Exit status with failing tests is not correctly set to non-zero.
137
+
138
+ * Simplified syntax for phony task (for older versions of RDoc).
139
+
140
+ * Stand alone FileList usage gets glob function (without loading in
141
+ extra dependencies)
142
+
143
+ === Bug Fixes (in 0.9.5)
144
+
145
+ * --trace and --backtrace no longer swallow following task names.
146
+
147
+ == What is Rake
148
+
149
+ Rake is a build tool similar to the make program in many ways. But
150
+ instead of cryptic make recipes, Rake uses standard Ruby code to
151
+ declare tasks and dependencies. You have the full power of a modern
152
+ scripting language built right into your build tool.
153
+
154
+ == Availability
155
+
156
+ The easiest way to get and install rake is via RubyGems ...
157
+
158
+ gem install rake (you may need root/admin privileges)
159
+
160
+ Otherwise, you can get it from the more traditional places:
161
+
162
+ Home Page:: http://github.com/jimweirich/rake
163
+ Download:: http://rubyforge.org/project/showfiles.php?group_id=50
164
+ GitHub:: git://github.com/jimweirich/rake.git
165
+
166
+ == Thanks
167
+
168
+ As usual, it was input from users that drove a lot of these changes. The
169
+ following people contributed patches, made suggestions or made
170
+ otherwise helpful comments. Thanks to ...
171
+
172
+ * Aaron Patterson
173
+ * Dylan Smith
174
+ * Jo Liss
175
+ * Jonas Pfenniger
176
+ * Kazuki Tsujimoto
177
+ * Michael Bishop
178
+ * Michael Elufimov
179
+ * NAKAMURA Usaku
180
+ * Ryan Davis
181
+ * Sam Grönblom
182
+ * Sam Phippen
183
+ * Sergio Wong
184
+ * Tay Ray Chuan
185
+ * grosser
186
+ * quix
187
+
188
+ Also, many thanks to Eric Hodel for assisting with getting this release
189
+ out the door.
190
+
191
+ -- Jim Weirich
@@ -43,6 +43,7 @@ require 'rake/win32'
43
43
  require 'rake/task_argument_error'
44
44
  require 'rake/rule_recursion_overflow_error'
45
45
  require 'rake/rake_module'
46
+ require 'rake/trace_output'
46
47
  require 'rake/pseudo_status'
47
48
  require 'rake/task_arguments'
48
49
  require 'rake/invocation_chain'
@@ -5,6 +5,7 @@ require 'rake/task_manager'
5
5
  require 'rake/file_list'
6
6
  require 'rake/thread_pool'
7
7
  require 'rake/thread_history_display'
8
+ require 'rake/trace_output'
8
9
  require 'rake/win32'
9
10
 
10
11
  module Rake
@@ -17,6 +18,7 @@ module Rake
17
18
  #
18
19
  class Application
19
20
  include TaskManager
21
+ include TraceOutput
20
22
 
21
23
  # The name of the application (typically 'rake')
22
24
  attr_reader :name
@@ -176,7 +178,7 @@ module Rake
176
178
  if options.backtrace
177
179
  trace ex.backtrace.join("\n")
178
180
  else
179
- trace Backtrace.collapse(ex.backtrace)
181
+ trace Backtrace.collapse(ex.backtrace).join("\n")
180
182
  end
181
183
  trace "Tasks: #{ex.chain}" if has_chain?(ex)
182
184
  trace "(See full trace by running task with --trace)" unless options.backtrace
@@ -188,11 +190,11 @@ module Rake
188
190
  # Rake.application.deprecate("import", "Rake.import", caller.first)
189
191
  #
190
192
  def deprecate(old_usage, new_usage, call_site)
191
- fail "GONE"
192
- return if options.ignore_deprecate
193
- $stderr.puts "WARNING: '#{old_usage}' is deprecated. " +
194
- "Please use '#{new_usage}' instead.\n" +
195
- " at #{call_site}"
193
+ unless options.ignore_deprecate
194
+ $stderr.puts "WARNING: '#{old_usage}' is deprecated. " +
195
+ "Please use '#{new_usage}' instead.\n" +
196
+ " at #{call_site}"
197
+ end
196
198
  end
197
199
 
198
200
  # Does the exception have a task invocation chain?
@@ -315,9 +317,9 @@ module Rake
315
317
  end
316
318
  end
317
319
 
318
- def trace(*str)
320
+ def trace(*strings)
319
321
  options.trace_output ||= $stderr
320
- options.trace_output.puts(*str)
322
+ trace_on(options.trace_output, *strings)
321
323
  end
322
324
 
323
325
  def sort_options(options)
@@ -2,7 +2,7 @@ module Rake
2
2
  module Backtrace
3
3
  SUPPRESSED_PATHS =
4
4
  RbConfig::CONFIG.values_at(*RbConfig::CONFIG.
5
- keys.grep(/(prefix|libdir)/)) + [
5
+ keys.grep(/(prefix|libdir)/)).uniq + [
6
6
  File.join(File.dirname(__FILE__), ".."),
7
7
  ].map { |f| Regexp.quote(File.expand_path(f)) }
8
8
  SUPPRESSED_PATHS.reject! { |s| s.nil? || s =~ /^ *$/ }
@@ -0,0 +1 @@
1
+ fail "ERROR: 'rake/contrib/sys' is obsolete and no longer supported. Use 'FileUtils' instead."
@@ -6,7 +6,7 @@ require 'fileutils'
6
6
  # added to the FileUtils utility functions.
7
7
  module FileUtils
8
8
  # Path to the currently running Ruby program
9
- RUBY = File.join(
9
+ RUBY = ENV['RUBY'] || File.join(
10
10
  RbConfig::CONFIG['bindir'],
11
11
  RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']).
12
12
  sub(/.*\s.*/m, '"\&"')
@@ -0,0 +1 @@
1
+ fail "ERROR: 'rake/gempackagetask' is obsolete and no longer supported. Use 'rubygems/package_task' instead."
@@ -0,0 +1 @@
1
+ fail "ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead."
File without changes
@@ -105,7 +105,7 @@ module Rake
105
105
 
106
106
  # Argument description (nil if none).
107
107
  def arg_description # :nodoc:
108
- @arg_names ? "[#{(arg_names || []).join(',')}]" : nil
108
+ @arg_names ? "[#{arg_names.join(',')}]" : nil
109
109
  end
110
110
 
111
111
  # Name of arguments for this task.
@@ -182,18 +182,19 @@ module Rake
182
182
  if application.options.always_multitask
183
183
  invoke_prerequisites_concurrently(task_args, invocation_chain)
184
184
  else
185
- prerequisite_tasks.each { |prereq|
186
- prereq_args = task_args.new_scope(prereq.arg_names)
187
- prereq.invoke_with_call_chain(prereq_args, invocation_chain)
185
+ prerequisite_tasks.each { |p|
186
+ prereq_args = task_args.new_scope(p.arg_names)
187
+ p.invoke_with_call_chain(prereq_args, invocation_chain)
188
188
  }
189
189
  end
190
190
  end
191
191
 
192
192
  # Invoke all the prerequisites of a task in parallel.
193
- def invoke_prerequisites_concurrently(args, invocation_chain) # :nodoc:
194
- futures = @prerequisites.collect do |p|
193
+ def invoke_prerequisites_concurrently(task_args, invocation_chain) # :nodoc:
194
+ futures = prerequisite_tasks.collect do |p|
195
+ prereq_args = task_args.new_scope(p.arg_names)
195
196
  application.thread_pool.future(p) do |r|
196
- application[r, @scope].invoke_with_call_chain(args, invocation_chain)
197
+ r.invoke_with_call_chain(prereq_args, invocation_chain)
197
198
  end
198
199
  end
199
200
  futures.each { |f| f.value }
@@ -0,0 +1,19 @@
1
+ module Rake
2
+ module TraceOutput
3
+
4
+ # Write trace output to output stream +out+.
5
+ #
6
+ # The write is done as a single IO call (to print) to lessen the
7
+ # chance that the trace output is interrupted by other tasks also
8
+ # producing output.
9
+ def trace_on(out, *strings)
10
+ sep = $\ || "\n"
11
+ if strings.empty?
12
+ output = sep
13
+ else
14
+ output = strings.map { |s| s.end_with?(sep) ? s : s + sep }.join
15
+ end
16
+ out.print(output)
17
+ end
18
+ end
19
+ end
@@ -1,10 +1,13 @@
1
1
  module Rake
2
+ VERSION = '10.0.3'
3
+
2
4
  module Version # :nodoc: all
5
+ MAJOR, MINOR, BUILD, = Rake::VERSION.split '.'
6
+
3
7
  NUMBERS = [
4
- MAJOR = 10,
5
- MINOR = 0,
6
- BUILD = 2,
8
+ MAJOR,
9
+ MINOR,
10
+ BUILD,
7
11
  ]
8
12
  end
9
- VERSION = Version::NUMBERS.join('.')
10
13
  end
@@ -12,8 +12,8 @@ require 'tmpdir'
12
12
  require File.expand_path('../file_creation', __FILE__)
13
13
 
14
14
  begin
15
- require 'test/ruby/envutil'
16
- rescue LoadError
15
+ require_relative '../ruby/envutil'
16
+ rescue NoMethodError, LoadError
17
17
  # for ruby trunk
18
18
  end
19
19
 
@@ -31,6 +31,19 @@ class Rake::TestCase < MiniTest::Unit::TestCase
31
31
  def setup
32
32
  ARGV.clear
33
33
 
34
+ test_dir = File.basename File.dirname File.expand_path __FILE__
35
+
36
+ @rake_root = if test_dir == 'test' then
37
+ # rake repository
38
+ File.expand_path '../../', __FILE__
39
+ else
40
+ # ruby repository
41
+ File.expand_path '../../../', __FILE__
42
+ end
43
+
44
+ @rake_exec = File.join @rake_root, 'bin', 'rake'
45
+ @rake_lib = File.join @rake_root, 'lib'
46
+
34
47
  @orig_PWD = Dir.pwd
35
48
  @orig_APPDATA = ENV['APPDATA']
36
49
  @orig_HOME = ENV['HOME']
@@ -502,8 +515,8 @@ Rake::TestTask.new(:b) do |t|
502
515
  end
503
516
 
504
517
  task :test do
505
- Rake::Task[:a].invoke rescue nil
506
- Rake::Task[:b].invoke rescue nil
518
+ Rake::Task[:a].invoke
519
+ Rake::Task[:b].invoke
507
520
  end
508
521
 
509
522
  task :default => :test
@@ -2,11 +2,19 @@ require File.expand_path('../helper', __FILE__)
2
2
  require 'open3'
3
3
 
4
4
  class TestRakeBacktrace < Rake::TestCase
5
+
6
+ def setup
7
+ super
8
+
9
+ skip 'tmpdir is suppressed in backtrace' if
10
+ Dir.pwd =~ Rake::Backtrace::SUPPRESS_PATTERN
11
+ end
12
+
5
13
  # TODO: factor out similar code in test_rake_functional.rb
6
14
  def rake(*args)
7
- lib = File.join(@orig_PWD, "lib")
8
- bin_rake = File.join(@orig_PWD, "bin", "rake")
9
- Open3.popen3(RUBY, "-I", lib, bin_rake, *args) { |_, _, err, _| err.read }
15
+ Open3.popen3(RUBY, "-I", @rake_lib, @rake_exec, *args) { |_, _, err, _|
16
+ err.read
17
+ }
10
18
  end
11
19
 
12
20
  def invoke(task_name)
@@ -116,7 +116,7 @@ class TestRakeFileTask < Rake::TestCase
116
116
  end
117
117
 
118
118
  def load_phony
119
- load File.join(@orig_PWD, "lib/rake/phony.rb")
119
+ load File.join(@rake_lib, "rake/phony.rb")
120
120
  end
121
121
 
122
122
  end
@@ -5,9 +5,9 @@ require 'open3'
5
5
  class TestRakeFunctional < Rake::TestCase
6
6
 
7
7
  def setup
8
- @rake_path = File.expand_path("bin/rake")
9
- lib_path = File.expand_path("lib")
10
- @ruby_options = ["-I#{lib_path}", "-I."]
8
+ super
9
+
10
+ @ruby_options = ["-I#{@rake_lib}", "-I."]
11
11
  @verbose = ENV['VERBOSE']
12
12
 
13
13
  if @verbose
@@ -17,8 +17,6 @@ class TestRakeFunctional < Rake::TestCase
17
17
  puts @__name__
18
18
  puts '-' * 80
19
19
  end
20
-
21
- super
22
20
  end
23
21
 
24
22
  def test_rake_default
@@ -440,9 +438,10 @@ class TestRakeFunctional < Rake::TestCase
440
438
  end
441
439
 
442
440
  def test_failing_test_sets_exit_status
441
+ skip if uncertain_exit_status?
443
442
  rakefile_failing_test_task
444
443
  rake
445
- assert_equal 1, @exit.exitstatus
444
+ assert @exit.exitstatus > 0, "should be non-zero"
446
445
  end
447
446
 
448
447
  def test_stand_alone_filelist
@@ -451,11 +450,19 @@ class TestRakeFunctional < Rake::TestCase
451
450
  run_ruby @ruby_options + ["stand_alone_filelist.rb"]
452
451
 
453
452
  assert_match(/^stand_alone_filelist\.rb$/, @out)
454
- assert_equal 0, @exit.exitstatus
453
+ assert_equal 0, @exit.exitstatus unless uncertain_exit_status?
455
454
  end
456
455
 
457
456
  private
458
457
 
458
+ # We are unable to accurately verify that Rake returns a proper
459
+ # error exit status using popen3 in Ruby 1.8.7 and JRuby. This
460
+ # predicate function can be used to skip tests or assertions as
461
+ # needed.
462
+ def uncertain_exit_status?
463
+ RUBY_VERSION < "1.9" || defined?(JRUBY_VERSION)
464
+ end
465
+
459
466
  # Run a shell Ruby command with command line options (using the
460
467
  # default test options). Output is captured in @out and @err
461
468
  def ruby(*option_list)
@@ -466,19 +473,19 @@ class TestRakeFunctional < Rake::TestCase
466
473
  # command line ruby options are included. Output is captured in
467
474
  # @out and @err
468
475
  def rake(*rake_options)
469
- run_ruby @ruby_options + [@rake_path] + rake_options
476
+ run_ruby @ruby_options + [@rake_exec] + rake_options
470
477
  end
471
478
 
472
479
  # Low level ruby command runner ...
473
480
  def run_ruby(option_list)
474
481
  puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose
475
482
 
476
- inn, out, err, wait = Open3.popen3(Gem.ruby, *option_list)
483
+ inn, out, err, wait = Open3.popen3(RUBY, *option_list)
477
484
  inn.close
478
485
 
486
+ @exit = wait ? wait.value : $?
479
487
  @out = out.read
480
488
  @err = err.read
481
- @exit = wait.value
482
489
 
483
490
  puts "OUTPUT: [#{@out}]" if @verbose
484
491
  puts "ERROR: [#{@err}]" if @verbose
@@ -10,7 +10,7 @@ class TestRakeRakeTestLoader < Rake::TestCase
10
10
 
11
11
  ARGV.replace %w[foo.rb test_*.rb -v]
12
12
 
13
- load File.join(@orig_PWD, 'lib/rake/rake_test_loader.rb')
13
+ load File.join(@rake_lib, 'rake/rake_test_loader.rb')
14
14
 
15
15
  assert_equal %w[-v], ARGV
16
16
  ensure
@@ -4,9 +4,9 @@ require 'open3'
4
4
  class TestRakeReduceCompat < Rake::TestCase
5
5
  # TODO: factor out similar code in test_rake_functional.rb
6
6
  def rake(*args)
7
- lib = File.join(@orig_PWD, "lib")
8
- bin_rake = File.join(@orig_PWD, "bin", "rake")
9
- Open3.popen3(RUBY, "-I", lib, bin_rake, *args) { |_, out, _, _| out.read }
7
+ Open3.popen3(RUBY, "-I", @rake_lib, @rake_exec, *args) { |_, out, _, _|
8
+ out.read
9
+ }
10
10
  end
11
11
 
12
12
  def invoke_normal(task_name)
@@ -132,7 +132,7 @@ class TestRakeTaskWithArguments < Rake::TestCase
132
132
  assert_equal "1.2", value
133
133
  end
134
134
 
135
- def test_args_not_passed_if_no_prereq_names
135
+ def test_args_not_passed_if_no_prereq_names_on_task
136
136
  pre = task(:pre) { |t, args|
137
137
  assert_equal({}, args.to_hash)
138
138
  assert_equal "bill", args.name
@@ -141,6 +141,15 @@ class TestRakeTaskWithArguments < Rake::TestCase
141
141
  t.invoke("bill", "1.2")
142
142
  end
143
143
 
144
+ def test_args_not_passed_if_no_prereq_names_on_multitask
145
+ pre = task(:pre) { |t, args|
146
+ assert_equal({}, args.to_hash)
147
+ assert_equal "bill", args.name
148
+ }
149
+ t = multitask(:t, [:name, :rev] => [:pre])
150
+ t.invoke("bill", "1.2")
151
+ end
152
+
144
153
  def test_args_not_passed_if_no_arg_names
145
154
  pre = task(:pre, :rev) { |t, args|
146
155
  assert_equal({}, args.to_hash)
@@ -0,0 +1,43 @@
1
+ require File.expand_path('../helper', __FILE__)
2
+ require 'stringio'
3
+
4
+ class TestTraceOutput < Rake::TestCase
5
+ include Rake::TraceOutput
6
+
7
+ class PrintSpy
8
+ attr_reader :result, :calls
9
+ def initialize
10
+ @result = ""
11
+ @calls = 0
12
+ end
13
+ def print(string)
14
+ @result << string
15
+ @calls += 1
16
+ end
17
+ end
18
+
19
+ def test_trace_issues_single_io_for_args_with_empty_args
20
+ spy = PrintSpy.new
21
+ trace_on(spy)
22
+ assert_equal "\n", spy.result
23
+ assert_equal 1, spy.calls
24
+ end
25
+
26
+ def test_trace_issues_single_io_for_args_multiple_strings
27
+ spy = PrintSpy.new
28
+ trace_on(spy, "HI\n", "LO")
29
+ assert_equal "HI\nLO\n", spy.result
30
+ assert_equal 1, spy.calls
31
+ end
32
+
33
+ def test_trace_issues_single_io_for_args_multiple_strings_and_alternate_sep
34
+ old_sep = $\
35
+ $\ = "\r"
36
+ spy = PrintSpy.new
37
+ trace_on(spy, "HI\r", "LO")
38
+ assert_equal "HI\rLO\r", spy.result
39
+ assert_equal 1, spy.calls
40
+ ensure
41
+ $\ = old_sep
42
+ end
43
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.2
4
+ version: 10.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-19 00:00:00.000000000 Z
12
+ date: 2012-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -67,9 +67,11 @@ extra_rdoc_files:
67
67
  - doc/release_notes/rake-0.9.3.rdoc
68
68
  - doc/release_notes/rake-0.9.4.rdoc
69
69
  - doc/release_notes/rake-0.9.5.rdoc
70
+ - doc/release_notes/rake-0.9.6.rdoc
70
71
  - doc/release_notes/rake-10.0.0.rdoc
71
72
  - doc/release_notes/rake-10.0.1.rdoc
72
73
  - doc/release_notes/rake-10.0.2.rdoc
74
+ - doc/release_notes/rake-10.0.3.rdoc
73
75
  files:
74
76
  - .gemtest
75
77
  - install.rb
@@ -90,6 +92,7 @@ files:
90
92
  - lib/rake/contrib/publisher.rb
91
93
  - lib/rake/contrib/rubyforgepublisher.rb
92
94
  - lib/rake/contrib/sshpublisher.rb
95
+ - lib/rake/contrib/sys.rb
93
96
  - lib/rake/default_loader.rb
94
97
  - lib/rake/dsl_definition.rb
95
98
  - lib/rake/early_time.rb
@@ -102,6 +105,7 @@ files:
102
105
  - lib/rake/file_task.rb
103
106
  - lib/rake/file_utils.rb
104
107
  - lib/rake/file_utils_ext.rb
108
+ - lib/rake/gempackagetask.rb
105
109
  - lib/rake/invocation_chain.rb
106
110
  - lib/rake/invocation_exception_mixin.rb
107
111
  - lib/rake/loaders/makefile.rb
@@ -115,6 +119,7 @@ files:
115
119
  - lib/rake/pseudo_status.rb
116
120
  - lib/rake/rake_module.rb
117
121
  - lib/rake/rake_test_loader.rb
122
+ - lib/rake/rdoctask.rb
118
123
  - lib/rake/ruby182_test_unit_fix.rb
119
124
  - lib/rake/rule_recursion_overflow_error.rb
120
125
  - lib/rake/runtest.rb
@@ -126,6 +131,7 @@ files:
126
131
  - lib/rake/testtask.rb
127
132
  - lib/rake/thread_history_display.rb
128
133
  - lib/rake/thread_pool.rb
134
+ - lib/rake/trace_output.rb
129
135
  - lib/rake/version.rb
130
136
  - lib/rake/win32.rb
131
137
  - test/file_creation.rb
@@ -173,6 +179,7 @@ files:
173
179
  - test/test_rake_top_level_functions.rb
174
180
  - test/test_rake_win32.rb
175
181
  - test/test_thread_history_display.rb
182
+ - test/test_trace_output.rb
176
183
  - doc/command_line_usage.rdoc
177
184
  - doc/example/Rakefile1
178
185
  - doc/example/Rakefile2
@@ -209,9 +216,11 @@ files:
209
216
  - doc/release_notes/rake-0.9.3.rdoc
210
217
  - doc/release_notes/rake-0.9.4.rdoc
211
218
  - doc/release_notes/rake-0.9.5.rdoc
219
+ - doc/release_notes/rake-0.9.6.rdoc
212
220
  - doc/release_notes/rake-10.0.0.rdoc
213
221
  - doc/release_notes/rake-10.0.1.rdoc
214
222
  - doc/release_notes/rake-10.0.2.rdoc
223
+ - doc/release_notes/rake-10.0.3.rdoc
215
224
  homepage: http://rake.rubyforge.org
216
225
  licenses: []
217
226
  post_install_message: