diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-25 07:03:36 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-25 07:03:36 +0000 |
commit | 3908d5d3303dbd3f20f106aa71b5c094b67ac577 (patch) | |
tree | c607909aa5a9b12e6c134cf6268b56db02881fc0 /lib | |
parent | f20f84d60a467c1bc8a0ca81fe2788fa4c8079f8 (diff) |
* lib/rake: Update to rake 10.4.0
* test/rake: ditto.
* NEWS: ditto.
* test/lib/minitest/unit.rb: Add compatibility shim for minitest 5.
This only provides minitest 5 unit test naming compatibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rake.rb | 3 | ||||
-rw-r--r-- | lib/rake/application.rb | 10 | ||||
-rw-r--r-- | lib/rake/contrib/.document | 1 | ||||
-rw-r--r-- | lib/rake/ext/time.rb | 5 | ||||
-rw-r--r-- | lib/rake/file_task.rb | 2 | ||||
-rw-r--r-- | lib/rake/late_time.rb | 17 | ||||
-rw-r--r-- | lib/rake/packagetask.rb | 5 | ||||
-rw-r--r-- | lib/rake/task_manager.rb | 2 |
8 files changed, 33 insertions, 12 deletions
diff --git a/lib/rake.rb b/lib/rake.rb index 47cce17064..ab04a7f385 100644 --- a/lib/rake.rb +++ b/lib/rake.rb @@ -21,7 +21,7 @@ #++ module Rake - VERSION = '10.3.2' + VERSION = '10.4.0' end require 'rake/version' @@ -63,6 +63,7 @@ require 'rake/file_utils_ext' require 'rake/file_list' require 'rake/default_loader' require 'rake/early_time' +require 'rake/late_time' require 'rake/name_space' require 'rake/task_manager' require 'rake/application' diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 795b4685d4..96f907b077 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -20,6 +20,9 @@ module Rake include TaskManager include TraceOutput + # The command-line arguments rake is using (defaults to ARGV) + attr_reader :argv # :nodoc: + # The name of the application (typically 'rake') attr_reader :name @@ -45,6 +48,7 @@ module Rake # Initialize a Rake::Application object. def initialize super + @argv = ARGV.dup @name = 'rake' @rakefiles = DEFAULT_RAKEFILES.dup @rakefile = nil @@ -73,6 +77,8 @@ module Rake # call +top_level+ to run your top level tasks. def run standard_exception_handling do + @argv = argv + init load_rakefile top_level @@ -633,7 +639,7 @@ module Rake standard_rake_options.each { |args| opts.on(*args) } opts.environment('RAKEOPT') - end.parse! + end.parse! @argv end # Similar to the regular Ruby +require+ command, but will check @@ -729,7 +735,7 @@ module Rake # Environmental assignments are processed at this time as well. def collect_command_line_tasks # :nodoc: @top_level_tasks = [] - ARGV.each do |arg| + @argv.each do |arg| if arg =~ /^(\w+)=(.*)$/m ENV[$1] = $2 else diff --git a/lib/rake/contrib/.document b/lib/rake/contrib/.document index 8b13789179..e69de29bb2 100644 --- a/lib/rake/contrib/.document +++ b/lib/rake/contrib/.document @@ -1 +0,0 @@ - diff --git a/lib/rake/ext/time.rb b/lib/rake/ext/time.rb index c058649b7e..d3b8cf9dc1 100644 --- a/lib/rake/ext/time.rb +++ b/lib/rake/ext/time.rb @@ -1,12 +1,13 @@ #-- -# Extensions to time to allow comparisons with an early time class. +# Extensions to time to allow comparisons with early and late time classes. require 'rake/early_time' +require 'rake/late_time' class Time # :nodoc: all alias rake_original_time_compare :<=> def <=>(other) - if Rake::EarlyTime === other + if Rake::EarlyTime === other || Rake::LateTime === other - other.<=>(self) else rake_original_time_compare(other) diff --git a/lib/rake/file_task.rb b/lib/rake/file_task.rb index 11823bbe46..4c9b04074f 100644 --- a/lib/rake/file_task.rb +++ b/lib/rake/file_task.rb @@ -21,7 +21,7 @@ module Rake if File.exist?(name) File.mtime(name.to_s) else - Rake::EARLY + Rake::LATE end end diff --git a/lib/rake/late_time.rb b/lib/rake/late_time.rb new file mode 100644 index 0000000000..d959a7821f --- /dev/null +++ b/lib/rake/late_time.rb @@ -0,0 +1,17 @@ +module Rake + # LateTime is a fake timestamp that occurs _after_ any other time value. + class LateTime + include Comparable + include Singleton + + def <=>(other) + 1 + end + + def to_s + '<LATE TIME>' + end + end + + LATE = LateTime.instance +end diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb index e862952c05..249ee72b11 100644 --- a/lib/rake/packagetask.rb +++ b/lib/rake/packagetask.rb @@ -143,10 +143,7 @@ module Rake end end - directory package_dir - - file package_dir_path => @package_files do - mkdir_p package_dir rescue nil + directory package_dir_path => @package_files do @package_files.each do |fn| f = File.join(package_dir_path, fn) fdir = File.dirname(f) diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index 221c68cec4..cbb9f5ee2f 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -111,7 +111,7 @@ module Rake if args.empty? task_name = key arg_names = [] - deps = value + deps = value || [] else task_name = args.shift arg_names = key |