From e2bbfaa67c658acf09cdfe43f82d7c8b42c1aec7 Mon Sep 17 00:00:00 2001 From: hsbt Date: Sat, 6 Dec 2014 00:22:51 +0000 Subject: * lib/rake: Update to rake 10.4.2 * test/rake: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rake.rb | 2 +- lib/rake/application.rb | 25 +++++++++++++------------ lib/rake/dsl_definition.rb | 2 ++ 3 files changed, 16 insertions(+), 13 deletions(-) (limited to 'lib') diff --git a/lib/rake.rb b/lib/rake.rb index ab04a7f385..7366862ad0 100644 --- a/lib/rake.rb +++ b/lib/rake.rb @@ -21,7 +21,7 @@ #++ module Rake - VERSION = '10.4.0' + VERSION = '10.4.2' end require 'rake/version' diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 96f907b077..bd72a2efae 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -20,9 +20,6 @@ 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 @@ -48,7 +45,6 @@ module Rake # Initialize a Rake::Application object. def initialize super - @argv = ARGV.dup @name = 'rake' @rakefiles = DEFAULT_RAKEFILES.dup @rakefile = nil @@ -77,8 +73,6 @@ module Rake # call +top_level+ to run your top level tasks. def run standard_exception_handling do - @argv = argv - init load_rakefile top_level @@ -89,8 +83,8 @@ module Rake def init(app_name='rake') standard_exception_handling do @name = app_name - handle_options - collect_command_line_tasks + args = handle_options + collect_command_line_tasks(args) end end @@ -622,7 +616,9 @@ module Rake end private :select_trace_output - # Read and handle the command line options. + # Read and handle the command line options. Returns the command line + # arguments that we didn't understand, which should (in theory) be just + # task names and env vars. def handle_options # :nodoc: options.rakelib = ['rakelib'] options.trace_output = $stderr @@ -639,7 +635,7 @@ module Rake standard_rake_options.each { |args| opts.on(*args) } opts.environment('RAKEOPT') - end.parse! @argv + end.parse(ARGV) end # Similar to the regular Ruby +require+ command, but will check @@ -733,9 +729,14 @@ module Rake # Collect the list of tasks on the command line. If no tasks are # given, return a list containing only the default task. # Environmental assignments are processed at this time as well. - def collect_command_line_tasks # :nodoc: + # + # `args` is the list of arguments to peruse to get the list of tasks. + # It should be the command line that was given to rake, less any + # recognised command-line options, which OptionParser.parse will + # have taken care of already. + def collect_command_line_tasks(args) # :nodoc: @top_level_tasks = [] - @argv.each do |arg| + args.each do |arg| if arg =~ /^(\w+)=(.*)$/m ENV[$1] = $2 else diff --git a/lib/rake/dsl_definition.rb b/lib/rake/dsl_definition.rb index b521b7dc5c..26f4ca828c 100644 --- a/lib/rake/dsl_definition.rb +++ b/lib/rake/dsl_definition.rb @@ -159,6 +159,8 @@ module Rake end # Describes the next rake task. Duplicate descriptions are discarded. + # Descriptions are shown with rake -T (up to the first + # sentence) and rake -D (the entire description). # # Example: # desc "Run the Unit Tests" -- cgit v1.2.3