From 4eb8b7d70cd0040dc043eff939f549213cb713d1 Mon Sep 17 00:00:00 2001 From: "Anthony J. Bentley" Date: Fri, 28 Aug 2015 01:34:34 -0600 Subject: [PATCH 001/108] Convert manual page to use semantic -mdoc macros. --- doc/rake.1 | 263 ++++++++++++++++++++++++++++------------------------- 1 file changed, 139 insertions(+), 124 deletions(-) diff --git a/doc/rake.1 b/doc/rake.1 index acfe650a2..dbfa66b3d 100644 --- a/doc/rake.1 +++ b/doc/rake.1 @@ -1,141 +1,156 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH RAKE 1 "December 3, 2014" "rake 10.4.2" "Rake User Commands" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -rake \- a make-like build utility for Ruby -.SH SYNOPSIS -\fBrake\fR [\fI\-f rakefile\fR] {\fIOPTIONS\fR} \fITARGETS...\fR -.br -.SH DESCRIPTION -.B rake -is a make-like build utility for Ruby. Tasks and dependencies are specified in -standard Ruby syntax. -.SH OPTIONS -.TP -\fB\-m\fR, \fB\-\-multitask\fR +.Dd December 3, 2014 +.Dt RAKE 1 +.Os rake 10.4.2 +.Sh NAME +.Nm rake +.Nd make-like build utility for Ruby +.Sh SYNOPSIS +.Nm +.Op Fl f Ar rakefile +.Op Ar options +.Ar targets ... +.Sh DESCRIPTION +.Nm +is a +.Xr make 1 Ns -like +build utility for Ruby. +Tasks and dependencies are specified in standard Ruby syntax. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl m , Fl -multitask Treat all tasks as multitasks. -.TP -\fB\-B\fR, \fB\-\-build\-all\fR +.It Fl B , Fl -build-all Build all prerequisites, including those which are up\-to\-date. - -.TP -\fB\-j\fR, \fB\-\-jobs\fR [\fINUMBER\fR] +.It Fl j , Fl -jobs Ar num_jobs Specifies the maximum number of tasks to execute in parallel (default is number of CPU cores + 4). - -.SS Modules -.TP -\fB\-I\fR, \fB\-\-libdir\fR \fILIBDIR\fR -Include \fILIBDIR\fR in the search path for required modules. -.TP -\fB\-r\fR, \fB\-\-require\fR \fIMODULE\fR -Require \fIMODULE\fR before executing rakefile. - -.SS Rakefile location -.TP -\fB\-f\fR, \fB\-\-rakefile\fR [\fIFILENAME\fR] -Use \fIFILENAME\fR as the rakefile to search for. -.TP -\fB\-N\fR, \fB\-\-no\-search\fR, \fB\-\-nosearch\fR +.El +.Ss Modules +.Bl -tag -width Ds +.It Fl I , Fl -libdir Ar libdir +Include +.Ar libdir +in the search path for required modules. +.It Fl r , Fl -require Ar module +Require +.Ar module +before executing +.Pa rakefile . +.El +.Ss Rakefile location +.Bl -tag -width Ds +.It Fl f , Fl -rakefile Ar filename +Use +.Ar filename +as the rakefile to search for. +.It Fl N , Fl -no-search , Fl -nosearch Do not search parent directories for the Rakefile. -.TP -\fB\-G\fR, \fB\-\-no\-system\fR, \fB\-\-nosystem\fR +.It Fl G , Fl -no-system , Fl -nosystem Use standard project Rakefile search paths, ignore system wide rakefiles. -.TP -\fB\-R\fR, \fB\-\-rakelibdir\fR \fIRAKELIBDIR\fR -Auto\-import any .rake files in \fIRAKELIBDIR\fR (default is 'rakelib') -.HP -\fB\-\-rakelib\fR -.TP -\fB\-g\fR, \fB\-\-system\fR -Using system wide (global) rakefiles (usually '\fI~/.rake/*.rake\fR'). - -.SS Debugging -.TP -\fB\-\-backtrace\fR=\fI\,[OUT]\/\fR -Enable full backtrace. \fIOUT\fR can be stderr (default) or stdout. -.TP -\fB\-t\fR, \fB\-\-trace\fR=\fI\,[OUT]\/\fR -Turn on invoke/execute tracing, enable full backtrace. \fIOUT\fR can be stderr (default) or stdout. -.TP -\fB\-\-suppress\-backtrace\fR \fIPATTERN\fR -Suppress backtrace lines matching regexp \fIPATTERN\fR. Ignored if \fI\-\-trace\fR is on. -.TP -\fB\-\-rules\fR +.It Fl R , Fl -rakelib Ar rakelibdir , Fl -rakelibdir Ar rakelibdir +Auto-import any .rake files in +.Ar rakelibdir +(default is +.Sq rakelib ) +.It Fl g , Fl -system +Use system-wide (global) rakefiles (usually +.Pa ~/.rake/*.rake ) . +.El +.Ss Debugging +.Bl -tag -width Ds +.It Fl -backtrace Ns = Ns Ar out +Enable full backtrace. +.Ar out +can be +.Dv stderr +(default) or +.Dv stdout . +.It Fl t , Fl -trace Ns = Ns Ar out +Turn on invoke/execute tracing, enable full backtrace. +.Ar out +can be +.Dv stderr +(default) or +.Dv stdout . +.It Fl -suppress-backtrace Ar pattern +Suppress backtrace lines matching regexp +.Ar pattern . +Ignored if +.Fl -trace +is on. +.It Fl -rules Trace the rules resolution. - -.TP -\fB\-n\fR, \fB\-\-dry\-run\fR +.It Fl n , Fl -dry-run Do a dry run without executing actions. -.TP -\fB\-T\fR, \fB\-\-tasks\fR [\fIPATTERN\fR] -Display the tasks (matching optional \fIPATTERN\fR) with descriptions, then exit. -.TP -\fB\-D\fR, \fB\-\-describe\fR [\fIPATTERN\fR] -Describe the tasks (matching optional \fIPATTERN\fR), then exit. -.TP -\fB\-W\fR, \fB\-\-where\fR [\fIPATTERN\fR] -Describe the tasks (matching optional \fIPATTERN\fR), then exit. -.TP -\fB\-P\fR, \fB\-\-prereqs\fR +.It Fl T , Fl -tasks Op Ar pattern +Display the tasks (matching optional +.Ar pattern ) +with descriptions, then exit. +.It Fl D , Fl -describe Op Ar pattern +Describe the tasks (matching optional +.Ar pattern ) , +then exit. +.It Fl W , Fl -where Op Ar pattern +Describe the tasks (matching optional +.Ar pattern ) , +then exit. +.It Fl P , Fl -prereqs Display the tasks and dependencies, then exit. - -.TP -\fB\-e\fR, \fB\-\-execute\fR \fICODE\fR +.It Fl e , Fl -execute Ar code Execute some Ruby code and exit. -.TP -\fB\-p\fR, \fB\-\-execute\-print\fR \fICODE\fR +.It Fl p , Fl -execute-print Ar code Execute some Ruby code, print the result, then exit. -.TP -\fB\-E\fR, \fB\-\-execute\-continue\fR \fICODE\fR +.It Fl E , Fl -execute-continue Ar code Execute some Ruby code, then continue with normal task processing. - -.SS Information -.TP -\fB\-v\fR, \fB\-\-verbose\fR +.El +.Ss Information +.Bl -tag -width Ds +.It Fl v , Fl -verbose Log message to standard output. -.TP -\fB\-q\fR, \fB\-\-quiet\fR +.It Fl q , Fl -quiet Do not log messages to standard output. -.TP -\fB\-s\fR, \fB\-\-silent\fR -Like \fB\-\-quiet\fR, but also suppresses the 'in directory' announcement. -.TP -\fB\-X\fR, \fB\-\-no\-deprecation\-warnings\fR +.It Fl s , Fl -silent +Like +.Fl -quiet , +but also suppresses the +.Sq in directory +announcement. +.It Fl X , Fl -no-deprecation-warnings Disable the deprecation warnings. -.TP -\fB\-\-comments\fR +.It Fl -comments Show commented tasks only -.TP -\fB\-A\fR, \fB\-\-all\fR -Show all tasks, even uncommented ones (in combination with \fB\-T\fR or \fB\-D\fR) -.TP -\fB\-\-job\-stats\fR [\fILEVEL\fR] -Display job statistics. \fILEVEL=history\fR displays a complete job list -.TP -\fB\-V\fR, \fB\-\-version\fR +.It Fl A , Fl -all +Show all tasks, even uncommented ones (in combination with +.Fl T +or +.Fl D ) +.It Fl -job-stats Op Ar level +Display job statistics. +If +.Ar level +is +.Sq history , +displays a complete job list. +.It Fl V , Fl -version Display the program version. -.TP -\fB\-h\fR, \fB\-H\fR, \fB\-\-help\fR +.It Fl h , Fl H , Fl -help Display a help message. - -.SH SEE ALSO -The complete documentation for \fBrake\fR has been installed at \fI/usr/share/doc/rake-doc/html/index.html\fR. It is also available online at \fIhttp://docs.seattlerb.org/rake\fR. -.SH AUTHOR -.B rake -was written by Jim Weirich -.PP -This manual was created by Caitlin Matos for the Debian project (but may be used by others). It was inspired by the manual by Jani Monoses for the Ubuntu project. +.El +.Sh SEE ALSO +The complete documentation for +.Nm rake +has been installed at +.Pa /usr/share/doc/rake-doc/html/index.html . +It is also available online at +.Lk http://docs.seattlerb.org/rake . +.Sh AUTHORS +.An -nosplit +.Nm +was written by +.An Jim Weirich Aq Mt jim@weirichhouse.org . +.Pp +This manual was created by +.An Caitlin Matos Aq Mt caitlin.matos@zoho.com +for the Debian project (but may be used by others). +It was inspired by the manual by +.An Jani Monoses Aq Mt jani@iv.ro +for the Ubuntu project. From 81eb4b98d60d0400fa9336fc7184e8725c927f94 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 6 May 2016 18:50:48 +0900 Subject: [PATCH 002/108] Removed needless stdlibs. * shellwords didn't use Rake 11 * thread is core library --- lib/rake/application.rb | 1 - lib/rake/thread_pool.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index f27e874a7..9a21dbb22 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -1,4 +1,3 @@ -require 'shellwords' require 'optparse' require 'rake/task_manager' diff --git a/lib/rake/thread_pool.rb b/lib/rake/thread_pool.rb index 691daeabe..a11af0393 100644 --- a/lib/rake/thread_pool.rb +++ b/lib/rake/thread_pool.rb @@ -1,4 +1,3 @@ -require 'thread' require 'set' require 'rake/promise' From ace14c70a6d3fdabe7a9e9e8f068e5ab7a006fd5 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 6 May 2016 18:58:20 +0900 Subject: [PATCH 003/108] remove empty line --- lib/rake/rule_recursion_overflow_error.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/rake/rule_recursion_overflow_error.rb b/lib/rake/rule_recursion_overflow_error.rb index da4318da9..b71e08efb 100644 --- a/lib/rake/rule_recursion_overflow_error.rb +++ b/lib/rake/rule_recursion_overflow_error.rb @@ -1,4 +1,3 @@ - module Rake # Error indicating a recursion overflow error in task selection. From 9c733f7dfdfd4da6492525d69d11c29db6d3dd35 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 6 May 2016 20:10:28 +0900 Subject: [PATCH 004/108] remove empty line --- lib/rake/rake_test_loader.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/rake/rake_test_loader.rb b/lib/rake/rake_test_loader.rb index 7e3a6b3f3..bc4e1751e 100644 --- a/lib/rake/rake_test_loader.rb +++ b/lib/rake/rake_test_loader.rb @@ -19,4 +19,3 @@ end ARGV.replace argv - From af8c0f83a1149607439e9391c00a115d9bf0c661 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 6 May 2016 20:11:33 +0900 Subject: [PATCH 005/108] A test of default gems is obsoleted for Ruby 1.8 --- test/test_rake_test_task.rb | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 9f83d8082..9b27bfdd8 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -104,25 +104,6 @@ def test_run_code_rake Gem.loaded_specs['rake'] = rake end - def test_run_code_rake_default_gem - skip 'this ruby does not have default gems' unless - Gem::Specification.method_defined? :default_specifications_dir - - default_spec = Gem::Specification.new 'rake', 0 - default_spec.loaded_from = File.join Gem::Specification.default_specifications_dir, 'rake-0.gemspec' - begin - rake, Gem.loaded_specs['rake'] = Gem.loaded_specs['rake'], default_spec - - test_task = Rake::TestTask.new do |t| - t.loader = :rake - end - - assert_match(/\A(-I".*?" *)* ".*?"\Z/, test_task.run_code) - ensure - Gem.loaded_specs['rake'] = rake - end - end - def test_test_files_equals tt = Rake::TestTask.new do |t| t.test_files = FileList['a.rb', 'b.rb'] From c5197eed00af8b62cdb2dfeae6722cb6b5c51aae Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 6 May 2016 20:30:54 +0900 Subject: [PATCH 006/108] Removed old configuraiton of rubocop --- .rubocop.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 6d2bfcdbd..385e49289 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,15 +1,6 @@ StringLiterals: Enabled: false -MultilineBlocks: - Enabled: false - -SingleLineBlocks: - Enabled: false - -NewLambdaLiteral: - Enabled: false - SpaceAroundEqualsInParameterDefault: Enabled: false From 1a64729724fc089a9317fd7efb9bdd4c1ec43312 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 6 May 2016 20:52:24 +0900 Subject: [PATCH 007/108] use attr_writer instead of method definition --- lib/rake/application.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index f27e874a7..e8fd7eb6b 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -35,6 +35,9 @@ class Application # List of the top level task names (task names from the command line). attr_reader :top_level_tasks + # Override the detected TTY output state (mostly for testing) + attr_writer :tty_output + DEFAULT_RAKEFILES = [ 'rakefile', 'Rakefile', @@ -269,11 +272,6 @@ def tty_output? # :nodoc: @tty_output end - # Override the detected TTY output state (mostly for testing) - def tty_output=(tty_output_state) # :nodoc: - @tty_output = tty_output_state - end - # We will truncate output if we are outputting to a TTY or if we've been # given an explicit column width to honor def truncate_output? # :nodoc: From 704537d9c5f391617cf731c5233e15b6972e2199 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 7 May 2016 08:21:08 +0900 Subject: [PATCH 008/108] Removed unused block argument --- test/test_rake_application_options.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_rake_application_options.rb b/test/test_rake_application_options.rb index d3ba12b78..1525bcd6a 100644 --- a/test/test_rake_application_options.rb +++ b/test/test_rake_application_options.rb @@ -72,7 +72,7 @@ def test_describe_with_pattern def test_execute $xyzzy = 0 - flags('--execute=$xyzzy=1', '-e $xyzzy=1') do |opts| + flags('--execute=$xyzzy=1', '-e $xyzzy=1') do assert_equal 1, $xyzzy assert_equal :exit, @exit $xyzzy = 0 @@ -81,7 +81,7 @@ def test_execute def test_execute_and_continue $xyzzy = 0 - flags('--execute-continue=$xyzzy=1', '-E $xyzzy=1') do |opts| + flags('--execute-continue=$xyzzy=1', '-E $xyzzy=1') do assert_equal 1, $xyzzy refute_equal :exit, @exit $xyzzy = 0 @@ -91,7 +91,7 @@ def test_execute_and_continue def test_execute_and_print $xyzzy = 0 out, = capture_io do - flags('--execute-print=$xyzzy="pugh"', '-p $xyzzy="pugh"') do |opts| + flags('--execute-print=$xyzzy="pugh"', '-p $xyzzy="pugh"') do assert_equal 'pugh', $xyzzy assert_equal :exit, @exit $xyzzy = 0 @@ -134,7 +134,7 @@ def test_jobs end def test_libdir - flags(['--libdir', 'xx'], ['-I', 'xx'], ['-Ixx']) do |opts| + flags(['--libdir', 'xx'], ['-I', 'xx'], ['-Ixx']) do $:.include?('xx') end ensure @@ -148,7 +148,7 @@ def test_multitask end def test_rakefile - flags(['--rakefile', 'RF'], ['--rakefile=RF'], ['-f', 'RF'], ['-fRF']) do |opts| + flags(['--rakefile', 'RF'], ['--rakefile=RF'], ['-f', 'RF'], ['-fRF']) do assert_equal ['RF'], @app.instance_eval { @rakefiles } end end From 4bd340fbd28769654edb3242794984b165cfb0ea Mon Sep 17 00:00:00 2001 From: leethomas Date: Sat, 14 May 2016 22:23:01 -0700 Subject: [PATCH 009/108] added test cases for new comment parsing rules --- test/test_rake_task.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 63ff86556..d9e13bd60 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -352,12 +352,24 @@ def test_comment_setting assert_equal "A Comment", t.comment end - def test_comments_with_sentences + def test_comments_with_sentences_period desc "Comment 1. Comment 2." t = task(:t, :name, :rev) assert_equal "Comment 1", t.comment end + def test_comments_with_sentences_exclamation_mark + desc "An exclamation mark! Comment." + t = task(:t, :name, :rev) + assert_equal "An exclamation mark", t.comment + end + + def test_comments_with_many_periods + desc "This is a test...I think ... testing. Comment." + t = task(:t, :name, :rev) + assert_equal "This is a test...I think ... testing", t.comment + end + def test_comments_with_tabbed_sentences desc "Comment 1.\tComment 2." t = task(:t, :name, :rev) From 355d1ace7b2b8cb669e4e0aa16115c3c84fc5309 Mon Sep 17 00:00:00 2001 From: leethomas Date: Sat, 14 May 2016 22:24:56 -0700 Subject: [PATCH 010/108] update comment parsing rules to exclude non sentence terminating periods, include exclamation marks --- lib/rake/task.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 1d3244d2b..5300b6fc4 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -304,10 +304,10 @@ def transform_comments(separator, &block) private :transform_comments # Get the first sentence in a string. The sentence is terminated - # by the first period or the end of the line. Decimal points do - # not count as periods. + # by the first period, exclamation mark, or the end of the line. + # Decimal points do not count as periods. def first_sentence(string) - string.split(/\.[ \t]|\.$|\n/).first + string.split(/(?<=\w)(\.|!)[ \t]|(\.$|!)|\n/).first end private :first_sentence From a238c0407997772ebf16be06035cc4d6957f1270 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 16 May 2016 12:06:52 +0900 Subject: [PATCH 011/108] removed rbx-2 from allow_failures. It's not fragile state --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f1a118c04..477e55fc4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,6 @@ script: ruby -Ilib exe/rake matrix: allow_failures: - rvm: jruby-head - - rvm: rbx-2 - rvm: rbx notifications: email: From 677f182ac1aaacbb6e085daca55df2f46dc8266f Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 16 May 2016 12:11:37 +0900 Subject: [PATCH 012/108] History --- History.rdoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/History.rdoc b/History.rdoc index 006b6c71f..dc9304b26 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,5 +1,10 @@ === 11.2.0(dev) / 2016- +Bug fixes: + +* Fix unexpected cut-out behavior on task description using triple dots + and exclamation. Report #106 from Stephan Kämper and Pull request #134 by Lee + Enhancements: * Allow to specify dependencies(prerequisites) for Rake::TestTask From acacbcb892d62906fae23ea030117af3804eb91f Mon Sep 17 00:00:00 2001 From: Izuta Hiroyuki Date: Mon, 16 May 2016 23:51:49 +0900 Subject: [PATCH 013/108] Don't set if args are blank --- lib/rake/task_arguments.rb | 3 ++- test/test_rake_task_arguments.rb | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/rake/task_arguments.rb b/lib/rake/task_arguments.rb index d86c5d11a..4eaf2f8b9 100644 --- a/lib/rake/task_arguments.rb +++ b/lib/rake/task_arguments.rb @@ -17,7 +17,8 @@ def initialize(names, values, parent=nil) @hash = {} @values = values names.each_with_index { |name, i| - @hash[name.to_sym] = values[i] unless values[i].nil? + next if values[i].nil? || values[i] == '' + @hash[name.to_sym] = values[i] } end diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index abd41ebea..554c13f57 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -19,6 +19,11 @@ def test_multiple_values_in_args assert_equal({:a => :one, :b => :two, :c => :three}, ta.to_hash) end + def test_blank_values_in_args + ta = Rake::TaskArguments.new([:a, :b, :c], ['', :two, '']) + assert_equal({:b => :two}, ta.to_hash) + end + def test_has_key ta = Rake::TaskArguments.new([:a], [:one]) assert(ta.has_key?(:a)) From 89531048c1fd8f4ef719bf4b8e4d4c4cd745014b Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Thu, 9 Jun 2016 13:45:08 -0700 Subject: [PATCH 014/108] Improve output of sh with an ENV hash Given: env = { 'MESSAGE' => 'hello world', } sh env, "echo $MESSAGE" Previously `rake -t` would output: {"MESSAGE"=>"hello world"} echo $MESSAGE Now it outputs: MESSAGE=hello world echo $MESSAGE --- lib/rake/file_utils.rb | 18 ++++++++++++++++-- test/test_rake_file_utils.rb | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb index ff2f45321..5f6877d1c 100644 --- a/lib/rake/file_utils.rb +++ b/lib/rake/file_utils.rb @@ -48,7 +48,7 @@ def sh(*cmd, &block) set_verbose_option(options) options[:noop] ||= Rake::FileUtilsExt.nowrite_flag Rake.rake_check_options options, :noop, :verbose - Rake.rake_output_message cmd.join(" ") if options[:verbose] + Rake.rake_output_message sh_show_command cmd if options[:verbose] unless options[:noop] res = system(*cmd) @@ -59,8 +59,9 @@ def sh(*cmd, &block) end def create_shell_runner(cmd) # :nodoc: - show_command = cmd.join(" ") + show_command = sh_show_command cmd show_command = show_command[0, 42] + "..." unless $trace + lambda do |ok, status| ok or fail "Command failed with status (#{status.exitstatus}): " + @@ -69,6 +70,19 @@ def create_shell_runner(cmd) # :nodoc: end private :create_shell_runner + def sh_show_command(cmd) # :nodoc: + cmd = cmd.dup + + if Hash === cmd.first + env = cmd.first + env = env.map { |name, value| "#{name}=#{value}" }.join " " + cmd[0] = env + end + + cmd.join " " + end + private :sh_show_command + def set_verbose_option(options) # :nodoc: unless options.key? :verbose options[:verbose] = diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index 3204a5799..0f7520500 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -141,6 +141,18 @@ def test_sh_with_a_single_string_argument } end + def test_sh_with_env + check_environment + + env = { + 'RAKE_TEST_SH' => 'someval' + } + + verbose(false) { + sh env, RUBY, 'check_environment.rb', 'RAKE_TEST_SH', 'someval' + } + end + def test_sh_with_multiple_arguments skip if jruby9? # https://github.com/jruby/jruby/issues/3653 @@ -241,6 +253,20 @@ def test_ruby_with_a_single_string_argument } end + def test_sh_show_command + env = { + 'RAKE_TEST_SH' => 'someval' + } + + cmd = [env, RUBY, 'some_file.rb', 'some argument'] + + show_cmd = send :sh_show_command, cmd + + expected_cmd = "RAKE_TEST_SH=someval #{RUBY} some_file.rb some argument" + + assert_equal expected_cmd, show_cmd + end + def test_ruby_with_multiple_arguments skip if jruby9? # https://github.com/jruby/jruby/issues/3653 @@ -279,6 +305,16 @@ def check_no_expansion CHECK_EXPANSION end + def check_environment + command 'check_environment.rb', <<-CHECK_ENVIRONMENT +if ENV[ARGV[0]] != ARGV[1] + exit 1 +else + exit 0 +end + CHECK_ENVIRONMENT + end + def check_expansion command 'check_expansion.rb', <<-CHECK_EXPANSION if ARGV[0] != ARGV[1] From 226b8a0dbfca92dfb4202dcf589b53400584d6f3 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Thu, 9 Jun 2016 13:58:21 -0700 Subject: [PATCH 015/108] Allow spawn options with sh This allows any option spawn takes along with rake's special noop: and verbose:. --- lib/rake/file_utils.rb | 12 +++++++----- test/test_rake_file_utils.rb | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb index 5f6877d1c..14cb092fc 100644 --- a/lib/rake/file_utils.rb +++ b/lib/rake/file_utils.rb @@ -45,13 +45,15 @@ module FileUtils def sh(*cmd, &block) options = (Hash === cmd.last) ? cmd.pop : {} shell_runner = block_given? ? block : create_shell_runner(cmd) + set_verbose_option(options) - options[:noop] ||= Rake::FileUtilsExt.nowrite_flag - Rake.rake_check_options options, :noop, :verbose - Rake.rake_output_message sh_show_command cmd if options[:verbose] + verbose = options.delete :verbose + noop = options.delete(:noop) || Rake::FileUtilsExt.nowrite_flag + + Rake.rake_output_message sh_show_command cmd if verbose - unless options[:noop] - res = system(*cmd) + unless noop + res = system(*cmd, options) status = $? status = Rake::PseudoStatus.new(1) if !res && status.nil? shell_runner.call(res, status) diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index 0f7520500..888dc0ba9 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -164,6 +164,20 @@ def test_sh_with_multiple_arguments } end + def test_sh_with_spawn_options + echocommand + + r, w = IO.pipe + + verbose(false) { + sh RUBY, 'echocommand.rb', out: w + } + + w.close + + assert_equal "echocommand.rb\n", r.read + end + def test_sh_failure shellcommand @@ -325,6 +339,16 @@ def check_expansion CHECK_EXPANSION end + def echocommand + command 'echocommand.rb', <<-ECHOCOMMAND +#!/usr/bin/env ruby + +puts "echocommand.rb" + +exit 0 + ECHOCOMMAND + end + def replace_ruby ruby = FileUtils::RUBY FileUtils.send :remove_const, :RUBY From 230dc2b735a70391465191574d4ee367258c49ab Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Thu, 9 Jun 2016 15:38:35 -0700 Subject: [PATCH 016/108] Skip failing tests on JRuby due spawn options JRuby does not yet support spawn options sent to system so skip these tests. --- test/test_rake_file_utils.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index 888dc0ba9..1b43a49d1 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -165,6 +165,8 @@ def test_sh_with_multiple_arguments end def test_sh_with_spawn_options + skip 'JRuby does not support spawn options' if jruby? + echocommand r, w = IO.pipe @@ -213,6 +215,10 @@ def test_sh_noop end def test_sh_bad_option + # Skip on JRuby because option checking is performed by spawn via system + # now. + skip 'JRuby does not support spawn options' if jruby? + shellcommand ex = assert_raises(ArgumentError) { From e517c18af324e6693d3938d64a67e1daf7f91226 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 11 Jun 2016 12:49:07 +0900 Subject: [PATCH 017/108] History --- History.rdoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/History.rdoc b/History.rdoc index dc9304b26..169cf0059 100644 --- a/History.rdoc +++ b/History.rdoc @@ -4,9 +4,12 @@ Bug fixes: * Fix unexpected cut-out behavior on task description using triple dots and exclamation. Report #106 from Stephan Kämper and Pull request #134 by Lee +* Fix empty argument assignment with `with_defaults` option. Pull request #135 + by bakunyo Enhancements: +* Spawn options for sh Pull equest #138 by Eric Hodel. * Allow to specify dependencies(prerequisites) for Rake::TestTask Pull request #117 by Tim Maslyuchenko * Use Bundler task instead of hoe for gem release. From 2f63b5202234f1022058f56aac2b1158f879d7ee Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 11 Jun 2016 12:54:23 +0900 Subject: [PATCH 018/108] History --- History.rdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/History.rdoc b/History.rdoc index 169cf0059..ba106483a 100644 --- a/History.rdoc +++ b/History.rdoc @@ -6,6 +6,7 @@ Bug fixes: and exclamation. Report #106 from Stephan Kämper and Pull request #134 by Lee * Fix empty argument assignment with `with_defaults` option. Pull request #135 by bakunyo +* Ignore to use `hwprefs` on Darwin platform. Use sysctl now. Report #128 Enhancements: From 2ed8f9c549425265aaa14a4f70455a9c2d6086a0 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 11 Jun 2016 12:54:40 +0900 Subject: [PATCH 019/108] bump version to 11.2.0 --- lib/rake/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/version.rb b/lib/rake/version.rb index 354753550..07f341dd7 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,5 +1,5 @@ module Rake - VERSION = '11.1.2' + VERSION = '11.2.0' module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split '.' From 7ff501a2109ecce9654a7b734372ca1db3cbe5ec Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 11 Jun 2016 18:17:32 +0900 Subject: [PATCH 020/108] History --- History.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index ba106483a..0ea9241d3 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,4 +1,4 @@ -=== 11.2.0(dev) / 2016- +=== 11.2.0 / 2016-06-11 Bug fixes: From 4c7bb867f6aadf45c33bbd512c94c294eff586aa Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 12 Jun 2016 09:50:50 +0900 Subject: [PATCH 021/108] Rake 11.2.0 broke dependency task of Rake::TestTask, If it's given. It needs to extract TestLib dependency --- lib/rake/testtask.rb | 4 ++++ test/test_rake_test_task.rb | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 27ad790af..9d5d88a02 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -93,6 +93,10 @@ def initialize(name=:test) @ruby_opts = [] @description = "Run tests" + (@name == :test ? "" : " for #{@name}") @deps = [] + if @name.is_a?(Hash) + @deps = @name.values + @name = @name.keys.first + end yield self if block_given? @pattern = 'test/test*.rb' if @pattern.nil? && @test_files.nil? define diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 9b27bfdd8..17167d74b 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -16,8 +16,15 @@ def test_initialize assert Task.task_defined?(:test) end + def test_initialize_deps + tt = Rake::TestTask.new(:example => :bar) + refute_nil tt + assert_equal [:bar], tt.deps + assert Task.task_defined?(:example) + end + def test_initialize_override - tt = Rake::TestTask.new(:example) do |t| + tt = Rake::TestTask.new(:example => :bar) do |t| t.description = "Run example tests" t.libs = ['src', 'ext'] t.pattern = 'test/tc_*.rb' From 5b0399a61eccf8001fcf198a6a901812710abb01 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 12 Jun 2016 10:12:38 +0900 Subject: [PATCH 022/108] History --- History.rdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/History.rdoc b/History.rdoc index 0ea9241d3..2f8c7a33f 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,9 @@ +=== 11.2.1 / 2016-06-12 + +Bug fixes: + +* Fix regression of dependencies handling on Rake::TestTask. Report #139 + === 11.2.0 / 2016-06-11 Bug fixes: From d254592bad2f805dc40fdeeb47fd596660d2a71a Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 12 Jun 2016 10:12:49 +0900 Subject: [PATCH 023/108] bump version to 11.2.1 --- lib/rake/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/version.rb b/lib/rake/version.rb index 07f341dd7..e9a2d23fc 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,5 +1,5 @@ module Rake - VERSION = '11.2.0' + VERSION = '11.2.1' module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split '.' From 60cf03f6ecb563731bed64a86f06de6bac72f44e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 12 Jun 2016 10:15:28 +0900 Subject: [PATCH 024/108] up to date --- rake.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index dd5750e8a..04bbd3327 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -5,7 +5,7 @@ require 'rake/version' Gem::Specification.new do |s| s.name = "rake".freeze s.version = Rake::VERSION - s.date = "2016-03-27" + s.date = "2016-06-12" s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze] s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze] From 142e6cb6490b607413150636c82fef9eb8743c1f Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 12 Jun 2016 10:37:55 +0900 Subject: [PATCH 025/108] fixed bug with multiple dependencies --- lib/rake/testtask.rb | 2 +- test/test_rake_test_task.rb | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 9d5d88a02..4c6f71917 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -94,7 +94,7 @@ def initialize(name=:test) @description = "Run tests" + (@name == :test ? "" : " for #{@name}") @deps = [] if @name.is_a?(Hash) - @deps = @name.values + @deps = @name.values.first @name = @name.keys.first end yield self if block_given? diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 17167d74b..8c63d791e 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -19,7 +19,14 @@ def test_initialize def test_initialize_deps tt = Rake::TestTask.new(:example => :bar) refute_nil tt - assert_equal [:bar], tt.deps + assert_equal :bar, tt.deps + assert Task.task_defined?(:example) + end + + def test_initialize_multi_deps + tt = Rake::TestTask.new(:example => [:foo, :bar]) + refute_nil tt + assert_equal [:foo, :bar], tt.deps assert Task.task_defined?(:example) end From 6378ce7fee7068d07f6e39df8b163ec8f227393e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 12 Jun 2016 10:46:04 +0900 Subject: [PATCH 026/108] History --- History.rdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/History.rdoc b/History.rdoc index 2f8c7a33f..6ff5088df 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,9 @@ +=== 11.2.2 / 2016-06-12 + +Bug fixes: + +* Fix unexpected behavior with multiple dependencies on Rake::TestTask + === 11.2.1 / 2016-06-12 Bug fixes: From 8638b497423a4d69f7155d5ef67a3aa2363762be Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 12 Jun 2016 11:00:24 +0900 Subject: [PATCH 027/108] added defensive tests --- test/test_rake_test_task.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 8c63d791e..1b15f7a8d 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -128,6 +128,24 @@ def test_test_files_equals def test_task_prerequisites Rake::TestTask.new :parent + Rake::TestTask.new :child => :parent + + task = Rake::Task[:child] + assert_includes task.prerequisites, 'parent' + end + + def test_task_prerequisites_multi + Rake::TestTask.new :parent + Rake::TestTask.new :parent2 + Rake::TestTask.new :child => [:parent, :parent2] + + task = Rake::Task[:child] + assert_includes task.prerequisites, 'parent' + assert_includes task.prerequisites, 'parent2' + end + + def test_task_prerequisites_deps + Rake::TestTask.new :parent Rake::TestTask.new :child do |t| t.deps = :parent From b63f7d33d72782f646ef95da10300d273c9b8006 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 12 Jun 2016 11:00:35 +0900 Subject: [PATCH 028/108] bump version to 11.2.2 --- lib/rake/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/version.rb b/lib/rake/version.rb index e9a2d23fc..c9660a45e 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,5 +1,5 @@ module Rake - VERSION = '11.2.1' + VERSION = '11.2.2' module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split '.' From 3a1b5bc90eac771d473e25398138b9866100b9fa Mon Sep 17 00:00:00 2001 From: ptarjan Date: Tue, 21 Jun 2016 17:31:43 -0700 Subject: [PATCH 029/108] Do not run tasks when their prerequisites fail If tasks A and B both depend on C, they race to grab the invocation lock on C. If A wins, it sets @already_invoked and executes C while holding the lock. When C completes, A releases the lock, B acquires it and immediately returns since C is @already_invoked. Unfortunately, this does not distinguish failed execution of C. Instead, if executing C raises an exception for A, we want to raise the same exception in B so it is aborted. --- lib/rake/multi_task.rb | 36 ++++++++++++++++++++++++++++++++++++ test/test_rake_multi_task.rb | 21 +++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/lib/rake/multi_task.rb b/lib/rake/multi_task.rb index 5418a7a7b..7118dc411 100644 --- a/lib/rake/multi_task.rb +++ b/lib/rake/multi_task.rb @@ -4,6 +4,42 @@ module Rake # parallel using Ruby threads. # class MultiTask < Task + + # Same as invoke, but explicitly pass a call chain to detect + # circular dependencies. This is largely copied from Rake::Task + # but has been updated such that if multiple tasks depend on this + # one in parallel, they will all fail if the first execution of + # this task fails. + def invoke_with_call_chain(task_args, invocation_chain) + new_chain = Rake::InvocationChain.append(self, invocation_chain) + @lock.synchronize do + begin + if @already_invoked + if @invocation_exception + if application.options.trace + application.trace "** Previous invocation of #{name} failed #{format_trace_flags}" + end + raise @invocation_exception + else + return + end + end + + if application.options.trace + application.trace "** Invoke #{name} #{format_trace_flags}" + end + @already_invoked = true + + invoke_prerequisites(task_args, new_chain) + execute(task_args) if needed? + rescue Exception => ex + add_chain_to(ex, new_chain) + @invocation_exception = ex + raise + end + end + end + private def invoke_prerequisites(task_args, invocation_chain) # :nodoc: invoke_prerequisites_concurrently(task_args, invocation_chain) diff --git a/test/test_rake_multi_task.rb b/test/test_rake_multi_task.rb index 9f8fed6d5..f7a004164 100644 --- a/test/test_rake_multi_task.rb +++ b/test/test_rake_multi_task.rb @@ -61,4 +61,25 @@ def test_multitasks_with_parameters assert @runs[0] == "b" assert @runs[1] == "bmt" end + + def test_cross_thread_prerequisite_failures + failed = false + + multitask :fail_once do + fail_now = !failed + failed = true + raise 'failing once' if fail_now + end + + task a: :fail_once + task b: :fail_once + + assert_raises RuntimeError do + Rake::Task[:a].invoke + end + + assert_raises RuntimeError do + Rake::Task[:b].invoke + end + end end From ddb89beb542ae1eaaa83494122eed88284ee83c1 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Wed, 22 Jun 2016 11:10:58 -0700 Subject: [PATCH 030/108] Install bundler for JRuby Travis log: $ gem update bundler --no-document jruby: warning: unknown property jruby.cext.enabled Updating installed gems Nothing to update $ bundle install --jobs=3 --retry=3 /home/travis/build.sh: line 179: bundle: command not found The command "eval bundle install --jobs=3 --retry=3" failed. Retrying, 2 of 3. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 477e55fc4..fbfa9824b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ rvm: - rbx-2 - rbx before_install: - - gem update bundler --no-document + - gem install bundler --no-document before_script: - unset JRUBY_OPTS script: ruby -Ilib exe/rake From 7520a185ab9762a5bb5bfe6d823d8cd582d95f63 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Wed, 22 Jun 2016 11:11:58 -0700 Subject: [PATCH 031/108] The rbx-2 build can fail for unknown reasons Travis log: No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index fbfa9824b..934403400 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ matrix: allow_failures: - rvm: jruby-head - rvm: rbx + - rvm: rbx-2 notifications: email: - hsbt@ruby-lang.org From 04d48a41679857492259dcdd88ef01b14d0017d0 Mon Sep 17 00:00:00 2001 From: Hendy Tanata Date: Wed, 22 Jun 2016 11:23:06 -0700 Subject: [PATCH 032/108] Remove mention of environment variables as task argument. Related to commit 57cdf0fafb85c9f4efbcd871e094686fdc2ca753. Support for environment variables as task argument was removed on commit 5148aac8b61246432d6d87f19f26e401ace62853. --- doc/rakefile.rdoc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/rakefile.rdoc b/doc/rakefile.rdoc index d18680e51..89a28ebee 100644 --- a/doc/rakefile.rdoc +++ b/doc/rakefile.rdoc @@ -223,9 +223,7 @@ behaviour can now accept a second parameter: The first argument of the block "t" is always bound to the current task object. The second argument "args" is an open-struct like object that allows access to the task arguments. Extra command line -arguments to a task are ignored. Missing command line arguments are -picked up from matching environment variables. If there are no -matching environment variables, they are given the nil value. +arguments to a task are ignored. If you wish to specify default values for the arguments, you can use the with_defaults method in the task body. Here is the above example From e9ac42ca95bdb84fb4c673025bc7ddc722b64002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sun, 26 Jun 2016 00:20:58 -0400 Subject: [PATCH 033/108] Remove trailing slash on a link in README --- README.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index 889bd9785..9dd7b9cdf 100644 --- a/README.rdoc +++ b/README.rdoc @@ -2,7 +2,7 @@ home :: https://github.com/ruby/rake bugs :: https://github.com/ruby/rake/issues -docs :: http://docs.seattlerb.org/rake/ +docs :: http://docs.seattlerb.org/rake build status :: {travis-ci}[https://travis-ci.org/ruby/rake] {appveyor}[https://ci.appveyor.com/project/ruby/rake] == Description From e7e11037118a2737bdc941fe1aa244bd57aa5579 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 28 Jun 2016 15:08:28 +0900 Subject: [PATCH 034/108] added helper method for rbx --- test/helper.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/helper.rb b/test/helper.rb index f8f1fe106..7eb560eea 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -115,5 +115,9 @@ def jruby9? jruby? && (JRUBY_VERSION >= '9.0.0.0') end + def rbx? + RUBY_ENGINE == 'rbx' + end + include RakefileDefinitions end From d36cc95f294077919f0cfc693eace439e9921870 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 28 Jun 2016 15:10:53 +0900 Subject: [PATCH 035/108] skip broken test with rbx --- test/test_private_reader.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_private_reader.rb b/test/test_private_reader.rb index f86d4249b..895c6a05d 100644 --- a/test/test_private_reader.rb +++ b/test/test_private_reader.rb @@ -24,6 +24,7 @@ def setup end def test_private_reader_is_private + skip if rbx? assert_private do @sample.reader end assert_private do @sample.a end end From 6a94c543b624b48006f21b499a7802839e2315af Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 28 Jun 2016 15:12:03 +0900 Subject: [PATCH 036/108] remove allow_failures, their are skipped in tests --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 934403400..2f5898ae4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,11 +18,6 @@ before_install: before_script: - unset JRUBY_OPTS script: ruby -Ilib exe/rake -matrix: - allow_failures: - - rvm: jruby-head - - rvm: rbx - - rvm: rbx-2 notifications: email: - hsbt@ruby-lang.org From f413799b5ac5c3f443ed35c874f9e4ed8c8f3a40 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Jul 2016 20:16:17 +0900 Subject: [PATCH 037/108] Reversed restore condition for RAKE_COLUMNS. Fixed #146 --- test/test_rake_application.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index daa4a57ba..e3bc43842 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -351,9 +351,9 @@ def test_terminal_columns assert_equal 42, app.terminal_columns ensure if old_rake_columns - ENV['RAKE_COLUMNS'].delete - else ENV['RAKE_COLUMNS'] = old_rake_columns + else + ENV.delete 'RAKE_COLUMNS' end end From 7dbdf53b4d5870496b08a4eec6c4c49e61f79f2e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Jul 2016 20:51:22 +0900 Subject: [PATCH 038/108] update release date --- doc/rake.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/rake.1 b/doc/rake.1 index dbfa66b3d..2e830176a 100644 --- a/doc/rake.1 +++ b/doc/rake.1 @@ -1,6 +1,6 @@ -.Dd December 3, 2014 +.Dd June 12, 2016 .Dt RAKE 1 -.Os rake 10.4.2 +.Os rake 11.2.2 .Sh NAME .Nm rake .Nd make-like build utility for Ruby From dc4af064c8ff117e1854e761b6f7a0d6eaa2d635 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Jul 2016 21:04:18 +0900 Subject: [PATCH 039/108] removed dead-link --- README.rdoc | 1 - 1 file changed, 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index 9dd7b9cdf..09ca18ca5 100644 --- a/README.rdoc +++ b/README.rdoc @@ -101,7 +101,6 @@ other projects with similar (and not so similar) goals. * http://directory.fsf.org/wiki/Bras -- Bras, one of earliest implementations of "make in a scripting language". * http://www.a-a-p.org -- Make in Python -* http://www.aromatic.com/tools/jam.txt -- JAM, Java Automated Make * http://ant.apache.org -- The Ant project * http://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System * http://www.rubydoc.info/gems/rant/0.5.7/frames -- Rant, another Ruby make tool. From 5e01167bd60856054fb9d0381836a1f4e47a458d Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Jul 2016 21:13:31 +0900 Subject: [PATCH 040/108] removed commented-out code --- lib/rake/task.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 5300b6fc4..7a57a0f85 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -382,7 +382,6 @@ def create_rule(*args, &block) # this kind of task. Generic tasks will accept the scope as # part of the name. def scope_name(scope, task_name) -# (scope + [task_name]).join(':') scope.path_with_task_name(task_name) end From 3daaaef6ee6951c35aba9dff93b90414de4c8a26 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 28 Jul 2016 22:02:04 +0900 Subject: [PATCH 041/108] removed rake contrib files, It should be extracted another gem --- lib/rake/contrib/compositepublisher.rb | 21 ---- lib/rake/contrib/ftptools.rb | 137 ------------------------- lib/rake/contrib/sshpublisher.rb | 60 ----------- 3 files changed, 218 deletions(-) delete mode 100644 lib/rake/contrib/compositepublisher.rb delete mode 100644 lib/rake/contrib/ftptools.rb delete mode 100644 lib/rake/contrib/sshpublisher.rb diff --git a/lib/rake/contrib/compositepublisher.rb b/lib/rake/contrib/compositepublisher.rb deleted file mode 100644 index 69952a080..000000000 --- a/lib/rake/contrib/compositepublisher.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Rake - - # Manage several publishers as a single entity. - class CompositePublisher - def initialize - @publishers = [] - end - - # Add a publisher to the composite. - def add(pub) - @publishers << pub - end - - # Upload all the individual publishers. - def upload - @publishers.each { |p| p.upload } - end - end - -end - diff --git a/lib/rake/contrib/ftptools.rb b/lib/rake/contrib/ftptools.rb deleted file mode 100644 index b178523bc..000000000 --- a/lib/rake/contrib/ftptools.rb +++ /dev/null @@ -1,137 +0,0 @@ -# = Tools for FTP uploading. -# -# This file is still under development and is not released for general -# use. - -require 'date' -require 'net/ftp' -require 'rake/file_list' - -module Rake # :nodoc: - - class FtpFile # :nodoc: all - attr_reader :name, :size, :owner, :group, :time - - def self.date - @date_class ||= Date - end - - def self.time - @time_class ||= Time - end - - def initialize(path, entry) - @path = path - @mode, _, @owner, @group, size, d1, d2, d3, @name = entry.split(' ') - @size = size.to_i - @time = determine_time(d1, d2, d3) - end - - def path - File.join(@path, @name) - end - - def directory? - @mode[0] == ?d - end - - def mode - parse_mode(@mode) - end - - def symlink? - @mode[0] == ?l - end - - private # -------------------------------------------------------- - - def parse_mode(m) - result = 0 - (1..9).each do |i| - result = 2 * result + ((m[i] == ?-) ? 0 : 1) - end - result - end - - def determine_time(d1, d2, d3) - now = self.class.time.now - if /:/ !~ d3 - result = Time.parse("#{d1} #{d2} #{d3}") - else - result = Time.parse("#{d1} #{d2} #{now.year} #{d3}") - result = Time.parse("#{d1} #{d2} #{now.year - 1} #{d3}") if - result > now - end - result - end - end - - ## - # Manage the uploading of files to an FTP account. - class FtpUploader # :nodoc: - - # Log uploads to standard output when true. - attr_accessor :verbose - - class << FtpUploader - # Create an uploader and pass it to the given block as +up+. - # When the block is complete, close the uploader. - def connect(path, host, account, password) - up = self.new(path, host, account, password) - begin - yield(up) - ensure - up.close - end - end - end - - # Create an FTP uploader targeting the directory +path+ on +host+ - # using the given account and password. +path+ will be the root - # path of the uploader. - def initialize(path, host, account, password) - @created = Hash.new - @path = path - @ftp = Net::FTP.new(host, account, password) - makedirs(@path) - @ftp.chdir(@path) - end - - # Create the directory +path+ in the uploader root path. - def makedirs(path) - route = [] - File.split(path).each do |dir| - route << dir - current_dir = File.join(route) - if @created[current_dir].nil? - @created[current_dir] = true - $stderr.puts "Creating Directory #{current_dir}" if @verbose - @ftp.mkdir(current_dir) rescue nil - end - end - end - - # Upload all files matching +wildcard+ to the uploader's root - # path. - def upload_files(wildcard) - FileList.glob(wildcard).each do |fn| - upload(fn) - end - end - - # Close the uploader. - def close - @ftp.close - end - - private # -------------------------------------------------------- - - # Upload a single file to the uploader's root path. - def upload(file) - $stderr.puts "Uploading #{file}" if @verbose - dir = File.dirname(file) - makedirs(dir) - @ftp.putbinaryfile(file, file) unless File.directory?(file) - end - end -end diff --git a/lib/rake/contrib/sshpublisher.rb b/lib/rake/contrib/sshpublisher.rb deleted file mode 100644 index b0048307c..000000000 --- a/lib/rake/contrib/sshpublisher.rb +++ /dev/null @@ -1,60 +0,0 @@ -require 'rake/dsl_definition' -require 'rake/contrib/compositepublisher' - -module Rake - # Publish an entire directory to an existing remote directory using - # SSH. - class SshDirPublisher - include Rake::DSL - - # Creates an SSH publisher which will scp all files in +local_dir+ to - # +remote_dir+ on +host+ - - def initialize(host, remote_dir, local_dir) - @host = host - @remote_dir = remote_dir - @local_dir = local_dir - end - - # Uploads the files - - def upload - sh "scp", "-rq", "#{@local_dir}/*", "#{@host}:#{@remote_dir}" - end - end - - # Publish an entire directory to a fresh remote directory using SSH. - class SshFreshDirPublisher < SshDirPublisher - - # Uploads the files after removing the existing remote directory. - - def upload - sh "ssh", @host, "rm", "-rf", @remote_dir rescue nil - sh "ssh", @host, "mkdir", @remote_dir - super - end - end - - # Publish a list of files to an existing remote directory. - class SshFilePublisher - include Rake::DSL - - # Creates an SSH publisher which will scp all +files+ in +local_dir+ to - # +remote_dir+ on +host+. - - def initialize(host, remote_dir, local_dir, *files) - @host = host - @remote_dir = remote_dir - @local_dir = local_dir - @files = files - end - - # Uploads the files - - def upload - @files.each do |fn| - sh "scp", "-q", "#{@local_dir}/#{fn}", "#{@host}:#{@remote_dir}" - end - end - end -end From 1b0bf7334c6d5161546c88b9072a55fcdc2d2133 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 29 Jul 2016 11:39:19 +0900 Subject: [PATCH 042/108] drop to support rbx --- .travis.yml | 2 -- test/helper.rb | 4 ---- test/test_private_reader.rb | 1 - 3 files changed, 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2f5898ae4..62088270f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,6 @@ rvm: - jruby-9.0.5.0 - jruby-9.1.0.0 - jruby-head - - rbx-2 - - rbx before_install: - gem install bundler --no-document before_script: diff --git a/test/helper.rb b/test/helper.rb index 7eb560eea..f8f1fe106 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -115,9 +115,5 @@ def jruby9? jruby? && (JRUBY_VERSION >= '9.0.0.0') end - def rbx? - RUBY_ENGINE == 'rbx' - end - include RakefileDefinitions end diff --git a/test/test_private_reader.rb b/test/test_private_reader.rb index 895c6a05d..f86d4249b 100644 --- a/test/test_private_reader.rb +++ b/test/test_private_reader.rb @@ -24,7 +24,6 @@ def setup end def test_private_reader_is_private - skip if rbx? assert_private do @sample.reader end assert_private do @sample.a end end From 64a56cccf6f451783854815b584cbd04b5c95315 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 30 Jul 2016 16:23:31 +0900 Subject: [PATCH 043/108] History --- History.rdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/History.rdoc b/History.rdoc index 6ff5088df..4e90252d0 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,9 @@ +=== 12.0.0(dev) + +Compatibility Changes: + +* Removed `rake/contrib` packages. These are extracted to `rake-contrib` gem. + === 11.2.2 / 2016-06-12 Bug fixes: From 55bfef22641a11a8447e8cda84aab2d7f96bdbf1 Mon Sep 17 00:00:00 2001 From: "Mark D. Blackwell" Date: Fri, 29 Jul 2016 17:03:46 -0400 Subject: [PATCH 044/108] Add test to prompt use of TESTOPTS --- test/support/rakefile_definitions.rb | 10 ++++++++++ test/test_rake_functional.rb | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/test/support/rakefile_definitions.rb b/test/support/rakefile_definitions.rb index d276b2fd5..b4eddb20b 100644 --- a/test/support/rakefile_definitions.rb +++ b/test/support/rakefile_definitions.rb @@ -49,6 +49,16 @@ def rakefile_test_task RAKEFILE end + def rakefile_test_task_verbose + rakefile <<-RAKEFILE + require "rake/testtask" + + Rake::TestTask.new(:unit) do |t| + t.verbose = true + end + RAKEFILE + end + def rakefile_chains rakefile <<-DEFAULT task :default => "play.app" diff --git a/test/test_rake_functional.rb b/test/test_rake_functional.rb index 9113d8616..0d3e1d0c0 100644 --- a/test/test_rake_functional.rb +++ b/test/test_rake_functional.rb @@ -384,6 +384,20 @@ def test_test_task_descriptions assert_match(/custom test task description/, @out) end + def test_test_task_when_verbose_unless_verbose_passed_not_prompt_testopts + rakefile_test_task_verbose + rake 'unit' + exp = /TESTOPTS="--verbose" to pass --verbose/ + refute_match exp, @out + end + + def test_test_task_when_verbose_passed_prompts_testopts + rakefile_test_task + rake '--verbose', 'unit' + exp = /TESTOPTS="--verbose" to pass --verbose/ + assert_match exp, @out + end + def test_comment_before_task_acts_like_desc rakefile_comments From 2a9a472a956aa952f75ef0027343aa71fbaf9fc2 Mon Sep 17 00:00:00 2001 From: "Mark D. Blackwell" Date: Fri, 29 Jul 2016 00:25:07 -0400 Subject: [PATCH 045/108] Prompt use of TESTOPTS --- lib/rake/testtask.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 4c6f71917..cf9855147 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -107,6 +107,8 @@ def define desc @description task @name => Array(deps) do FileUtilsExt.verbose(@verbose) do + puts "Use TESTOPTS=\"--verbose\" to pass --verbose" \ + ", etc. to runners." if ARGV.include? '--verbose' args = "#{ruby_opts_string} #{run_code} " + "#{file_list_string} #{option_list}" From feffec845c324a6621bf4e70560975c26096d102 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 2 Aug 2016 21:28:04 +0900 Subject: [PATCH 046/108] removed contrib description --- rake.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index 04bbd3327..1581d1a1e 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |s| s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze] s.summary = "Rake is a Make-like program implemented in Ruby".freeze - s.description = "Rake is a Make-like program implemented in Ruby. Tasks and dependencies are\nspecified in standard Ruby syntax.\n\nRake has the following features:\n\n* Rakefiles (rake's version of Makefiles) are completely defined in\n standard Ruby syntax. No XML files to edit. No quirky Makefile\n syntax to worry about (is that a tab or a space?)\n\n* Users can specify tasks with prerequisites.\n\n* Rake supports rule patterns to synthesize implicit tasks.\n\n* Flexible FileLists that act like arrays but know about manipulating\n file names and paths.\n\n* A library of prepackaged tasks to make building rakefiles easier. For example,\n tasks for building tarballs and publishing to FTP or SSH sites. (Formerly\n tasks for building RDoc and Gems were included in rake but they're now\n available in RDoc and RubyGems respectively.)\n\n* Supports parallel execution of tasks.".freeze + s.description = "Rake is a Make-like program implemented in Ruby. Tasks and dependencies are\nspecified in standard Ruby syntax.\n\nRake has the following features:\n\n* Rakefiles (rake's version of Makefiles) are completely defined in\n standard Ruby syntax. No XML files to edit. No quirky Makefile\n syntax to worry about (is that a tab or a space?)\n\n* Users can specify tasks with prerequisites.\n\n* Rake supports rule patterns to synthesize implicit tasks.\n\n* Flexible FileLists that act like arrays but know about manipulating\n file names and paths.\n\n* Supports parallel execution of tasks.".freeze s.homepage = "https://github.com/ruby/rake".freeze s.licenses = ["MIT".freeze] From 3673693d484f09b74d102efd862bad4465e5d419 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 2 Aug 2016 22:35:57 +0900 Subject: [PATCH 047/108] remove needless magic comment --- rake.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index 1581d1a1e..f5151fd1d 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -1,4 +1,3 @@ -# coding: utf-8 $LOAD_PATH.unshift File.expand_path('../lib', __FILE__) require 'rake/version' From 11bbb7c20bb9bae42310e0ab9294a76658fe158e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 2 Aug 2016 22:36:42 +0900 Subject: [PATCH 048/108] removed deprecated warnings --- lib/rake/task_manager.rb | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index e13482401..202a8a688 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -5,19 +5,6 @@ module TaskManager # Track the last comment made in the Rakefile. attr_accessor :last_description - # Remove Rake 12 - def last_comment # :nodoc: - warn "[DEPRECATION] `last_comment` is deprecated. Please use `last_description` instead." - @last_description - end - - # Remove Rake 12 - def last_comment=(comment) # :nodoc: - warn "[DEPRECATION] `last_comment=` is deprecated. Please use `last_description=` instead." - @last_description = comment - @last_description # ignore warning - end - def initialize # :nodoc: super @tasks = Hash.new From 4d73d48693d9987d308b60556d411c295e5ee091 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 2 Aug 2016 22:37:46 +0900 Subject: [PATCH 049/108] history --- History.rdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/History.rdoc b/History.rdoc index 4e90252d0..188b12f34 100644 --- a/History.rdoc +++ b/History.rdoc @@ -3,6 +3,7 @@ Compatibility Changes: * Removed `rake/contrib` packages. These are extracted to `rake-contrib` gem. +* Removed to deprecated warnings for `last\_comment`. === 11.2.2 / 2016-06-12 From 4780fbeb6090237adc1a3d73609a1ffa20c01e2c Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 12 Aug 2016 14:06:25 +0900 Subject: [PATCH 050/108] Added test for duplicated tasks --- test/support/rakefile_definitions.rb | 12 ++++++++++++ test/test_rake_functional.rb | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/test/support/rakefile_definitions.rb b/test/support/rakefile_definitions.rb index b4eddb20b..82eae11ec 100644 --- a/test/support/rakefile_definitions.rb +++ b/test/support/rakefile_definitions.rb @@ -100,6 +100,18 @@ def rakefile_comments COMMENTS end + def rakefile_override + rakefile <<-OVERRIDE + task :t1 do + puts :foo + end + + task :t1 do + puts :bar + end + OVERRIDE + end + def rakefile_default rakefile <<-DEFAULT if ENV['TESTTOPSCOPE'] diff --git a/test/test_rake_functional.rb b/test/test_rake_functional.rb index 0d3e1d0c0..703413383 100644 --- a/test/test_rake_functional.rb +++ b/test/test_rake_functional.rb @@ -49,6 +49,14 @@ def test_env_available_at_task_scope assert_match(/^TASKSCOPE$/, @out) end + def test_task_override + rakefile_override + + rake 't1' + + assert_match(/foo\nbar\n/, @out) + end + def test_multi_desc ENV['RAKE_COLUMNS'] = '80' rakefile_multidesc From 1aaa53d848ed0204db9d29eef44c774c351fe0fb Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 12 Aug 2016 14:11:31 +0900 Subject: [PATCH 051/108] remove needless brackets --- lib/rake/packagetask.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb index cdb4879f5..a93307849 100644 --- a/lib/rake/packagetask.rb +++ b/lib/rake/packagetask.rb @@ -126,7 +126,7 @@ def define [need_tar_gz, tar_gz_file, "z"], [need_tar_bz2, tar_bz2_file, "j"], [need_tar_xz, tar_xz_file, "J"] - ].each do |(need, file, flag)| + ].each do |need, file, flag| if need task :package => ["#{package_dir}/#{file}"] file "#{package_dir}/#{file}" => From ab83088453fca054f81bc2f0dfb8b3c440107725 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 12 Aug 2016 14:12:03 +0900 Subject: [PATCH 052/108] synvert -rruby/gsub_to_tr . --- lib/rake/application.rb | 2 +- lib/rake/backtrace.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index fc0a786d6..551980796 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -695,7 +695,7 @@ def raw_load_rakefile # :nodoc: end def glob(path, &block) # :nodoc: - FileList.glob(path.gsub("\\", '/')).each(&block) + FileList.glob(path.tr("\\", '/')).each(&block) end private :glob diff --git a/lib/rake/backtrace.rb b/lib/rake/backtrace.rb index dc1877343..9edf33ef1 100644 --- a/lib/rake/backtrace.rb +++ b/lib/rake/backtrace.rb @@ -5,7 +5,7 @@ module Backtrace # :nodoc: all [ File.join(File.dirname(__FILE__), "..") ] SUPPRESSED_PATHS = SYS_PATHS. - map { |s| s.gsub("\\", "/") }. + map { |s| s.tr("\\", "/") }. map { |f| File.expand_path(f) }. reject { |s| s.nil? || s =~ /^ *$/ } SUPPRESSED_PATHS_RE = SUPPRESSED_PATHS.map { |f| Regexp.quote(f) }.join("|") From ffd202288d8321611351cc854321d84e37f7362c Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 12 Aug 2016 14:16:20 +0900 Subject: [PATCH 053/108] use Proc for enumerable methods --- lib/rake/application.rb | 2 +- lib/rake/file_list.rb | 6 ++---- lib/rake/scope.rb | 2 +- lib/rake/task.rb | 6 +++--- test/test_rake_definitions.rb | 4 ++-- test/test_rake_file_list.rb | 4 ++-- test/test_rake_name_space.rb | 4 ++-- test/test_rake_task.rb | 4 ++-- test/test_rake_task_manager.rb | 4 ++-- test/test_rake_thread_pool.rb | 8 +++----- 10 files changed, 20 insertions(+), 24 deletions(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 551980796..23db9b890 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -375,7 +375,7 @@ def trace(*strings) # :nodoc: def sort_options(options) # :nodoc: options.sort_by { |opt| - opt.select { |o| o =~ /^-/ }.map { |o| o.downcase }.sort.reverse + opt.select { |o| o =~ /^-/ }.map(&:downcase).sort.reverse } end private :sort_options diff --git a/lib/rake/file_list.rb b/lib/rake/file_list.rb index a82c8d584..3b1239ad9 100644 --- a/lib/rake/file_list.rb +++ b/lib/rake/file_list.rb @@ -40,8 +40,7 @@ class FileList # List of array methods (that are not in +Object+) that need to be # delegated. - ARRAY_METHODS = (Array.instance_methods - Object.instance_methods). - map { |n| n.to_s } + ARRAY_METHODS = (Array.instance_methods - Object.instance_methods).map(&:to_s) # List of additional methods that must be delegated. MUST_DEFINE = %w[inspect <=>] @@ -58,8 +57,7 @@ class FileList + - & | ] - DELEGATING_METHODS = (ARRAY_METHODS + MUST_DEFINE - MUST_NOT_DEFINE). - map { |s| s.to_s }.sort.uniq + DELEGATING_METHODS = (ARRAY_METHODS + MUST_DEFINE - MUST_NOT_DEFINE).map(&:to_s).sort.uniq # Now do the delegation. DELEGATING_METHODS.each do |sym| diff --git a/lib/rake/scope.rb b/lib/rake/scope.rb index dbefcea46..b432f5f29 100644 --- a/lib/rake/scope.rb +++ b/lib/rake/scope.rb @@ -3,7 +3,7 @@ class Scope < LinkedList # :nodoc: all # Path for the scope. def path - map { |item| item.to_s }.reverse.join(":") + map(&:to_s).reverse.join(":") end # Path for the scope + the named path. diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 7a57a0f85..1f4f591d5 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -219,7 +219,7 @@ def invoke_prerequisites_concurrently(task_args, invocation_chain)# :nodoc: r.invoke_with_call_chain(prereq_args, invocation_chain) end end - futures.each { |f| f.value } + futures.each(&:value) end # Format the trace flags for display. @@ -314,7 +314,7 @@ def first_sentence(string) # Set the names of the arguments for this task. +args+ should be # an array of symbols, one for each argument name. def set_arg_names(args) - @arg_names = args.map { |a| a.to_sym } + @arg_names = args.map(&:to_sym) end # Return a string describing the internal state of a task. Useful for @@ -331,7 +331,7 @@ def investigation prereqs.each do |p| result << "--#{p.name} (#{p.timestamp})\n" end - latest_prereq = prerequisite_tasks.map { |pre| pre.timestamp }.max + latest_prereq = prerequisite_tasks.map(&:timestamp).max result << "latest-prerequisite time: #{latest_prereq}\n" result << "................................\n\n" return result diff --git a/test/test_rake_definitions.rb b/test/test_rake_definitions.rb index ee474cb7c..bc96ed266 100644 --- a/test/test_rake_definitions.rb +++ b/test/test_rake_definitions.rb @@ -34,12 +34,12 @@ def check_tasks(n1, n2, n3) t = Task[n1] assert Task === t, "Should be a Task" assert_equal n1.to_s, t.name - assert_equal [n2.to_s], t.prerequisites.map { |n| n.to_s } + assert_equal [n2.to_s], t.prerequisites.map(&:to_s) t.invoke t2 = Task[n2] assert_equal FileList[], t2.prerequisites t3 = Task[n3] - assert_equal [n1.to_s, n2.to_s], t3.prerequisites.map { |n| n.to_s } + assert_equal [n1.to_s, n2.to_s], t3.prerequisites.map(&:to_s) end def test_incremental_definitions diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index 521406b6d..845e9767f 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -548,11 +548,11 @@ def test_array_equality def test_enumeration_methods a = FileList['a', 'b'] - b = a.map { |it| it.upcase } + b = a.map(&:upcase) assert_equal ['A', 'B'], b assert_equal FileList, b.class - b = a.map { |it| it.upcase } + b = a.map(&:upcase) assert_equal ['A', 'B'], b assert_equal FileList, b.class diff --git a/test/test_rake_name_space.rb b/test/test_rake_name_space.rb index d35e70e17..ceb7b412f 100644 --- a/test/test_rake_name_space.rb +++ b/test/test_rake_name_space.rb @@ -37,8 +37,8 @@ def test_namespace_reports_tasks_it_owns end assert_equal ["n:nn:z", "n:x", "n:y"], - ns.tasks.map { |tsk| tsk.name } - assert_equal ["n:nn:z"], nns.tasks.map { |t| t.name } + ns.tasks.map(&:name) + assert_equal ["n:nn:z"], nns.tasks.map(&:name) end def test_scope diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index d9e13bd60..0d008819c 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -174,7 +174,7 @@ def test_multi_invocations def test_task_list task :t2 task :t1 => [:t2] - assert_equal ["t1", "t2"], Task.tasks.map { |t| t.name } + assert_equal ["t1", "t2"], Task.tasks.map(&:name) end def test_task_gives_name_on_to_s @@ -325,7 +325,7 @@ def test_always_multitask # task should always run in order assert_equal ['a', 'b', 'c'], result - [t_a, t_b, t_c].each { |t| t.reenable } + [t_a, t_b, t_c].each(&:reenable) result.clear Rake.application.options.always_multitask = true diff --git a/test/test_rake_task_manager.rb b/test/test_rake_task_manager.rb index 1bcb7a74c..2657ac53f 100644 --- a/test/test_rake_task_manager.rb +++ b/test/test_rake_task_manager.rb @@ -37,7 +37,7 @@ def test_namespace_task_create t = @tm.define_task(Rake::Task, :t) assert_equal "x:t", t.name end - assert_equal ["x:t"], @tm.tasks.map { |t| t.name } + assert_equal ["x:t"], @tm.tasks.map(&:name) end def test_define_namespaced_task @@ -72,7 +72,7 @@ def test_create_filetask_in_namespace assert_equal "fn", t.name end - assert_equal ["fn"], @tm.tasks.map { |t| t.name } + assert_equal ["fn"], @tm.tasks.map(&:name) end def test_namespace_yields_same_namespace_as_returned diff --git a/test/test_rake_thread_pool.rb b/test/test_rake_thread_pool.rb index 35a1fe9d1..62dc59d00 100644 --- a/test/test_rake_thread_pool.rb +++ b/test/test_rake_thread_pool.rb @@ -25,9 +25,7 @@ def test_pool_executes_in_two_other_threads_for_pool_of_size_two sleep 0.1 Thread.current } - }.each { |f| - f.value - } + }.each(&:value) refute_equal threads[0], threads[1] refute_equal Thread.current, threads[0] @@ -111,7 +109,7 @@ def test_pool_prevents_deadlock } } - common_dependency_b = pool.future { futures_a.each { |f| f.value } } + common_dependency_b = pool.future { futures_a.each(&:value) } futures_b = 10.times.map { pool.future { common_dependency_b.value @@ -119,7 +117,7 @@ def test_pool_prevents_deadlock } } - futures_b.each { |f| f.value } + futures_b.each(&:value) pool.join end From 9470ed126abf6eccd33266d558047fe3fc437df1 Mon Sep 17 00:00:00 2001 From: rudyyazdi Date: Sun, 14 Aug 2016 14:36:57 +1000 Subject: [PATCH 054/108] cleaned up the contib stuff --- README.rdoc | 6 ++-- test/test_rake_ftp_file.rb | 74 -------------------------------------- 2 files changed, 3 insertions(+), 77 deletions(-) delete mode 100644 test/test_rake_ftp_file.rb diff --git a/README.rdoc b/README.rdoc index 09ca18ca5..584542c07 100644 --- a/README.rdoc +++ b/README.rdoc @@ -24,9 +24,9 @@ Rake has the following features: file names and paths. * A library of prepackaged tasks to make building rakefiles easier. For example, - tasks for building tarballs and publishing to FTP or SSH sites. (Formerly - tasks for building RDoc and Gems were included in rake but they're now - available in RDoc and RubyGems respectively.) + tasks for building tarballs. (Formerly + tasks for building RDoc, Gems and publishing to FTP were included in rake but they're now + available in RDoc, RubyGems and respectively.) * Supports parallel execution of tasks. diff --git a/test/test_rake_ftp_file.rb b/test/test_rake_ftp_file.rb deleted file mode 100644 index 5749b8a5e..000000000 --- a/test/test_rake_ftp_file.rb +++ /dev/null @@ -1,74 +0,0 @@ -require File.expand_path('../helper', __FILE__) -require 'date' -require 'time' -require 'rake/contrib/ftptools' - -class FakeDate - def self.today - Date.new(2003, 10, 3) - end - - def self.now - Time.local(2003, 10, 3, 12, 00, 00) - end -end - -class TestRakeFtpFile < Rake::TestCase - - def setup - super - - Rake::FtpFile.class_eval { - @date_class = FakeDate - @time_class = FakeDate - } - end - - def test_general - file = Rake::FtpFile.new( - "here", - "-rw-r--r-- 1 a279376 develop 121770 Mar 6 14:50 wiki.pl") - assert_equal "wiki.pl", file.name - assert_equal "here/wiki.pl", file.path - assert_equal "a279376", file.owner - assert_equal "develop", file.group - assert_equal 0644, file.mode - assert_equal 121_770, file.size - assert_equal Time.mktime(2003, 3, 6, 14, 50, 0, 0), file.time - assert ! file.directory? - assert ! file.symlink? - end - - def test_far_date - file = Rake::FtpFile.new( - ".", - "drwxr-xr-x 3 a279376 develop 4096 Nov 26 2001 vss") - assert_equal Time.mktime(2001, 11, 26, 0, 0, 0, 0), file.time - end - - def test_close_date - file = Rake::FtpFile.new( - ".", - "drwxr-xr-x 3 a279376 develop 4096 Nov 26 15:35 vss") - assert_equal Time.mktime(2002, 11, 26, 15, 35, 0, 0), file.time - end - - def test_directory - file = Rake::FtpFile.new( - ".", - "drwxrwxr-x 9 a279376 develop 4096 Mar 13 14:32 working") - assert file.directory? - assert !file.symlink? - end - - def test_symlink - file = Rake::FtpFile.new( - ".", - "lrwxrwxrwx 1 a279376 develop 64 Mar 26 2002 " + - "xtrac -> /home/a279376/working/ics/development/java/" + - "com/fmr/fwp/ics/xtrac") - assert_equal 'xtrac', file.name - assert file.symlink? - assert !file.directory? - end -end From 60305d4e14dbf7ee9de9b412199eec325741ecab Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 17 Aug 2016 18:13:40 +0900 Subject: [PATCH 055/108] use new hash syntax --- lib/rake/clean.rb | 2 +- lib/rake/packagetask.rb | 8 +-- lib/rake/promise.rb | 20 +++--- lib/rake/thread_history_display.rb | 4 +- lib/rake/thread_pool.rb | 22 +++---- test/test_rake_clean.rb | 8 +-- test/test_rake_definitions.rb | 16 ++--- test/test_rake_file_list.rb | 6 +- test/test_rake_file_task.rb | 8 +-- test/test_rake_file_utils.rb | 12 ++-- test/test_rake_multi_task.rb | 8 +-- test/test_rake_rules.rb | 6 +- test/test_rake_task.rb | 64 +++++++++---------- test/test_rake_task_arguments.rb | 8 +-- test/test_rake_task_manager.rb | 2 +- ...t_rake_task_manager_argument_resolution.rb | 4 +- test/test_rake_task_with_arguments.rb | 10 +-- test/test_rake_test_task.rb | 10 +-- test/test_thread_history_display.rb | 28 ++++---- 19 files changed, 123 insertions(+), 123 deletions(-) diff --git a/lib/rake/clean.rb b/lib/rake/clean.rb index 514f9f9c7..a2375aa99 100644 --- a/lib/rake/clean.rb +++ b/lib/rake/clean.rb @@ -71,6 +71,6 @@ def cant_be_deleted?(path_name) CLOBBER = ::Rake::FileList.new desc "Remove any generated files." -task :clobber => [:clean] do +task clobber: [:clean] do Rake::Cleaner.cleanup_files(CLOBBER) end diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb index a93307849..ae7151949 100644 --- a/lib/rake/packagetask.rb +++ b/lib/rake/packagetask.rb @@ -112,14 +112,14 @@ def define task :package desc "Force a rebuild of the package files" - task :repackage => [:clobber_package, :package] + task repackage: [:clobber_package, :package] desc "Remove package products" task :clobber_package do rm_r package_dir rescue nil end - task :clobber => [:clobber_package] + task clobber: [:clobber_package] [ [need_tar, tgz_file, "z"], @@ -128,7 +128,7 @@ def define [need_tar_xz, tar_xz_file, "J"] ].each do |need, file, flag| if need - task :package => ["#{package_dir}/#{file}"] + task package: ["#{package_dir}/#{file}"] file "#{package_dir}/#{file}" => [package_dir_path] + package_files do chdir(package_dir) do @@ -139,7 +139,7 @@ def define end if need_zip - task :package => ["#{package_dir}/#{zip_file}"] + task package: ["#{package_dir}/#{zip_file}"] file "#{package_dir}/#{zip_file}" => [package_dir_path] + package_files do chdir(package_dir) do diff --git a/lib/rake/promise.rb b/lib/rake/promise.rb index 31c456347..37221e427 100644 --- a/lib/rake/promise.rb +++ b/lib/rake/promise.rb @@ -27,11 +27,11 @@ def initialize(args, &block) # synchronously. We will wait. def value unless complete? - stat :sleeping_on, :item_id => object_id + stat :sleeping_on, item_id: object_id @mutex.synchronize do - stat :has_lock_on, :item_id => object_id + stat :has_lock_on, item_id: object_id chore - stat :releasing_lock_on, :item_id => object_id + stat :releasing_lock_on, item_id: object_id end end error? ? raise(@error) : @result @@ -39,14 +39,14 @@ def value # If no one else is working this promise, go ahead and do the chore. def work - stat :attempting_lock_on, :item_id => object_id + stat :attempting_lock_on, item_id: object_id if @mutex.try_lock - stat :has_lock_on, :item_id => object_id + stat :has_lock_on, item_id: object_id chore - stat :releasing_lock_on, :item_id => object_id + stat :releasing_lock_on, item_id: object_id @mutex.unlock else - stat :bailed_on, :item_id => object_id + stat :bailed_on, item_id: object_id end end @@ -55,16 +55,16 @@ def work # Perform the chore promised def chore if complete? - stat :found_completed, :item_id => object_id + stat :found_completed, item_id: object_id return end - stat :will_execute, :item_id => object_id + stat :will_execute, item_id: object_id begin @result = @block.call(*@args) rescue Exception => e @error = e end - stat :did_execute, :item_id => object_id + stat :did_execute, item_id: object_id discard end diff --git a/lib/rake/thread_history_display.rb b/lib/rake/thread_history_display.rb index c2af9ecef..a8158caf6 100644 --- a/lib/rake/thread_history_display.rb +++ b/lib/rake/thread_history_display.rb @@ -9,8 +9,8 @@ class ThreadHistoryDisplay # :nodoc: all def initialize(stats) @stats = stats - @items = { :_seq_ => 1 } - @threads = { :_seq_ => "A" } + @items = { _seq_: 1 } + @threads = { _seq_: "A" } end def show diff --git a/lib/rake/thread_pool.rb b/lib/rake/thread_pool.rb index a11af0393..91628259b 100644 --- a/lib/rake/thread_pool.rb +++ b/lib/rake/thread_pool.rb @@ -34,7 +34,7 @@ def future(*args, &block) promise.recorder = lambda { |*stats| stat(*stats) } @queue.enq promise - stat :queued, :item_id => promise.object_id + stat :queued, item_id: promise.object_id start_thread promise end @@ -82,8 +82,8 @@ def history # :nodoc: # Return a hash of always collected statistics for the thread pool. def statistics # :nodoc: { - :total_threads_in_play => @total_threads_in_play, - :max_active_threads => @max_active_threads, + total_threads_in_play: @total_threads_in_play, + max_active_threads: @max_active_threads, } end @@ -99,7 +99,7 @@ def process_queue_item #:nodoc: # is now gone. For this reason we pass true to Queue#deq # because we will sleep indefinitely if it is empty. promise = @queue.deq(true) - stat :dequeued, :item_id => promise.object_id + stat :dequeued, item_id: promise.object_id promise.work return true @@ -125,7 +125,7 @@ def start_thread # :nodoc: ensure @threads_mon.synchronize do @threads.delete Thread.current - stat :ended, :thread_count => @threads.count + stat :ended, thread_count: @threads.count @join_cond.broadcast if @threads.empty? end end @@ -134,8 +134,8 @@ def start_thread # :nodoc: @threads << t stat( :spawned, - :new_thread => t.object_id, - :thread_count => @threads.count) + new_thread: t.object_id, + thread_count: @threads.count) @total_threads_in_play = @threads.count if @threads.count > @total_threads_in_play end @@ -144,10 +144,10 @@ def start_thread # :nodoc: def stat(event, data=nil) # :nodoc: return if @history_start_time.nil? info = { - :event => event, - :data => data, - :time => Time.now, - :thread => Thread.current.object_id, + event: event, + data: data, + time: Time.now, + thread: Thread.current.object_id, } @history_mon.synchronize { @history << info } end diff --git a/test/test_rake_clean.rb b/test/test_rake_clean.rb index 0bce7bc0b..f94d8c31c 100644 --- a/test/test_rake_clean.rb +++ b/test/test_rake_clean.rb @@ -15,7 +15,7 @@ def test_cleanup file_name = create_undeletable_file out, _ = capture_io do - Rake::Cleaner.cleanup(file_name, :verbose => false) + Rake::Cleaner.cleanup(file_name, verbose: false) end assert_match(/failed to remove/i, out) @@ -27,7 +27,7 @@ def test_cleanup_ignores_missing_files file_name = File.join(@tempdir, "missing_directory", "no_such_file") out, _ = capture_io do - Rake::Cleaner.cleanup(file_name, :verbose => false) + Rake::Cleaner.cleanup(file_name, verbose: false) end refute_match(/failed to remove/i, out) end @@ -55,7 +55,7 @@ def remove_undeletable_file file_name = File.join(dir_name, "deleteme") FileUtils.chmod(0777, dir_name) FileUtils.chmod(0777, file_name) - Rake::Cleaner.cleanup(file_name, :verbose => false) - Rake::Cleaner.cleanup(dir_name, :verbose => false) + Rake::Cleaner.cleanup(file_name, verbose: false) + Rake::Cleaner.cleanup(dir_name, verbose: false) end end diff --git a/test/test_rake_definitions.rb b/test/test_rake_definitions.rb index bc96ed266..a0314621d 100644 --- a/test/test_rake_definitions.rb +++ b/test/test_rake_definitions.rb @@ -14,9 +14,9 @@ def setup def test_task done = false - task :one => [:two] do done = true end + task one: [:two] do done = true end task :two - task :three => [:one, :two] + task three: [:one, :two] check_tasks(:one, :two, :three) assert done, "Should be done" end @@ -44,9 +44,9 @@ def check_tasks(n1, n2, n3) def test_incremental_definitions runs = [] - task :t1 => [:t2] do runs << "A"; 4321 end - task :t1 => [:t3] do runs << "B"; 1234 end - task :t1 => [:t3] + task t1: [:t2] do runs << "A"; 4321 end + task t1: [:t3] do runs << "B"; 1234 end + task t1: [:t3] task :t2 task :t3 Task[:t1].invoke @@ -55,19 +55,19 @@ def test_incremental_definitions end def test_missing_dependencies - task :x => ["missing"] + task x: ["missing"] assert_raises(RuntimeError) { Task[:x].invoke } end def test_falsey_dependencies - task :x => nil + task x: nil assert_equal [], Task[:x].prerequisites end def test_implicit_file_dependencies runs = [] create_existing_file - task :y => [EXISTINGFILE] do |t| runs << t.name end + task y: [EXISTINGFILE] do |t| runs << t.name end Task[:y].invoke assert_equal runs, ['y'] end diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index 845e9767f..ca881f34b 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -165,7 +165,7 @@ def test_reject def test_exclude fl = FileList['x.c', 'abc.c', 'xyz.c', 'existing'] - fl.each { |fn| touch fn, :verbose => false } + fl.each { |fn| touch fn, verbose: false } x = fl.exclude(%r{^x.+\.}) @@ -184,7 +184,7 @@ def test_exclude def test_exclude_pathname fl = FileList['x.c', 'abc.c', 'other'] - fl.each { |fn| touch fn, :verbose => false } + fl.each { |fn| touch fn, verbose: false } fl.exclude(Pathname.new('*.c')) @@ -677,7 +677,7 @@ def test_special_return_delegating_methods_object_type def test_file_utils_can_use_filelists cfiles = FileList['*.c'] - cp cfiles, @cdir, :verbose => false + cp cfiles, @cdir, verbose: false assert File.exist?(File.join(@cdir, 'abc.c')) assert File.exist?(File.join(@cdir, 'xyz.c')) diff --git a/test/test_rake_file_task.rb b/test/test_rake_file_task.rb index a24951144..6a4211559 100644 --- a/test/test_rake_file_task.rb +++ b/test/test_rake_file_task.rb @@ -76,7 +76,7 @@ def test_file_depends_on_task_depend_on_file create_timed_files(OLDFILE, NEWFILE) file NEWFILE => [:obj] do |t| @runs << t.name end - task :obj => [OLDFILE] do |t| @runs << t.name end + task obj: [OLDFILE] do |t| @runs << t.name end file OLDFILE do |t| @runs << t.name end Task[:obj].invoke @@ -150,12 +150,12 @@ def test_needed_eh_exists end def test_source_is_first_prerequisite - t = file :f => ["preqA", "preqB"] + t = file f: ["preqA", "preqB"] assert_equal "preqA", t.source end def test_sources_is_all_prerequisites - t = file :f => ["preqA", "preqB"] + t = file f: ["preqA", "preqB"] assert_equal ["preqA", "preqB"], t.sources end @@ -169,7 +169,7 @@ def test_task_can_be_pathname end def test_prerequisite_can_be_pathname - t = file :f => Pathname.new("preq") + t = file f: Pathname.new("preq") assert_equal "preq", t.source end diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index 1b43a49d1..4dec00968 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -41,7 +41,7 @@ def test_rm_filelist def test_ln open("a", "w") { |f| f.puts "TEST_LN" } - Rake::FileUtilsExt.safe_ln("a", "b", :verbose => false) + Rake::FileUtilsExt.safe_ln("a", "b", verbose: false) assert_equal "TEST_LN\n", File.read('b') end @@ -210,7 +210,7 @@ def test_sh_special_handling def test_sh_noop shellcommand - verbose(false) { sh %{shellcommand.rb 1}, :noop=>true } + verbose(false) { sh %{shellcommand.rb 1}, noop: true } assert true, "should not fail" end @@ -222,7 +222,7 @@ def test_sh_bad_option shellcommand ex = assert_raises(ArgumentError) { - verbose(false) { sh %{shellcommand.rb}, :bad_option=>true } + verbose(false) { sh %{shellcommand.rb}, bad_option: true } } assert_match(/bad_option/, ex.message) end @@ -232,7 +232,7 @@ def test_sh_verbose _, err = capture_io do verbose(true) { - sh %{shellcommand.rb}, :noop=>true + sh %{shellcommand.rb}, noop: true } end @@ -244,7 +244,7 @@ def test_sh_verbose_false _, err = capture_io do verbose(false) { - sh %{shellcommand.rb}, :noop=>true + sh %{shellcommand.rb}, noop: true } end @@ -257,7 +257,7 @@ def test_sh_verbose_flag_nil RakeFileUtils.verbose_flag = nil assert_silent do - sh %{shellcommand.rb}, :noop=>true + sh %{shellcommand.rb}, noop: true end end diff --git a/test/test_rake_multi_task.rb b/test/test_rake_multi_task.rb index f7a004164..b2c6495a6 100644 --- a/test/test_rake_multi_task.rb +++ b/test/test_rake_multi_task.rb @@ -28,7 +28,7 @@ def add_run(obj) def test_running_multitasks task :a do 3.times do |i| add_run("A#{i}"); sleep 0.01; end end task :b do 3.times do |i| add_run("B#{i}"); sleep 0.01; end end - multitask :both => [:a, :b] + multitask both: [:a, :b] Task[:both].invoke assert_equal 6, @runs.size assert @runs.index("A0") < @runs.index("A1") @@ -39,9 +39,9 @@ def test_running_multitasks def test_all_multitasks_wait_on_slow_prerequisites task :slow do 3.times do |i| add_run("S#{i}"); sleep 0.05 end end - task :a => [:slow] do 3.times do |i| add_run("A#{i}"); sleep 0.01 end end - task :b => [:slow] do 3.times do |i| add_run("B#{i}"); sleep 0.01 end end - multitask :both => [:a, :b] + task a: [:slow] do 3.times do |i| add_run("A#{i}"); sleep 0.01 end end + task b: [:slow] do 3.times do |i| add_run("B#{i}"); sleep 0.01 end end + multitask both: [:a, :b] Task[:both].invoke assert_equal 9, @runs.size assert @runs.index("S0") < @runs.index("S1") diff --git a/test/test_rake_rules.rb b/test/test_rake_rules.rb index ece75e5d9..ee18ed7ed 100644 --- a/test/test_rake_rules.rb +++ b/test/test_rake_rules.rb @@ -269,7 +269,7 @@ def test_rule_with_proc_dependent_will_trigger Task['classes/jw/X.class'].invoke assert_equal [:RULE], @runs ensure - rm_r("src", :verbose=>false) rescue nil + rm_r("src", verbose: false) rescue nil end def test_proc_returning_lists_are_flattened_into_prereqs @@ -278,7 +278,7 @@ def test_proc_returning_lists_are_flattened_into_prereqs create_file("flatten/a.txt") task 'flatten/b.data' do |t| ran = true - touch t.name, :verbose => false + touch t.name, verbose: false end rule '.html' => proc { |fn| @@ -291,7 +291,7 @@ def test_proc_returning_lists_are_flattened_into_prereqs Task['flatten/a.html'].invoke assert ran, "Should have triggered flattened dependency" ensure - rm_r("flatten", :verbose=>false) rescue nil + rm_r("flatten", verbose: false) rescue nil end def test_recursive_rules_will_work_as_long_as_they_terminate diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 0d008819c..9a4c3fc23 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -33,13 +33,13 @@ def test_create end def test_inspect - t = task(:foo => [:bar, :baz]) + t = task(foo: [:bar, :baz]) assert_equal " [bar, baz]>", t.inspect end def test_invoke runlist = [] - t1 = task(:t1 => [:t2, :t3]) { |t| runlist << t.name; 3321 } + t1 = task(t1: [:t2, :t3]) { |t| runlist << t.name; 3321 } task(:t2) { |t| runlist << t.name } task(:t3) { |t| runlist << t.name } assert_equal ["t2", "t3"], t1.prerequisites @@ -49,8 +49,8 @@ def test_invoke def test_invoke_with_circular_dependencies runlist = [] - t1 = task(:t1 => [:t2]) { |t| runlist << t.name; 3321 } - t2 = task(:t2 => [:t1]) { |t| runlist << t.name } + t1 = task(t1: [:t2]) { |t| runlist << t.name; 3321 } + t2 = task(t2: [:t1]) { |t| runlist << t.name } assert_equal ["t2"], t1.prerequisites assert_equal ["t1"], t2.prerequisites ex = assert_raises RuntimeError do @@ -87,8 +87,8 @@ def test_tasks_can_be_traced def test_no_double_invoke runlist = [] - t1 = task(:t1 => [:t2, :t3]) { |t| runlist << t.name; 3321 } - task(:t2 => [:t3]) { |t| runlist << t.name } + t1 = task(t1: [:t2, :t3]) { |t| runlist << t.name; 3321 } + task(t2: [:t3]) { |t| runlist << t.name } task(:t3) { |t| runlist << t.name } t1.invoke assert_equal ["t3", "t2", "t1"], runlist @@ -134,7 +134,7 @@ def test_clear_actions def test_clear_comments desc "the original foo" - task :foo => [:x] do + task foo: [:x] do # Dummy action end @@ -164,8 +164,8 @@ def test_defined def test_multi_invocations runs = [] p = proc do |t| runs << t.name end - task({ :t1 => [:t2, :t3] }, &p) - task({ :t2 => [:t3] }, &p) + task({ t1: [:t2, :t3] }, &p) + task({ t2: [:t3] }, &p) task(:t3, &p) Task[:t1].invoke assert_equal ["t1", "t2", "t3"], runs.sort @@ -173,7 +173,7 @@ def test_multi_invocations def test_task_list task :t2 - task :t1 => [:t2] + task t1: [:t2] assert_equal ["t1", "t2"], Task.tasks.map(&:name) end @@ -183,34 +183,34 @@ def test_task_gives_name_on_to_s end def test_symbols_can_be_prerequisites - task :a => :b + task a: :b assert_equal ["b"], Task[:a].prerequisites end def test_strings_can_be_prerequisites - task :a => "b" + task a: "b" assert_equal ["b"], Task[:a].prerequisites end def test_arrays_can_be_prerequisites - task :a => ["b", "c"] + task a: ["b", "c"] assert_equal ["b", "c"], Task[:a].prerequisites end def test_filelists_can_be_prerequisites - task :a => FileList.new.include("b", "c") + task a: FileList.new.include("b", "c") assert_equal ["b", "c"], Task[:a].prerequisites end def test_prerequisite_tasks_returns_tasks_not_strings - a = task :a => ["b", "c"] + a = task a: ["b", "c"] b = task :b c = task :c assert_equal [b, c], a.prerequisite_tasks end def test_prerequisite_tasks_fails_if_prerequisites_are_undefined - a = task :a => ["b", "c"] + a = task a: ["b", "c"] task :b assert_raises(RuntimeError) do a.prerequisite_tasks @@ -221,7 +221,7 @@ def test_prerequisite_tasks_honors_namespaces task :b a = b = nil namespace "X" do - a = task :a => ["b", "c"] + a = task a: ["b", "c"] b = task :b end c = task :c @@ -232,7 +232,7 @@ def test_prerequisite_tasks_honors_namespaces def test_prerequisite_tasks_finds_tasks_with_same_name_outside_namespace b1 = nil namespace "a" do - b1 = task :b => "b" + b1 = task b: "b" end b2 = task :b @@ -246,11 +246,11 @@ def test_prerequisite_tasks_in_nested_namespaces a_m = task :m namespace "b" do - a_b_m = task :m => "m" + a_b_m = task m: "m" end namespace "c" do - a_c_m = task :m => "a:m" + a_c_m = task m: "a:m" end end @@ -259,9 +259,9 @@ def test_prerequisite_tasks_in_nested_namespaces end def test_all_prerequisite_tasks_includes_all_prerequisites - a = task :a => "b" - b = task :b => ["c", "d"] - c = task :c => "e" + a = task a: "b" + b = task b: ["c", "d"] + c = task c: "e" d = task :d e = task :e @@ -269,22 +269,22 @@ def test_all_prerequisite_tasks_includes_all_prerequisites end def test_all_prerequisite_tasks_does_not_include_duplicates - a = task :a => ["b", "c"] - b = task :b => "c" + a = task a: ["b", "c"] + b = task b: "c" c = task :c assert_equal [b, c], a.all_prerequisite_tasks.sort_by { |t| t.name } end def test_all_prerequisite_tasks_includes_self_on_cyclic_dependencies - a = task :a => "b" - b = task :b => "a" + a = task a: "b" + b = task b: "a" assert_equal [a, b], a.all_prerequisite_tasks.sort_by { |t| t.name } end def test_timestamp_returns_now_if_all_prereqs_have_no_times - a = task :a => ["b", "c"] + a = task a: ["b", "c"] task :b task :c @@ -292,7 +292,7 @@ def test_timestamp_returns_now_if_all_prereqs_have_no_times end def test_timestamp_returns_latest_prereq_timestamp - a = task :a => ["b", "c"] + a = task a: ["b", "c"] b = task :b c = task :c @@ -316,7 +316,7 @@ def test_always_multitask mx.synchronize { result << t.name } end - t_c = task(:c => [:a, :b]) do |t| + t_c = task(c: [:a, :b]) do |t| mx.synchronize { result << t.name } end @@ -336,7 +336,7 @@ def test_always_multitask end def test_investigation_output - t1 = task(:t1 => [:t2, :t3]) { |t| runlist << t.name; 3321 } + t1 = task(t1: [:t2, :t3]) { |t| runlist << t.name; 3321 } task(:t2) task(:t3) out = t1.investigation @@ -436,7 +436,7 @@ def test_interspersed_duplicate_comments end def test_source_is_first_prerequisite - t = task :t => ["preqA", "preqB"] + t = task t: ["preqA", "preqB"] assert_equal "preqA", t.source end end diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index 554c13f57..bf2b4cd42 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -16,12 +16,12 @@ def test_empty_arg_list_is_empty def test_multiple_values_in_args ta = Rake::TaskArguments.new([:a, :b, :c], [:one, :two, :three]) - assert_equal({:a => :one, :b => :two, :c => :three}, ta.to_hash) + assert_equal({a: :one, b: :two, c: :three}, ta.to_hash) end def test_blank_values_in_args ta = Rake::TaskArguments.new([:a, :b, :c], ['', :two, '']) - assert_equal({:b => :two}, ta.to_hash) + assert_equal({b: :two}, ta.to_hash) end def test_has_key @@ -78,7 +78,7 @@ def test_args_do_not_reference_env_values def test_creating_new_argument_scopes parent = Rake::TaskArguments.new(['p'], [1]) child = parent.new_scope(['c', 'p']) - assert_equal({:p=>1}, child.to_hash) + assert_equal({p: 1}, child.to_hash) assert_equal 1, child.p assert_equal 1, child["p"] assert_equal 1, child[:p] @@ -93,7 +93,7 @@ def test_child_hides_parent_arg_names def test_default_arguments_values_can_be_merged ta = Rake::TaskArguments.new(["aa", "bb"], [nil, "original_val"]) - ta.with_defaults({ :aa => 'default_val' }) + ta.with_defaults({ aa: 'default_val' }) assert_equal 'default_val', ta[:aa] assert_equal 'original_val', ta[:bb] end diff --git a/test/test_rake_task_manager.rb b/test/test_rake_task_manager.rb index 2657ac53f..6f27a3d08 100644 --- a/test/test_rake_task_manager.rb +++ b/test/test_rake_task_manager.rb @@ -168,7 +168,7 @@ def test_correctly_scoped_prerequisites_are_invoked @tm.define_task(Rake::Task, :z) do values << "top z" end @tm.in_namespace("a") do @tm.define_task(Rake::Task, :z) do values << "next z" end - @tm.define_task(Rake::Task, :x => :z) + @tm.define_task(Rake::Task, x: :z) end @tm["a:x"].invoke diff --git a/test/test_rake_task_manager_argument_resolution.rb b/test/test_rake_task_manager_argument_resolution.rb index 43fa2ac44..2aa69aa19 100644 --- a/test/test_rake_task_manager_argument_resolution.rb +++ b/test/test_rake_task_manager_argument_resolution.rb @@ -4,8 +4,8 @@ class TestRakeTaskManagerArgumentResolution < Rake::TestCase def test_good_arg_patterns assert_equal [:t, [], []], task(:t) - assert_equal [:t, [], [:x]], task(:t => :x) - assert_equal [:t, [], [:x, :y]], task(:t => [:x, :y]) + assert_equal [:t, [], [:x]], task(t: :x) + assert_equal [:t, [], [:x, :y]], task(t: [:x, :y]) assert_equal [:t, [:a, :b], []], task(:t, [:a, :b]) assert_equal [:t, [:a, :b], [:x]], task(:t, [:a, :b] => :x) diff --git a/test/test_rake_task_with_arguments.rb b/test/test_rake_task_with_arguments.rb index 8646fc041..022854df6 100644 --- a/test/test_rake_task_with_arguments.rb +++ b/test/test_rake_task_with_arguments.rb @@ -28,7 +28,7 @@ def test_args_given end def test_name_and_needs - t = task(:t => [:pre]) + t = task(t: [:pre]) assert_equal "t", t.name assert_equal [], t.arg_names assert_equal ["pre"], t.prerequisites @@ -48,7 +48,7 @@ def test_arg_list_is_empty_if_no_args_given def test_tasks_can_access_arguments_as_hash t = task :t, :a, :b, :c do |tt, args| - assert_equal({:a => 1, :b => 2, :c => 3}, args.to_hash) + assert_equal({a: 1, b: 2, c: 3}, args.to_hash) assert_equal 1, args[:a] assert_equal 2, args[:b] assert_equal 3, args[:c] @@ -74,7 +74,7 @@ def test_actions_of_various_arity_are_ok_with_args t.enhance do |t2, args| notes << :d assert_equal t, t2 - assert_equal({:x => 1}, args.to_hash) + assert_equal({x: 1}, args.to_hash) end t.invoke(1) assert_equal [:a, :b, :c, :d], notes @@ -82,7 +82,7 @@ def test_actions_of_various_arity_are_ok_with_args def test_arguments_are_passed_to_block t = task(:t, :a, :b) { |tt, args| - assert_equal({ :a => 1, :b => 2 }, args.to_hash) + assert_equal({ a: 1, b: 2 }, args.to_hash) } t.invoke(1, 2) end @@ -155,7 +155,7 @@ def test_args_not_passed_if_no_arg_names task(:pre, :rev) { |t, args| assert_equal({}, args.to_hash) } - t = task(:t => [:pre]) + t = task(t: [:pre]) t.invoke("bill", "1.2") end diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 1b15f7a8d..caa4c3a3d 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -17,21 +17,21 @@ def test_initialize end def test_initialize_deps - tt = Rake::TestTask.new(:example => :bar) + tt = Rake::TestTask.new(example: :bar) refute_nil tt assert_equal :bar, tt.deps assert Task.task_defined?(:example) end def test_initialize_multi_deps - tt = Rake::TestTask.new(:example => [:foo, :bar]) + tt = Rake::TestTask.new(example: [:foo, :bar]) refute_nil tt assert_equal [:foo, :bar], tt.deps assert Task.task_defined?(:example) end def test_initialize_override - tt = Rake::TestTask.new(:example => :bar) do |t| + tt = Rake::TestTask.new(example: :bar) do |t| t.description = "Run example tests" t.libs = ['src', 'ext'] t.pattern = 'test/tc_*.rb' @@ -128,7 +128,7 @@ def test_test_files_equals def test_task_prerequisites Rake::TestTask.new :parent - Rake::TestTask.new :child => :parent + Rake::TestTask.new child: :parent task = Rake::Task[:child] assert_includes task.prerequisites, 'parent' @@ -137,7 +137,7 @@ def test_task_prerequisites def test_task_prerequisites_multi Rake::TestTask.new :parent Rake::TestTask.new :parent2 - Rake::TestTask.new :child => [:parent, :parent2] + Rake::TestTask.new child: [:parent, :parent2] task = Rake::Task[:child] assert_includes task.prerequisites, 'parent' diff --git a/test/test_thread_history_display.rb b/test/test_thread_history_display.rb index bb5879cff..6529302ce 100644 --- a/test/test_thread_history_display.rb +++ b/test/test_thread_history_display.rb @@ -18,7 +18,7 @@ def test_banner end def test_item_queued - @stats << event(:item_queued, :item_id => 123) + @stats << event(:item_queued, item_id: 123) out, _ = capture_io do @display.show end @@ -26,7 +26,7 @@ def test_item_queued end def test_item_dequeued - @stats << event(:item_dequeued, :item_id => 123) + @stats << event(:item_dequeued, item_id: 123) out, _ = capture_io do @display.show end @@ -34,8 +34,8 @@ def test_item_dequeued end def test_multiple_items - @stats << event(:item_queued, :item_id => 123) - @stats << event(:item_queued, :item_id => 124) + @stats << event(:item_queued, item_id: 123) + @stats << event(:item_queued, item_id: 124) out, _ = capture_io do @display.show end @@ -44,7 +44,7 @@ def test_multiple_items end def test_waiting - @stats << event(:waiting, :item_id => 123) + @stats << event(:waiting, item_id: 123) out, _ = capture_io do @display.show end @@ -52,7 +52,7 @@ def test_waiting end def test_continue - @stats << event(:continue, :item_id => 123) + @stats << event(:continue, item_id: 123) out, _ = capture_io do @display.show end @@ -62,8 +62,8 @@ def test_continue def test_thread_deleted @stats << event( :thread_deleted, - :deleted_thread => 123_456, - :thread_count => 12) + deleted_thread: 123_456, + thread_count: 12) out, _ = capture_io do @display.show end @@ -75,8 +75,8 @@ def test_thread_deleted def test_thread_created @stats << event( :thread_created, - :new_thread => 123_456, - :thread_count => 13) + new_thread: 123_456, + thread_count: 13) out, _ = capture_io do @display.show end @@ -89,10 +89,10 @@ def test_thread_created def event(type, data = {}) result = { - :event => type, - :time => @time / 1_000_000.0, - :data => data, - :thread => Thread.current.object_id + event: type, + time: @time / 1_000_000.0, + data: data, + thread: Thread.current.object_id } @time += 1 result From b1ae033a139cc7bcc029faeeb37b2ca4c60dd935 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 18 Aug 2016 15:09:01 +0900 Subject: [PATCH 056/108] use github pages for rdoc --- README.rdoc | 2 +- doc/rake.1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rdoc b/README.rdoc index 584542c07..690c11d66 100644 --- a/README.rdoc +++ b/README.rdoc @@ -2,7 +2,7 @@ home :: https://github.com/ruby/rake bugs :: https://github.com/ruby/rake/issues -docs :: http://docs.seattlerb.org/rake +docs :: https://ruby.github.io/rake build status :: {travis-ci}[https://travis-ci.org/ruby/rake] {appveyor}[https://ci.appveyor.com/project/ruby/rake] == Description diff --git a/doc/rake.1 b/doc/rake.1 index 2e830176a..c6bfa25c0 100644 --- a/doc/rake.1 +++ b/doc/rake.1 @@ -141,7 +141,7 @@ The complete documentation for has been installed at .Pa /usr/share/doc/rake-doc/html/index.html . It is also available online at -.Lk http://docs.seattlerb.org/rake . +.Lk https://ruby.github.io/rake . .Sh AUTHORS .An -nosplit .Nm From 6ca29f04425a96f7d539e061ce3da543f433fb3e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 18 Aug 2016 21:27:49 +0900 Subject: [PATCH 057/108] removed duplicated release_notes --- doc/release_notes/README.md | 4 - doc/release_notes/rake-0.4.14.rdoc | 23 ---- doc/release_notes/rake-0.4.15.rdoc | 35 ----- doc/release_notes/rake-0.5.0.rdoc | 53 -------- doc/release_notes/rake-0.5.3.rdoc | 78 ------------ doc/release_notes/rake-0.5.4.rdoc | 46 ------- doc/release_notes/rake-0.6.0.rdoc | 141 -------------------- doc/release_notes/rake-0.7.0.rdoc | 119 ----------------- doc/release_notes/rake-0.7.1.rdoc | 59 --------- doc/release_notes/rake-0.7.2.rdoc | 121 ------------------ doc/release_notes/rake-0.7.3.rdoc | 47 ------- doc/release_notes/rake-0.8.0.rdoc | 114 ----------------- doc/release_notes/rake-0.8.2.rdoc | 165 ------------------------ doc/release_notes/rake-0.8.3.rdoc | 112 ---------------- doc/release_notes/rake-0.8.4.rdoc | 147 --------------------- doc/release_notes/rake-0.8.5.rdoc | 53 -------- doc/release_notes/rake-0.8.6.rdoc | 37 ------ doc/release_notes/rake-0.8.7.rdoc | 55 -------- doc/release_notes/rake-0.9.0.rdoc | 112 ---------------- doc/release_notes/rake-0.9.1.rdoc | 52 -------- doc/release_notes/rake-0.9.2.2.rdoc | 55 -------- doc/release_notes/rake-0.9.2.rdoc | 49 ------- doc/release_notes/rake-0.9.3.rdoc | 102 --------------- doc/release_notes/rake-0.9.4.rdoc | 60 --------- doc/release_notes/rake-0.9.5.rdoc | 55 -------- doc/release_notes/rake-0.9.6.rdoc | 64 ---------- doc/release_notes/rake-10.0.0.rdoc | 178 -------------------------- doc/release_notes/rake-10.0.1.rdoc | 58 --------- doc/release_notes/rake-10.0.2.rdoc | 53 -------- doc/release_notes/rake-10.0.3.rdoc | 191 ---------------------------- doc/release_notes/rake-10.1.0.rdoc | 61 --------- 31 files changed, 2499 deletions(-) delete mode 100644 doc/release_notes/README.md delete mode 100644 doc/release_notes/rake-0.4.14.rdoc delete mode 100644 doc/release_notes/rake-0.4.15.rdoc delete mode 100644 doc/release_notes/rake-0.5.0.rdoc delete mode 100644 doc/release_notes/rake-0.5.3.rdoc delete mode 100644 doc/release_notes/rake-0.5.4.rdoc delete mode 100644 doc/release_notes/rake-0.6.0.rdoc delete mode 100644 doc/release_notes/rake-0.7.0.rdoc delete mode 100644 doc/release_notes/rake-0.7.1.rdoc delete mode 100644 doc/release_notes/rake-0.7.2.rdoc delete mode 100644 doc/release_notes/rake-0.7.3.rdoc delete mode 100644 doc/release_notes/rake-0.8.0.rdoc delete mode 100644 doc/release_notes/rake-0.8.2.rdoc delete mode 100644 doc/release_notes/rake-0.8.3.rdoc delete mode 100644 doc/release_notes/rake-0.8.4.rdoc delete mode 100644 doc/release_notes/rake-0.8.5.rdoc delete mode 100644 doc/release_notes/rake-0.8.6.rdoc delete mode 100644 doc/release_notes/rake-0.8.7.rdoc delete mode 100644 doc/release_notes/rake-0.9.0.rdoc delete mode 100644 doc/release_notes/rake-0.9.1.rdoc delete mode 100644 doc/release_notes/rake-0.9.2.2.rdoc delete mode 100644 doc/release_notes/rake-0.9.2.rdoc delete mode 100644 doc/release_notes/rake-0.9.3.rdoc delete mode 100644 doc/release_notes/rake-0.9.4.rdoc delete mode 100644 doc/release_notes/rake-0.9.5.rdoc delete mode 100644 doc/release_notes/rake-0.9.6.rdoc delete mode 100644 doc/release_notes/rake-10.0.0.rdoc delete mode 100644 doc/release_notes/rake-10.0.1.rdoc delete mode 100644 doc/release_notes/rake-10.0.2.rdoc delete mode 100644 doc/release_notes/rake-10.0.3.rdoc delete mode 100644 doc/release_notes/rake-10.1.0.rdoc diff --git a/doc/release_notes/README.md b/doc/release_notes/README.md deleted file mode 100644 index d7079ad81..000000000 --- a/doc/release_notes/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Note: this release notes will never been updated - -The maintenance policy for release notes has been changed. -Please see [History.rdoc](https://github.com/ruby/rake/blob/master/History.rdoc). diff --git a/doc/release_notes/rake-0.4.14.rdoc b/doc/release_notes/rake-0.4.14.rdoc deleted file mode 100644 index b2f1f84f3..000000000 --- a/doc/release_notes/rake-0.4.14.rdoc +++ /dev/null @@ -1,23 +0,0 @@ -= Rake 0.4.14 Released - -== Changes - -Version 0.4.14 is a compatibility fix to allow Rake's test task to -work under Ruby 1.8.2. A change in the Test::Unit autorun feature -prevented Rake from running any tests. This release fixes the -problem. - -Rake 0.4.14 is the recommended release for anyone using Ruby 1.8.2. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - diff --git a/doc/release_notes/rake-0.4.15.rdoc b/doc/release_notes/rake-0.4.15.rdoc deleted file mode 100644 index 975708863..000000000 --- a/doc/release_notes/rake-0.4.15.rdoc +++ /dev/null @@ -1,35 +0,0 @@ -= Rake 0.4.15 Released - -== Changes - -Version 0.4.15 is a bug fix update for the Ruby 1.8.2 compatibility -changes. This release includes: - -* Fixed a bug that prevented the TESTOPTS flag from working with the - revised for 1.8.2 test task. - -* Updated the docs on --trace to indicate that it also enables a full - backtrace on errors. - -* Several fixes for new warnings generated. - -== Mini-Roadmap - -I will continue to issue Rake updates in the 0.4.xx series as new -Ruby-1.8.2 issues become manifest. Once the codebase stabilizes, I -will release a 0.5.0 version incorporating all the changes. If you -are not using Ruby-1.8.2 and wish to avoid version churn, I recommend -staying with a release prior to Rake-0.4.14. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - diff --git a/doc/release_notes/rake-0.5.0.rdoc b/doc/release_notes/rake-0.5.0.rdoc deleted file mode 100644 index f5cb9f307..000000000 --- a/doc/release_notes/rake-0.5.0.rdoc +++ /dev/null @@ -1,53 +0,0 @@ -= Rake 0.5.0 Released - -It has been a long time in coming, but we finally have a new version -of Rake available. - -== Changes - -* Fixed bug where missing intermediate file dependencies could cause - an abort with --trace or --dry-run. (Brian Candler) - -* Recursive rules are now supported (Tilman Sauerbeck). - -* Added tar.gz and tar.bz2 support to package task (Tilman Sauerbeck). - -* Added warning option for the Test Task (requested by Eric Hodel). - -* The jamis rdoc template is only used if it exists. - -* Added fix for Ruby 1.8.2 test/unit and rails problem. - -* Added contributed rake man file. (Jani Monoses) - -* Fixed documentation that was lacking the Rake module name (Tilman - Sauerbeck). - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - -== Thanks - -Lots of people provided input to this release. Thanks to Tilman -Sauerbeck for numerous patches, documentation fixes and suggestions. -And for also pushing me to get this release out. Also, thanks to -Brian Candler for the finding and fixing --trace/dry-run fix. That -was an obscure bug. Also to Eric Hodel for some good suggestions. - --- Jim Weirich - diff --git a/doc/release_notes/rake-0.5.3.rdoc b/doc/release_notes/rake-0.5.3.rdoc deleted file mode 100644 index 451da4a0a..000000000 --- a/doc/release_notes/rake-0.5.3.rdoc +++ /dev/null @@ -1,78 +0,0 @@ -= Rake 0.5.3 Released - -Although it has only been two weeks since the last release, we have -enough updates to the Rake program to make it time for another -release. - -== Changes - -Here are the changes for version 0.5.3 ... - -* FileLists have been extensively changed so that they mimic the - behavior of real arrays even more closely. In particular, - operations on FileLists that return a new collection (e.g. collect, - reject) will now return a FileList rather than an array. In - addition, several places where FileLists were not properly expanded - before use have been fixed. - -* A method (+ext+) to simplify the handling of file extensions was - added to String and to Array. - -* The 'testrb' script in test/unit tends to silently swallow syntax - errors in test suites. Because of that, the default test loader is - now a rake-provided script. You can still use 'testrb' by setting - the loader flag in the test task to :testrb. (See the API documents - for TestTask for all the loader flag values). - -* FileUtil methods (e.g. cp, mv, install) are now declared to be - private. This will cut down on the interference with user defined - methods of the same name. - -* Fixed the verbose flag in the TestTask so that the test code is - controlled by the flag. Also shortened up some failure messages. - (Thanks to Tobias Luetke for the suggestion). - -* Rules will now properly detect a task that can generate a source - file. Previously rules would only consider source files that were - already present. - -* Added an +import+ command that allows Rake to dynamically import - dependendencies into a running Rake session. The +import+ command - can run tasks to update the dependency file before loading them. - Dependency files can be in rake or make format, allowing rake to - work with tools designed to generate dependencies for make. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - -== Thanks - -As usual, it was input from users that drove a alot of these changes. -Thanks to ... - -* Brian Gernhardt for the rules fix (especially for the patience to - explain the problem to me until I got what he was talking about). -* Stefan Lang for pointing out problems in the dark corners of the - FileList implementation. -* Alexey Verkhovsky pointing out the silently swallows syntax errors - in tests. -* Tobias Luetke for beautifying the test task output. -* Sam Roberts for some of the ideas behind dependency loading. - --- Jim Weirich - diff --git a/doc/release_notes/rake-0.5.4.rdoc b/doc/release_notes/rake-0.5.4.rdoc deleted file mode 100644 index 112587fb9..000000000 --- a/doc/release_notes/rake-0.5.4.rdoc +++ /dev/null @@ -1,46 +0,0 @@ -= Rake 0.5.4 Released - -Time for some minor bug fixes and small enhancements - -== Changes - -Here are the changes for version 0.5.4 ... - -* Added double quotes to the test runner. This allows the location of - the tests (and runner) to be in a directory path that contains - spaces (e.g. "C:/Program Files/ruby/bin"). - -* Added .svn to default ignore list. Now subversion project metadata - is automatically ignored by Rake's FileList. - -* Updated FileList#include to support nested arrays and filelists. - FileLists are flat lists of file names. Using a FileList in an - include will flatten out the nested file names. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - -== Thanks - -As usual, it was input from users that drove a alot of these changes. -Thanks to ... - -* Tilman Sauerbeck for the nested FileList suggestion. -* Josh Knowles for pointing out the spaces in directory name problem. - --- Jim Weirich diff --git a/doc/release_notes/rake-0.6.0.rdoc b/doc/release_notes/rake-0.6.0.rdoc deleted file mode 100644 index 340c07bf7..000000000 --- a/doc/release_notes/rake-0.6.0.rdoc +++ /dev/null @@ -1,141 +0,0 @@ -= Rake 0.6.0 Released - -Its time for some long requested enhancements and lots of bug fixes -... And a whole new web page. - -== New Web Page - -The primary documentation for rake has moved from the RubyForge based -wiki to its own Hieraki based web site. Constant spam on the wiki -made it a difficult to keep clean. The new site will be easier to -update and organize. - -Check out the new documentation at: http://docs.rubyrake.org - -We will be adding new documentation to the site as time goes on. - -In addition to the new docs page, make sure you check out Martin -Fowlers article on rake at http://martinfowler.com/articles/rake.html - -== Changes - -=== New Features - -* Multiple prerequisites on Rake rules now allowed. However, keep the - following in mind: - - 1. All the prerequisites of a rule must be available before a rule - is triggered, where "enabled" means (a) an existing file, (b) a - defined rule, or (c) another rule which also must be - trigger-able. - 2. Rules are checked in order of definition, so it is important to - order your rules properly. If a file can be created by two - different rules, put the more specific rule first (otherwise the - more general rule will trigger first and the specific one will - never be triggered). - 3. The source method now returns the name of the first - prerequisite listed in the rule. sources returns the - names of all the rule prerequisites, ordered as they are defined - in the rule. If the task has other prerequisites not defined in - the rule (but defined in an explicit task definition), then they - will _not_ be included in the sources list. - -* FileLists may now use the egrep command. This popular enhancement - is now a core part of the FileList object. If you want to get a - list of all your to-dos, fixmes and TBD comments, add the following - to your Rakefile. - - desc "Look for TODO and FIXME tags in the code" - task :todo do - FileList['**/*.rb'].egrep /#.*(FIXME|TODO|TBD)/ - end - -* The investigation method was added to task object to dump - out some important values. This makes it a bit easier to debug Rake - tasks. - - For example, if you are having problems with a particular task, just - print it out: - - task :huh do - puts Rake::Task['huh'].investigation - end - -* The Rake::TestTask class now supports a "ruby_opts" option to pass - arbitrary ruby options to a test subprocess. - -=== Some Incompatibilities - -* When using the ruby command to start a Ruby subprocess, the - Ruby interpreter that is currently running rake is used by default. - This makes it easier to use rake in an environment with multiple - ruby installation. (Previously, the first ruby command found in the - PATH was used). - - If you wish to chose a different Ruby interpreter, you can - explicitly choose the interpreter via the sh command. - -* The major rake classes (Task, FileTask, FileCreationTask, RakeApp) - have been moved out of the toplevel scope and are now accessible as - Rake::Task, Rake::FileTask, Rake::FileCreationTask and - Rake::Application. If your Rakefile - directly references any one of these tasks, you may: - - 1. Update your Rakefile to use the new classnames - 2. Use the --classic-namespace option on the rake command to get the - old behavior, - 3. Add require 'rake/classic_namespace' to the - Rakefile to get the old behavior. - - rake will print a rather annoying warning whenever a - deprecated class name is referenced without enabling classic - namespace. - -=== Bug Fixes - -* Several unit tests and functional tests were fixed to run better - under windows. - -* Directory tasks are now a specialized version of a File task. A - directory task will only be triggered if it doesn't exist. It will - not be triggered if it is out of date w.r.t. any of its - prerequisites. - -* Fixed a bug in the Rake::GemPackageTask class so that the gem now - properly contains the platform name. - -* Fixed a bug where a prerequisite on a file task would cause - an exception if the prerequisite did not exist. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - -== Thanks - -As usual, it was input from users that drove a alot of these changes. -The following people either contributed patches, made suggestions or -made otherwise helpful comments. Thanks to ... - -* Greg Fast (better ruby_opt test options) -* Kelly Felkins (requested by better namespace support) -* Martin Fowler (suggested Task.investigation) -* Stuart Jansen (send initial patch for multiple prerequisites). -* Masao Mutch (better support for non-ruby Gem platforms) -* Philipp Neubeck (patch for file task exception fix) - --- Jim Weirich diff --git a/doc/release_notes/rake-0.7.0.rdoc b/doc/release_notes/rake-0.7.0.rdoc deleted file mode 100644 index b8bf56ebb..000000000 --- a/doc/release_notes/rake-0.7.0.rdoc +++ /dev/null @@ -1,119 +0,0 @@ -= Rake 0.7.0 Released - -These changes for Rake have been brewing for a long time. Here they -are, I hope you enjoy them. - -== Changes - -=== New Features - -* Name space support for task names (see below). - -* Prerequisites can be executed in parallel (see below). - -* Added safe_ln support for openAFS (via Ludvig Omholt). - -* RDoc defaults to internal (in-process) invocation. The old behavior - is still available by setting the +external+ flag to true. - -* Rakefiles are now loaded with the expanded path to prevent - accidental polution from the Ruby load path. - -* Task objects my now be used in prerequisite lists directly. - -* Task objects (in addition to task names) may now be included in the - prerequisite list of a task. - -* Internals cleanup and refactoring. - -=== Bug Fixes - -* Compatibility fixes for Ruby 1.8.4 FileUtils changes. - -=== Namespaces - -Tasks can now be nested inside their own namespaces. Tasks within one -namespace will not accidently interfer with tasks named in a different -namespace. - -For example: - - namespace "main" do - task :build do - # Build the main program - end - end - - namespace "samples" do - task :build do - # Build the sample programs - end - end - - task :build_all => ["main:build", "samples:build"] - -Even though both tasks are named :build, they are separate tasks in -their own namespaces. The :build_all task (defined in the toplevel -namespace) references both build tasks in its prerequisites. - -You may invoke each of the individual build tasks with the following -commands: - - rake main:build - rake samples:build - -Or invoke both via the :build_all command: - - rake build_all - -Namespaces may be nested arbitrarily. Since the name of file tasks -correspond to the name of a file in the external file system, -FileTasks are not affected by the namespaces. - -See the Rakefile format documentation (in the Rake API documents) for -more information. - -=== Parallel Tasks - -Sometimes you have several tasks that can be executed in parallel. By -specifying these tasks as prerequisites to a +multitask+ task. - -In the following example the tasks copy_src, copy_doc and copy_bin -will all execute in parallel in their own thread. - - multitask :copy_files => [:copy_src, :copy_doc, :copy_bin] do - puts "All Copies Complete" - end - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - -== Thanks - -As usual, it was input from users that drove a alot of these changes. -The following people either contributed patches, made suggestions or -made otherwise helpful comments. Thanks to ... - -* Doug Young (inspriation for the parallel task) - -* David Heinemeier Hansson (for --trace message enhancement and for - pushing for namespace support). - -* Ludvig Omholt (for the openAFS fix) - --- Jim Weirich diff --git a/doc/release_notes/rake-0.7.1.rdoc b/doc/release_notes/rake-0.7.1.rdoc deleted file mode 100644 index c17088ee9..000000000 --- a/doc/release_notes/rake-0.7.1.rdoc +++ /dev/null @@ -1,59 +0,0 @@ -= Rake 0.7.1 Released - -Version 0.7.1 supplies a bug fix and a few minor enhancements. - -== Changes - -=== Bug Fixes in 0.7.1 - -* Changes in the exception reported for the FileUtils.ln caused - safe_ln to fail with a NotImplementedError. Rake 0.7.1 will now - catch that error or any StandardError and properly fall back to - using +cp+. - -=== New Features in 0.7.1 - -* You can filter the results of the --task option by supplying an - optional regular expression. This allows the user to easily find a - particular task name in a long list of possible names. - -* Transforming procs in a rule may now return a list of prerequisites. - This allows more flexible rule formation. - -* FileList and String now support a +pathmap+ melthod that makes the - transforming paths a bit easier. See the API docs for +pathmap+ for - details. - -* The -f option without a value will disable the search for a - Rakefile. This allows the Rakefile to be defined entirely in a - library (and loaded with the -r option). The current working - directory is not changed when this is done. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - -== Thanks - -As usual, it was input from users that drove a alot of these changes. -The following people either contributed patches, made suggestions or -made otherwise helpful comments. Thanks to ... - -* James Britt and Assaph Mehr for reporting and helping to debug the - safe_ln issue. - --- Jim Weirich diff --git a/doc/release_notes/rake-0.7.2.rdoc b/doc/release_notes/rake-0.7.2.rdoc deleted file mode 100644 index ec99ee0c0..000000000 --- a/doc/release_notes/rake-0.7.2.rdoc +++ /dev/null @@ -1,121 +0,0 @@ -= Rake 0.7.2 Released - -Version 0.7.2 supplies a bug fix and a few minor enhancements. In -particular, the new version fixes an incompatibility with the soon to -be released Ruby 1.8.6. We strongly recommend upgrading to Rake 0.7.2 -in order to be compatible with the new version of Ruby. - -== Changes - -=== Bug Fixes in 0.7.2 - -There are quite a number of bug fixes in the new 0.7.2 version of -Rake: - -* Removed dependency on internal fu_xxx functions from FileUtils. - -* Error messages are now send to stderr rather than stdout (from - Payton Quackenbush). - -* Better error handling on invalid command line arguments (from Payton - Quackenbush). - -* Fixed some bugs where the application object was going to the global - appliation instead of using its own data. - -* Fixed the method name leak from FileUtils (bug found by Glenn - Vanderburg). - -* Added test for noop, bad_option and verbose flags to sh command. - -* Added a description to the gem task in GemPackageTask. - -* Fixed a bug when rules have multiple prerequisites (patch by Joel - VanderWerf) - -* Added the handful of RakeFileUtils to the private method as well. - -=== New Features in 0.7.2 - -The following new features are available in Rake version 0.7.2: - -* Added square and curly bracket patterns to FileList#include (Tilman - Sauerbeck). - -* FileLists can now pass a block to FileList#exclude to exclude files - based on calculated values. - -* Added plain filename support to rule dependents (suggested by Nobu - Nakada). - -* Added pathmap support to rule dependents. In other words, if a - pathmap format (beginning with a '%') is given as a Rake rule - dependent, then the name of the depend will be the name of the - target with the pathmap format applied. - -* Added a 'tasks' method to a namespace to get a list of tasks - associated with the namespace. - -* Added tar_command and zip_command options to the Package task. - -* The clean task will no longer delete 'core' if it is a directory. - -=== Internal Rake Improvements - -The following changes will are mainly internal improvements and -refactorings and have little effect on the end user. But they may be -of interest to the general public. - -* Added rcov task and updated unit testing for better code coverage. - -* Added a 'shame' task to the Rakefile. - -* Added rake_extension to handle detection of extension collisions. - -* Added a protected 'require "rubygems"' to test/test_application to - unbreak cruisecontrol.rb. - -* Removed rake_dup. Now we just simply rescue a bad dup. - -* Refactored the FileList reject logic to remove duplication. - -* Removed if __FILE__ at the end of the rake.rb file. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - -== Thanks - -As usual, it was input from users that drove a alot of these changes. -The following people either contributed patches, made suggestions or -made otherwise helpful comments. Thanks to ... - -* Payton Quackenbush -- For several error handling improvements. - -* Glenn Vanderburg -- For finding and fixing the method name leak from - FileUtils. - -* Joel VanderWerf -- for finding and fixing a bug in the handling of - multiple prerequisites. - -* Tilman Sauerbeck -- For some enhancing FileList to support more - advanced file globbing. - -* Nobu Nakada -- For suggesting plain file name support to rule dependents. - --- Jim Weirich diff --git a/doc/release_notes/rake-0.7.3.rdoc b/doc/release_notes/rake-0.7.3.rdoc deleted file mode 100644 index 7e9f92198..000000000 --- a/doc/release_notes/rake-0.7.3.rdoc +++ /dev/null @@ -1,47 +0,0 @@ -= Rake 0.7.3 Released - -Rake version 0.7.3 is a minor release that includes some refactoring to better -support custom Rake applications. - -== Changes - -=== New Features in Version 0.7.3 - -* Added the +init+ and +top_level+ methods to make the creation of custom Rake applications a bit easier. E.g. - - gem 'rake', ">= 0.7.3" - require 'rake' - - Rake.application.init('myrake') - - task :default do - something_interesting - end - - Rake.application.top_level - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But instead of -cryptic make recipes, Rake uses standard Ruby code to declare tasks and -dependencies. You have the full power of a modern scripting language built -right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - --- Jim Weirich diff --git a/doc/release_notes/rake-0.8.0.rdoc b/doc/release_notes/rake-0.8.0.rdoc deleted file mode 100644 index 4fc7fdd7b..000000000 --- a/doc/release_notes/rake-0.8.0.rdoc +++ /dev/null @@ -1,114 +0,0 @@ -= Rake 0.8.0/0.8.1 Released - -Rake version 0.8.0 is a new release of rake that includes serveral new -features. - -== Changes - -=== New Features in Version 0.8.0 - -* Tasks can now receive command line parameters. See the examples - below for more details. - -* Comments are limited to 80 columns on output, but full comments can - be seen by using the -D parameter. (feature suggested by Jamis - Buck). - -* Explicit exit(n) calls will now set the exit status to n. (patch - provided by Stephen Touset). - -* Rake is now compatible with Ruby 1.9. - -Version 0.8.1 is a minor update that includes additional Ruby 1.9 -compatibility fixes. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - -== Task Argument Examples - -Prior to version 0.8.0, rake was only able to handle command line -arguments of the form NAME=VALUE that were passed into Rake via the -ENV hash. Many folks had asked for some kind of simple command line -arguments, perhaps using "--" to separate regular task names from -argument values on the command line. The problem is that there was no -easy way to associate positional arguments on the command line with -different tasks. Suppose both tasks :a and :b expect a command line -argument: does the first value go with :a? What if :b is run first? -Should it then get the first command line argument. - -Rake 0.8.0 solves this problem by explicitly passing values directly -to the tasks that need them. For example, if I had a release task -that required a version number, I could say: - - rake release[0.8.0] - -And the string "0.8.0" will be passed to the :release task. Multiple -arguments can be passed by separating them with a comma, for example: - - rake name[john,doe] - -Just a few words of caution. The rake task name and its arguments -need to be a single command line argument to rake. This generally -means no spaces. If spaces are needed, then the entire rake + -argument string should be quoted. Something like this: - - rake "name[billy bob, smith]" - -(Quoting rules vary between operating systems and shells, so make sure -you consult the proper docs for your OS/shell). - -=== Tasks that Expect Parameters - -Parameters are only given to tasks that are setup to expect them. In -order to handle named parameters, the task declaration syntax for -tasks has been extended slightly. - -For example, a task that needs a first name and last name might be -declared as: - - task :name, :first_name, :last_name - -The first argument is still the name of the task (:name in this case). -The next to argumements are the names of the parameters expected by -:name (:first_name and :last_name in the example). - -To access the values of the paramters, the block defining the task -behaviour can now accept a second parameter: - - task :name, :first_name, :last_name do |t, args| - puts "First name is #{args.first_name}" - puts "Last name is #{args.last_name}" - end - -The first argument of the block "t" is always bound to the current -task object. The second argument "args" is an open-struct like object -that allows access to the task arguments. Extra command line -arguments to a task are ignored. Missing command line arguments are -given the nil value. - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Jamis Buck (for comment formatting suggestions) -* Stephen Touset (for exit status patch). - --- Jim Weirich diff --git a/doc/release_notes/rake-0.8.2.rdoc b/doc/release_notes/rake-0.8.2.rdoc deleted file mode 100644 index a822a9497..000000000 --- a/doc/release_notes/rake-0.8.2.rdoc +++ /dev/null @@ -1,165 +0,0 @@ -= Rake 0.8.2 Released - -Rake version 0.8.2 is a new release of rake that includes a number of -new features and numerous bug fixes. - -== Changes - -=== New Features in Version 0.8.2 - -* Switched from getoptlong to optparse (patches supplied by Edwin - Pratomo). - -* The -T option will now attempt to dynamically sense the size of the - terminal. The -T output will only self-truncate if the output is a - tty. However, if RAKE_COLUMNS is explicitly set, it will be honored - in any case. (Patch provided by Gavin Stark). - -* The following public methods have been added to rake task objects: - - * task.clear -- Clear both the prerequisites and actions of the - target rake task. - * task.clear_prerequisites -- Clear all the existing prerequisites - from the target rake task. - * task.clear_actions -- Clear all the existing actions from the - target rake task. - * task.reenable -- Re-enable a task, allowing its actions to be - executed again if the task is invoked. - -* Changed RDoc test task to have no default template. This makes it - easier for the tempate to pick up the template from the environment. - -* Default values for task arguments can easily be specified with the - :with_defaults method. (Idea for default argument merging supplied - by (Adam Q. Salter) - -=== Bug Fixes in Version 0.8.2 - -* Fixed bug in package task so that it will include the subdir - directory in the package for testing. (Bug found by Adam Majer) - -* Fixed filename dependency order bug in test_inspect_pending and - test_to_s_pending. (Bug found by Adam Majer) - -* Fixed check for file utils options to make them immune to the - symbol/string differences. (Patch supplied by Edwin Pratomo) - -* Fixed bug with rules involving multiple source, where only the first - dependency of a rule has any effect (Patch supplied by Emanuel - Indermühle) - -* FileList#clone and FileList#dup have better sematics w.r.t. taint - and freeze. - -* Changed from using Mutex to Monitor. Evidently Mutex causes thread - join errors when Ruby is compiled with -disable-pthreads. (Patch - supplied by Ittay Dror) - -* Fixed bug in makefile parser that had problems with extra spaces in - file task names. (Patch supplied by Ittay Dror) - -== Other changes in Version 0.8.2 - -* Added ENV var to rake's own Rakefile to prevent OS X from including - extended attribute junk in the rake package tar file. (Bug found by - Adam Majer) - -* Added a performance patch for reading large makefile dependency - files. (Patch supplied by Ittay Dror) - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - -== Task Argument Examples - -Prior to version 0.8.0, rake was only able to handle command line -arguments of the form NAME=VALUE that were passed into Rake via the -ENV hash. Many folks had asked for some kind of simple command line -arguments, perhaps using "--" to separate regular task names from -argument values on the command line. The problem is that there was no -easy way to associate positional arguments on the command line with -different tasks. Suppose both tasks :a and :b expect a command line -argument: does the first value go with :a? What if :b is run first? -Should it then get the first command line argument. - -Rake 0.8.0 solves this problem by explicitly passing values directly -to the tasks that need them. For example, if I had a release task -that required a version number, I could say: - - rake release[0.8.2] - -And the string "0.8.2" will be passed to the :release task. Multiple -arguments can be passed by separating them with a comma, for example: - - rake name[john,doe] - -Just a few words of caution. The rake task name and its arguments -need to be a single command line argument to rake. This generally -means no spaces. If spaces are needed, then the entire rake + -argument string should be quoted. Something like this: - - rake "name[billy bob, smith]" - -(Quoting rules vary between operating systems and shells, so make sure -you consult the proper docs for your OS/shell). - -=== Tasks that Expect Parameters - -Parameters are only given to tasks that are setup to expect them. In -order to handle named parameters, the task declaration syntax for -tasks has been extended slightly. - -For example, a task that needs a first name and last name might be -declared as: - - task :name, :first_name, :last_name - -The first argument is still the name of the task (:name in this case). -The next to argumements are the names of the parameters expected by -:name (:first_name and :last_name in the example). - -To access the values of the paramters, the block defining the task -behaviour can now accept a second parameter: - - task :name, :first_name, :last_name do |t, args| - puts "First name is #{args.first_name}" - puts "Last name is #{args.last_name}" - end - -The first argument of the block "t" is always bound to the current -task object. The second argument "args" is an open-struct like object -that allows access to the task arguments. Extra command line -arguments to a task are ignored. Missing command line arguments are -given the nil value. - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Edwin Pratomo -* Gavin Stark -* Adam Q. Salter -* Adam Majer -* Emanuel Indermühle -* Ittay Dror -* Bheeshmar Redheendran (for spending an afternoon with me debugging - windows issues) - --- Jim Weirich diff --git a/doc/release_notes/rake-0.8.3.rdoc b/doc/release_notes/rake-0.8.3.rdoc deleted file mode 100644 index 97184c390..000000000 --- a/doc/release_notes/rake-0.8.3.rdoc +++ /dev/null @@ -1,112 +0,0 @@ -= Rake 0.8.3 Released - -Rake version 0.8.3 is a bug-fix release of rake. - -== Changes - -=== Bug Fixes in Version 0.8.3 - -* Enhanced the system directory detection in windows. We now check - HOMEDRIVE/HOMEPATH and USERPROFILE if APPDATA isn't found. (Patch - supplied by James Tucker). Rake no long aborts if it can't find the - directory. - -* Added fix to handle ruby installations in directories with spaces in - their name. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 - -== Task Argument Examples - -Prior to version 0.8.0, rake was only able to handle command line -arguments of the form NAME=VALUE that were passed into Rake via the -ENV hash. Many folks had asked for some kind of simple command line -arguments, perhaps using "--" to separate regular task names from -argument values on the command line. The problem is that there was no -easy way to associate positional arguments on the command line with -different tasks. Suppose both tasks :a and :b expect a command line -argument: does the first value go with :a? What if :b is run first? -Should it then get the first command line argument. - -Rake 0.8.0 solves this problem by explicitly passing values directly -to the tasks that need them. For example, if I had a release task -that required a version number, I could say: - - rake release[0.8.3] - -And the string "0.8.3" will be passed to the :release task. Multiple -arguments can be passed by separating them with a comma, for example: - - rake name[john,doe] - -Just a few words of caution. The rake task name and its arguments -need to be a single command line argument to rake. This generally -means no spaces. If spaces are needed, then the entire rake + -argument string should be quoted. Something like this: - - rake "name[billy bob, smith]" - -(Quoting rules vary between operating systems and shells, so make sure -you consult the proper docs for your OS/shell). - -=== Tasks that Expect Parameters - -Parameters are only given to tasks that are setup to expect them. In -order to handle named parameters, the task declaration syntax for -tasks has been extended slightly. - -For example, a task that needs a first name and last name might be -declared as: - - task :name, :first_name, :last_name - -The first argument is still the name of the task (:name in this case). -The next to argumements are the names of the parameters expected by -:name (:first_name and :last_name in the example). - -To access the values of the paramters, the block defining the task -behaviour can now accept a second parameter: - - task :name, :first_name, :last_name do |t, args| - puts "First name is #{args.first_name}" - puts "Last name is #{args.last_name}" - end - -The first argument of the block "t" is always bound to the current -task object. The second argument "args" is an open-struct like object -that allows access to the task arguments. Extra command line -arguments to a task are ignored. Missing command line arguments are -given the nil value. - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Edwin Pratomo -* Gavin Stark -* Adam Q. Salter -* Adam Majer -* Emanuel Indermühle -* Ittay Dror -* Bheeshmar Redheendran (for spending an afternoon with me debugging - windows issues) - --- Jim Weirich diff --git a/doc/release_notes/rake-0.8.4.rdoc b/doc/release_notes/rake-0.8.4.rdoc deleted file mode 100644 index d27de8b27..000000000 --- a/doc/release_notes/rake-0.8.4.rdoc +++ /dev/null @@ -1,147 +0,0 @@ -= Rake 0.8.4 Released - -Rake version 0.8.4 is a bug-fix release of rake. - -NOTE: The version of Rake that comes with Ruby 1.9 has diverged - slightly from the core Rake code base. Rake 0.8.4 will work - with Ruby 1.9, but is not a strict upgrade for the Rake that - comes with Ruby 1.9. A (near) future release of Rake will unify - those two codebases. - -== Letter Writing Campaign - -Thanks to Aaron Patterson (@tenderlove) and Eric Hodel (@drbrain) for -their encouraging support in organizing a letter writing campaign to -lobby for the "Warning Free" release of rake 0.8.4. A special callout -goes to Jonathan D. Lord, Sr (Dr. Wingnut) whose postcard was the -first to actually reach me. (see -http://tenderlovemaking.com/2009/02/26/we-need-a-new-version-of-rake/ -for details) - -== Changes - -=== New Features / Enhancements in Version 0.8.4 - -* Case is preserved on rakefile names. (patch from James - M. Lawrence/quix) - -* Improved Rakefile case insensitivity testing (patch from Luis - Lavena). - -* Windows system dir search order is now: HOME, HOMEDRIVE + HOMEPATH, - APPDATA, USERPROFILE (patch from Luis Lavena) - -* MingGW is now recognized as a windows platform. (patch from Luis - Lavena) - -=== Bug Fixes in Version 0.8.4 - -* Removed reference to manage_gem to fix the warning produced by the - gem package task. - -* Fixed stray ARGV option problem that was interfering with - Test::Unit::Runner. (patch from Pivotal Labs) - -=== Infrastructure Improvements in Version 0.8.4 - -* Numerous fixes to the windows test suite (patch from Luis Lavena). - -* Improved Rakefile case insensitivity testing (patch from Luis - Lavena). - -* Better support for windows paths in the test task (patch from Simon - Chiang/bahuvrihi) - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Task Argument Examples - -Prior to version 0.8.0, rake was only able to handle command line -arguments of the form NAME=VALUE that were passed into Rake via the -ENV hash. Many folks had asked for some kind of simple command line -arguments, perhaps using "--" to separate regular task names from -argument values on the command line. The problem is that there was no -easy way to associate positional arguments on the command line with -different tasks. Suppose both tasks :a and :b expect a command line -argument: does the first value go with :a? What if :b is run first? -Should it then get the first command line argument. - -Rake 0.8.0 solves this problem by explicitly passing values directly -to the tasks that need them. For example, if I had a release task -that required a version number, I could say: - - rake release[0.8.4] - -And the string "0.8.4" will be passed to the :release task. Multiple -arguments can be passed by separating them with a comma, for example: - - rake name[john,doe] - -Just a few words of caution. The rake task name and its arguments -need to be a single command line argument to rake. This generally -means no spaces. If spaces are needed, then the entire rake + -argument string should be quoted. Something like this: - - rake "name[billy bob, smith]" - -(Quoting rules vary between operating systems and shells, so make sure -you consult the proper docs for your OS/shell). - -=== Tasks that Expect Parameters - -Parameters are only given to tasks that are setup to expect them. In -order to handle named parameters, the task declaration syntax for -tasks has been extended slightly. - -For example, a task that needs a first name and last name might be -declared as: - - task :name, :first_name, :last_name - -The first argument is still the name of the task (:name in this case). -The next to argumements are the names of the parameters expected by -:name (:first_name and :last_name in the example). - -To access the values of the paramters, the block defining the task -behaviour can now accept a second parameter: - - task :name, :first_name, :last_name do |t, args| - puts "First name is #{args.first_name}" - puts "Last name is #{args.last_name}" - end - -The first argument of the block "t" is always bound to the current -task object. The second argument "args" is an open-struct like object -that allows access to the task arguments. Extra command line -arguments to a task are ignored. Missing command line arguments are -given the nil value. - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* James M. Lawrence/quix -* Luis Lavena -* Pivotal Labs -* Simon Chiang/bahuvrihi - --- Jim Weirich diff --git a/doc/release_notes/rake-0.8.5.rdoc b/doc/release_notes/rake-0.8.5.rdoc deleted file mode 100644 index 0ee2583dd..000000000 --- a/doc/release_notes/rake-0.8.5.rdoc +++ /dev/null @@ -1,53 +0,0 @@ -= Rake 0.8.5 Released - -Rake version 0.8.5 is a new release of Rake with greatly improved -support for executing commands on Windows. The "sh" command now has -the same semantics on Windows that it has on Unix based platforms. - -== Changes - -=== New Features / Enhancements in Version 0.8.5 - -* Improved implementation of the Rake system command for Windows. - (patch from James M. Lawrence/quix) - -* Support for Ruby 1.9's improved system command. (patch from James - M. Lawrence/quix) - -* Rake now includes the configured extension when invoking an - executable (Config::CONFIG['EXEEXT]) - -=== Bug Fixes in Version 0.8.5 - -* Environment variable keys are now correctly cased (it matters in - some implementations). - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* James M. Lawrence/quix -* Luis Lavena - --- Jim Weirich diff --git a/doc/release_notes/rake-0.8.6.rdoc b/doc/release_notes/rake-0.8.6.rdoc deleted file mode 100644 index 54782ed02..000000000 --- a/doc/release_notes/rake-0.8.6.rdoc +++ /dev/null @@ -1,37 +0,0 @@ -= Rake 0.8.6 Released - -Rake version 0.8.5 introduced greatly improved support for executing -commands on Windows. The "sh" command now has the same semantics on -Windows that it has on Unix based platforms. - -Rake version 0.8.5 includes minor fixes the the RDoc generation. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* James M. Lawrence/quix -* Luis Lavena - --- Jim Weirich diff --git a/doc/release_notes/rake-0.8.7.rdoc b/doc/release_notes/rake-0.8.7.rdoc deleted file mode 100644 index 884f4c659..000000000 --- a/doc/release_notes/rake-0.8.7.rdoc +++ /dev/null @@ -1,55 +0,0 @@ -= Rake 0.8.7 Released - -Rake version 0.8.5 introduced greatly improved support for executing -commands on Windows. The "sh" command now has the same semantics on -Windows that it has on Unix based platforms. - -Rake version 0.8.6 includes minor fixes the the RDoc generation. -Rake version 0.8.7 includes a minor fix for JRuby running on windows. - -== Changes - -=== New Features / Enhancements in Version 0.8.5 - -* Improved implementation of the Rake system command for Windows. - (patch from James M. Lawrence/quix) - -* Support for Ruby 1.9's improved system command. (patch from James - M. Lawrence/quix) - -* Rake now includes the configured extension when invoking an - executable (Config::CONFIG['EXEEXT]) - -=== Bug Fixes in Version 0.8.5 - -* Environment variable keys are now correctly cased (it matters in - some implementations). - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Charles Nutter - --- Jim Weirich diff --git a/doc/release_notes/rake-0.9.0.rdoc b/doc/release_notes/rake-0.9.0.rdoc deleted file mode 100644 index 823483cc2..000000000 --- a/doc/release_notes/rake-0.9.0.rdoc +++ /dev/null @@ -1,112 +0,0 @@ -= Rake 0.9.0 Released - -Rake version 0.9.0 has a number of bug fixes and enhancments (see -below for more details). Additionally, the internals have be slightly -restructured and improved. - -== Changes - -=== New Features / Enhancements / Bug Fixes in Version 0.9.0 - -* Rake now warns when the deprecated :needs syntax used (and suggests - the proper syntax in the warning). - -* Moved Rake DSL commands to top level ruby object 'main'. Rake DSL - commands are no longer private methods in Object. (Suggested by - James M. Lawrence/quix) - -* Rake now uses case-insensitive comparisons to find the Rakefile on Windows. - Based on patch by Roger Pack. - -* Rake now requires (instead of loads) files in the test task. Patch by Cezary - Baginski. - -* Fixed typos. Patches by Sean Scot August Moon and R.T. Lechow. - -* Rake now prints the Rakefile directory only when it's different from the - current directory. Patch by Alex Chaffee. - -* Improved rakefile_location discovery on Windows. Patch by James Tucker. - -* Rake now recognizes "Windows Server" as a windows system. Patch by Matthias - Lüdtke - -* Rake::RDocTask is deprecated. Use RDoc::Task from RDoc 2.4.2+ (require - 'rdoc/task') - -* Rake::GemPackageTask is deprecated. Use Gem::PackageTask (require - 'rubygems/package_task') - -* Rake now outputs various messages to $stderr instead of $stdout. - -* Rake no longer emits warnings for Config. Patch by Santiago Pastorino. - -* Removed Rake's DSL methods from the top level scope. If you need to - call 'task :xzy' in your code, include Rake::DSL into your class, or - put the code in a Rake::DSL.environment do ... end block. - -* Split rake.rb into individual files. - -* Support for the --where (-W) flag for showing where a task is defined. - -* Fixed quoting in test task. - (http://onestepback.org/redmine/issues/show/44, - http://www.pivotaltracker.com/story/show/1223138) - -* Fixed the silent option parsing problem. - (http://onestepback.org/redmine/issues/show/47) - -* Fixed :verbose=>false flag on sh and ruby commands. - -* Rake command line options may be given by default in a RAKEOPT - environment variable. - -* Errors in Rake will now display the task invocation chain in effect - at the time of the error. - -* Accepted change by warnickr to not expand test patterns in shell - (allowing more files in the test suite). - -* Fixed that file tasks did not perform prereq lookups in scope - (Redmine #57). - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* James M. Lawrence (quix) -* Roger Pack -* Cezary Baginski -* Sean Scot August Moon -* R.T. Lechow -* Alex Chaffee -* James Tucker -* Matthias Lüdtke -* Santiago Pastorino - -Also, bit thanks to Eric Hodel for assisting with getting this release -out the door (where "assisting" includes, but is not by any means -limited to, "pushing" me to get it done). - --- Jim Weirich diff --git a/doc/release_notes/rake-0.9.1.rdoc b/doc/release_notes/rake-0.9.1.rdoc deleted file mode 100644 index 70be8b568..000000000 --- a/doc/release_notes/rake-0.9.1.rdoc +++ /dev/null @@ -1,52 +0,0 @@ -= Rake 0.9.1 Released - -Rake version 0.9.1 has a number of bug fixes and enhancments (see -below for more details). Additionally, the internals have be slightly -restructured and improved. - -== Changes - -Rake 0.9.1 adds back the global DSL methods, but with deprecation -messages. This allows Rake 0.9.1 to be used with older rakefiles with -warning messages. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* James M. Lawrence (quix) -* Roger Pack -* Cezary Baginski -* Sean Scot August Moon -* R.T. Lechow -* Alex Chaffee -* James Tucker -* Matthias Lüdtke -* Santiago Pastorino - -Also, bit thanks to Eric Hodel for assisting with getting this release -out the door (where "assisting" includes, but is not by any means -limited to, "pushing" me to get it done). - --- Jim Weirich diff --git a/doc/release_notes/rake-0.9.2.2.rdoc b/doc/release_notes/rake-0.9.2.2.rdoc deleted file mode 100644 index d848f227b..000000000 --- a/doc/release_notes/rake-0.9.2.2.rdoc +++ /dev/null @@ -1,55 +0,0 @@ -= Rake 0.9.2.2 Released - -Rake version 0.9.2.2 is mainly bug fixes. - -== Changes - -* The rake test loader now removes arguments it has processed. Issue #51 -* Rake::TaskArguments now responds to #values_at -* RakeFileUtils.verbose_flag = nil silences output the same as 0.8.7 -* Rake tests are now directory-independent -* Rake tests are no longer require flexmock -* Commands constant is no longer polluting top level namespace. -* Show only the interesting portion of the backtrace by default (James M. Lawrence). -* Added --reduce-compat option to remove backward compatible DSL hacks (James M. Lawrence). - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* James M. Lawrence (quix) -* Roger Pack -* Cezary Baginski -* Sean Scot August Moon -* R.T. Lechow -* Alex Chaffee -* James Tucker -* Matthias Lüdtke -* Santiago Pastorino - -Also, bit thanks to Eric Hodel for assisting with getting this release -out the door (where "assisting" includes, but is not by any means -limited to, "pushing" me to get it done). - --- Jim Weirich diff --git a/doc/release_notes/rake-0.9.2.rdoc b/doc/release_notes/rake-0.9.2.rdoc deleted file mode 100644 index 2314193f5..000000000 --- a/doc/release_notes/rake-0.9.2.rdoc +++ /dev/null @@ -1,49 +0,0 @@ -= Rake 0.9.2 Released - -Rake version 0.9.2 has a few small fixes. See below for details. - -== Changes - -* Support for Ruby 1.8.6 was fixed. -* Global DSL warnings now honor --no-deprecate - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://rake.rubyforge.org/ -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* James M. Lawrence (quix) -* Roger Pack -* Cezary Baginski -* Sean Scot August Moon -* R.T. Lechow -* Alex Chaffee -* James Tucker -* Matthias Lüdtke -* Santiago Pastorino - -Also, bit thanks to Eric Hodel for assisting with getting this release -out the door (where "assisting" includes, but is not by any means -limited to, "pushing" me to get it done). - --- Jim Weirich diff --git a/doc/release_notes/rake-0.9.3.rdoc b/doc/release_notes/rake-0.9.3.rdoc deleted file mode 100644 index 4476b4f18..000000000 --- a/doc/release_notes/rake-0.9.3.rdoc +++ /dev/null @@ -1,102 +0,0 @@ -= Rake 0.9.3 Released - -Rake version 0.9.3 contains some new, backwards compatible features and -a number of bug fixes. - -== Changes - -=== New Features - -* Multitask tasks now use a thread pool. Use -j to limit the number of - available threads. - -* Use -m to turn regular tasks into multitasks (use at your own risk). - -* You can now do "Rake.add_rakelib 'dir'" in your Rakefile to - programatically add rake task libraries. - -* You can specific backtrace suppression patterns (see - --supress-backtrace) - -* Directory tasks can now take prerequisites and actions - -* Use --backtrace to request a full backtrace without the task trace. - -* You can say "--backtrace=stdout" and "--trace=stdout" to route trace - output to standard output rather than standard error. - -* Optional 'phony' target (enable with 'require 'rake/phony'") for - special purpose builds. - -* Task#clear now clears task comments as well as actions and - prerequisites. Task#clear_comment will specifically target comments. - -* The --all option will force -T and -D to consider all the tasks, - with and without descriptions. - -=== Bug Fixes - -* Semi-colons in windows rakefile paths now work. - -* Improved Control-C support when invoking multiple test suites. - -* egrep method now reads files in text mode (better support for - Windows) - -* Better deprecation line number reporting. - -* The -W option now works with all tasks, whether they have a - description or not. - -* File globs in rake should not be sorted alphabetically, independent - of file system and platform. - -* Numerous internal improvements. - -* Documentation typos and fixes. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://github.com/jimweirich/rake -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Aaron Patterson -* Dylan Smith -* Jo Liss -* Jonas Pfenniger -* Kazuki Tsujimoto -* Michael Bishop -* Michael Elufimov -* NAKAMURA Usaku -* Ryan Davis -* Sam Grönblom -* Sam Phippen -* Sergio Wong -* Tay Ray Chuan -* grosser -* quix - -Also, many thanks to Eric Hodel for assisting with getting this release -out the door. - --- Jim Weirich diff --git a/doc/release_notes/rake-0.9.4.rdoc b/doc/release_notes/rake-0.9.4.rdoc deleted file mode 100644 index 099ebc91b..000000000 --- a/doc/release_notes/rake-0.9.4.rdoc +++ /dev/null @@ -1,60 +0,0 @@ -= Rake 0.9.4 Released - -Rake version 0.9.4 contains a number of bug fixes. - -== Changes - -=== Bug Fixes (0.9.4) - -* Exit status with failing tests is not correctly set to non-zero. - -* Simplified syntax for phony task (for older versions of RDoc). - -* Stand alone FileList usage gets glob function (without loading in - extra dependencies) - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://github.com/jimweirich/rake -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Aaron Patterson -* Dylan Smith -* Jo Liss -* Jonas Pfenniger -* Kazuki Tsujimoto -* Michael Bishop -* Michael Elufimov -* NAKAMURA Usaku -* Ryan Davis -* Sam Grönblom -* Sam Phippen -* Sergio Wong -* Tay Ray Chuan -* grosser -* quix - -Also, many thanks to Eric Hodel for assisting with getting this release -out the door. - --- Jim Weirich diff --git a/doc/release_notes/rake-0.9.5.rdoc b/doc/release_notes/rake-0.9.5.rdoc deleted file mode 100644 index 40c35ee69..000000000 --- a/doc/release_notes/rake-0.9.5.rdoc +++ /dev/null @@ -1,55 +0,0 @@ -= Rake 0.9.5 Released - -Rake version 0.9.5 contains a number of bug fixes. - -== Changes - -=== Bug Fixes (0.9.5) - -* --trace and --backtrace no longer swallow following task names. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://github.com/jimweirich/rake -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Aaron Patterson -* Dylan Smith -* Jo Liss -* Jonas Pfenniger -* Kazuki Tsujimoto -* Michael Bishop -* Michael Elufimov -* NAKAMURA Usaku -* Ryan Davis -* Sam Grönblom -* Sam Phippen -* Sergio Wong -* Tay Ray Chuan -* grosser -* quix - -Also, many thanks to Eric Hodel for assisting with getting this release -out the door. - --- Jim Weirich diff --git a/doc/release_notes/rake-0.9.6.rdoc b/doc/release_notes/rake-0.9.6.rdoc deleted file mode 100644 index fb247e794..000000000 --- a/doc/release_notes/rake-0.9.6.rdoc +++ /dev/null @@ -1,64 +0,0 @@ -= Rake 0.9.6 Released - -Rake version 0.9.6 contains a number of fixes mainly for merging -Rake into the Ruby source tree and fixing tests. - -== Changes - -=== Bug Fixes (0.9.6) - -* Better trace output when using a multi-threaded Rakefile. -* Arg parsing is now consistent for tasks and multitasks. -* Skip exit code test in versions of Ruby that don't support it well. - -Changes for better integration with the Ruby source tree: - -* Fix version literal for Ruby source tree build. -* Better loading of libraries for testing in Ruby build. -* Use the ruby version provided by Ruby's tests. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://github.com/jimweirich/rake -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a alot of these changes. The -following people either contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Aaron Patterson -* Dylan Smith -* Jo Liss -* Jonas Pfenniger -* Kazuki Tsujimoto -* Michael Bishop -* Michael Elufimov -* NAKAMURA Usaku -* Ryan Davis -* Sam Grönblom -* Sam Phippen -* Sergio Wong -* Tay Ray Chuan -* grosser -* quix - -Also, many thanks to Eric Hodel for assisting with getting this release -out the door. - --- Jim Weirich diff --git a/doc/release_notes/rake-10.0.0.rdoc b/doc/release_notes/rake-10.0.0.rdoc deleted file mode 100644 index 7bf68fb73..000000000 --- a/doc/release_notes/rake-10.0.0.rdoc +++ /dev/null @@ -1,178 +0,0 @@ -= Rake 10.0 Released - - "Jim, when will Rake reach version 1.0?" - -Over the past several years I've been asked that question at -conferences, panels and over twitter. Due to historical reasons (or -maybe just plain laziness) Rake has (incorrectly) been treating the -second digit of the version as the major release number. So in my head -Rake was already at version 9. - -Well, it's time to fix things. This next version of Rake drops old, -crufty, backwards compatibility hacks such as top level constants, DSL -methods defined in Object and numerous other features that are just no -longer desired. It's also time to drop the leading zero from the -version number as well and call this new version of rake what it -really is: Version 10. - -So, welcome to Rake 10.0! - -Rake 10 is actually feature identical to the latest version of Rake 9 -(that would be the version spelled 0.9.3), *except* that Rake 10 drops -all the sundry deprecated features that have accumulated over the years. - -If your Rakefile is up to date and current with all the new features -of Rake 10, you are ready to go. If your Rakefile still uses a few -deprecated feeatures, feel free to use Rake 9 (0.9.3) with the same -feature set. Just be aware that future features will be in Rake 10 -family line. - -== Changes in 10.0 - -As mentioned above, there are no new features in Rake 10. However, -there are a number of features missing: - -* Classic namespaces are now gone. Rake is no longer able to reflect - the options settings in the global variables ($rakefile, $show_tasks, - $show_prereqs, $trace, $dryrun and $silent). The - --classic-namespace option is no longer supported. - -* Global constants are no longer supported. This includes - Task, FileTask, FileCreationTask and - RakeApp). The constant missing hook to warn about using - global rake constants has been removed. - -* The Rake DSL methods (task, file, directory, etc) are in their own - module (Rake::DSL). The stub versions of these methods (that printed - warnings) in Object have been removed. However, the DSL methods are - added to the top-level main object. Since main is - not in the inheritance tree, the presence of the DSL methods in main - should be low impact on other libraries. - - If you want to use the Rake DSL commands from your own code, just - include Rake::DSL into your own classes and modules. - -* The deprecated syntax for task arguments (the one using - :needs) has been removed. - -* The --reduce-compat flag has been removed (it's not needed - anymore). - -* The deprecated rake/sys.rb library has been removed. - -* The deprecated rake/rdoctask.rb library has been removed. - RDoc supplies its own rake task now. - -* The deprecated rake/gempackagetask.rb library has been - removed. Gem supplies its own package task now. - -There is one small behavioral change: - -* Non-file tasks now always report the current time as their time - stamp. This is different from the previous behavior where non-file - tasks reported current time only if there were no prerequisites, and - the max prerequisite timestamp otherwise. This lead to inconsistent - and surprising behavior when adding prerequisites to tasks that in - turn were prequisites to file tasks. The new behavior is more - consistent and predictable. - -== Changes (from 0.9.3) - -Since Rake 10 includes the changes from the last version of Rake 9, -we'll repeat the changes for version 0.9.3 here. - -=== New Features - -* Multitask tasks now use a thread pool. Use -j to limit the number of - available threads. - -* Use -m to turn regular tasks into multitasks (use at your own risk). - -* You can now do "Rake.add_rakelib 'dir'" in your Rakefile to - programatically add rake task libraries. - -* You can specific backtrace suppression patterns (see - --supress-backtrace) - -* Directory tasks can now take prerequisites and actions - -* Use --backtrace to request a full backtrace without the task trace. - -* You can say "--backtrace=stdout" and "--trace=stdout" to route trace - output to standard output rather than standard error. - -* Optional 'phony' target (enable with 'require 'rake/phony'") for - special purpose builds. - -* Task#clear now clears task comments as well as actions and - prerequisites. Task#clear_comment will specifically target comments. - -* The --all option will force -T and -D to consider all the tasks, - with and without descriptions. - -=== Bug Fixes - -* Semi-colons in windows rakefile paths now work. - -* Improved Control-C support when invoking multiple test suites. - -* egrep method now reads files in text mode (better support for - Windows) - -* Better deprecation line number reporting. - -* The -W option now works with all tasks, whether they have a - description or not. - -* File globs in rake should not be sorted alphabetically, independent - of file system and platform. - -* Numerous internal improvements. - -* Documentation typos and fixes. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://github.com/jimweirich/rake -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a lot of these changes. The -following people contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Aaron Patterson -* Dylan Smith -* Jo Liss -* Jonas Pfenniger -* Kazuki Tsujimoto -* Michael Bishop -* Michael Elufimov -* NAKAMURA Usaku -* Ryan Davis -* Sam Grönblom -* Sam Phippen -* Sergio Wong -* Tay Ray Chuan -* grosser -* quix - -Also, many thanks to Eric Hodel for assisting with getting this release -out the door. - --- Jim Weirich diff --git a/doc/release_notes/rake-10.0.1.rdoc b/doc/release_notes/rake-10.0.1.rdoc deleted file mode 100644 index 152af25a5..000000000 --- a/doc/release_notes/rake-10.0.1.rdoc +++ /dev/null @@ -1,58 +0,0 @@ -= Rake 10.0.1 Released - -== Changes in 10.0.1 - -=== Bug Fixes - -* Exit status with failing tests is not correctly set to non-zero. - -* Simplified syntax for phony task (for older versions of RDoc). - -* Stand alone FileList usage gets glob function (without loading in - extra dependencies) - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://github.com/jimweirich/rake -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a lot of these changes. The -following people contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Aaron Patterson -* Dylan Smith -* Jo Liss -* Jonas Pfenniger -* Kazuki Tsujimoto -* Michael Bishop -* Michael Elufimov -* NAKAMURA Usaku -* Ryan Davis -* Sam Grönblom -* Sam Phippen -* Sergio Wong -* Tay Ray Chuan -* grosser -* quix - -Also, many thanks to Eric Hodel for assisting with getting this release -out the door. - --- Jim Weirich diff --git a/doc/release_notes/rake-10.0.2.rdoc b/doc/release_notes/rake-10.0.2.rdoc deleted file mode 100644 index bb6bda874..000000000 --- a/doc/release_notes/rake-10.0.2.rdoc +++ /dev/null @@ -1,53 +0,0 @@ -= Rake 10.0.2 Released - -== Changes in Rake 10.0.2 - -=== Bug Fixes - -* --trace and --backtrace no longer swallow following task names. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://github.com/jimweirich/rake -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a lot of these changes. The -following people contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Aaron Patterson -* Dylan Smith -* Jo Liss -* Jonas Pfenniger -* Kazuki Tsujimoto -* Michael Bishop -* Michael Elufimov -* NAKAMURA Usaku -* Ryan Davis -* Sam Grönblom -* Sam Phippen -* Sergio Wong -* Tay Ray Chuan -* grosser -* quix - -Also, many thanks to Eric Hodel for assisting with getting this release -out the door. - --- Jim Weirich diff --git a/doc/release_notes/rake-10.0.3.rdoc b/doc/release_notes/rake-10.0.3.rdoc deleted file mode 100644 index dbc84c1c1..000000000 --- a/doc/release_notes/rake-10.0.3.rdoc +++ /dev/null @@ -1,191 +0,0 @@ -= Rake 10.0.3 Released - - "Jim, when will Rake reach version 1.0?" - -Over the past several years I've been asked that question at -conferences, panels and over twitter. Due to historical reasons (or -maybe just plain laziness) Rake has (incorrectly) been treating the -second digit of the version as the major release number. So in my head -Rake was already at version 9. - -Well, it's time to fix things. This next version of Rake drops old, -crufty, backwards compatibility hacks such as top level constants, DSL -methods defined in Object and numerous other features that are just no -longer desired. It's also time to drop the leading zero from the -version number as well and call this new version of rake what it -really is: Version 10. - -So, welcome to Rake 10.0! - -Rake 10 is actually feature identical to the latest version of Rake 9 -(that would be the version spelled 0.9.3), *except* that Rake 10 drops -all the sundry deprecated features that have accumulated over the years. - -If your Rakefile is up to date and current with all the new features -of Rake 10, you are ready to go. If your Rakefile still uses a few -deprecated feeatures, feel free to use Rake 9 (0.9.3) with the same -feature set. Just be aware that future features will be in Rake 10 -family line. - -== Changes in Version 10 - -As mentioned above, there are no new features in Rake 10. However, -there are a number of features missing: - -* Classic namespaces are now gone. Rake is no longer able to reflect - the options settings in the global variables ($rakefile, $show_tasks, - $show_prereqs, $trace, $dryrun and $silent). The - --classic-namespace option is no longer supported. - -* Global constants are no longer supported. This includes - Task, FileTask, FileCreationTask and - RakeApp). The constant missing hook to warn about using - global rake constants has been removed. - -* The Rake DSL methods (task, file, directory, etc) are in their own - module (Rake::DSL). The stub versions of these methods (that printed - warnings) in Object have been removed. However, the DSL methods are - added to the top-level main object. Since main is - not in the inheritance tree, the presence of the DSL methods in main - should be low impact on other libraries. - - If you want to use the Rake DSL commands from your own code, just - include Rake::DSL into your own classes and modules. - -* The deprecated syntax for task arguments (the one using - :needs) has been removed. - -* The --reduce-compat flag has been removed (it's not needed - anymore). - -* The deprecated rake/sys.rb library has been removed. - -* The deprecated rake/rdoctask.rb library has been removed. - RDoc supplies its own rake task now. - -* The deprecated rake/gempackagetask.rb library has been - removed. Gem supplies its own package task now. - -There is one small behavioral change: - -* Non-file tasks now always report the current time as their time - stamp. This is different from the previous behavior where non-file - tasks reported current time only if there were no prerequisites, and - the max prerequisite timestamp otherwise. This lead to inconsistent - and surprising behavior when adding prerequisites to tasks that in - turn were prequisites to file tasks. The new behavior is more - consistent and predictable. - -== Changes (from 0.9.3, 0.9.4, 0.9.5) - -Since Rake 10 includes the changes from the last version of Rake 9, -we'll repeat the changes for versions 0.9.3 through 0.9.5 here. - -=== New Features (in 0.9.3) - -* Multitask tasks now use a thread pool. Use -j to limit the number of - available threads. - -* Use -m to turn regular tasks into multitasks (use at your own risk). - -* You can now do "Rake.add_rakelib 'dir'" in your Rakefile to - programatically add rake task libraries. - -* You can specific backtrace suppression patterns (see - --supress-backtrace) - -* Directory tasks can now take prerequisites and actions - -* Use --backtrace to request a full backtrace without the task trace. - -* You can say "--backtrace=stdout" and "--trace=stdout" to route trace - output to standard output rather than standard error. - -* Optional 'phony' target (enable with 'require 'rake/phony'") for - special purpose builds. - -* Task#clear now clears task comments as well as actions and - prerequisites. Task#clear_comment will specifically target comments. - -* The --all option will force -T and -D to consider all the tasks, - with and without descriptions. - -=== Bug Fixes (in 0.9.3) - -* Semi-colons in windows rakefile paths now work. - -* Improved Control-C support when invoking multiple test suites. - -* egrep method now reads files in text mode (better support for - Windows) - -* Better deprecation line number reporting. - -* The -W option now works with all tasks, whether they have a - description or not. - -* File globs in rake should not be sorted alphabetically, independent - of file system and platform. - -* Numerous internal improvements. - -* Documentation typos and fixes. - -=== Bug Fixes (in 0.9.4) - -* Exit status with failing tests is not correctly set to non-zero. - -* Simplified syntax for phony task (for older versions of RDoc). - -* Stand alone FileList usage gets glob function (without loading in - extra dependencies) - -=== Bug Fixes (in 0.9.5) - -* --trace and --backtrace no longer swallow following task names. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more traditional places: - -Home Page:: http://github.com/jimweirich/rake -Download:: http://rubyforge.org/project/showfiles.php?group_id=50 -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a lot of these changes. The -following people contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Aaron Patterson -* Dylan Smith -* Jo Liss -* Jonas Pfenniger -* Kazuki Tsujimoto -* Michael Bishop -* Michael Elufimov -* NAKAMURA Usaku -* Ryan Davis -* Sam Grönblom -* Sam Phippen -* Sergio Wong -* Tay Ray Chuan -* grosser -* quix - -Also, many thanks to Eric Hodel for assisting with getting this release -out the door. - --- Jim Weirich diff --git a/doc/release_notes/rake-10.1.0.rdoc b/doc/release_notes/rake-10.1.0.rdoc deleted file mode 100644 index a9f4bb396..000000000 --- a/doc/release_notes/rake-10.1.0.rdoc +++ /dev/null @@ -1,61 +0,0 @@ -= Rake 10.1.0 Released - -== Changes in Version 10.1 - -=== New Features - -* Add support for variable length task argument lists. If more actual - arguments are supplied than named arguments, then the extra - arguments values will be in args.extras. - -* Application name is not displayed in the help banner. (Previously - "rake" was hardcoded, now rake-based applications can display their - own names). - -=== Bug Fixes - -Bug fixes include: - -* Fix backtrace suppression issues. - -* Rules now explicit get task arguments passed to them. - -* Rename FileList#exclude? to FileList#exclude_from_list? to avoid - conflict with new Rails method. - -* Clean / Clobber tasks now report failure to remove files. - -* Plus heaps of internal code cleanup. - -== What is Rake - -Rake is a build tool similar to the make program in many ways. But -instead of cryptic make recipes, Rake uses standard Ruby code to -declare tasks and dependencies. You have the full power of a modern -scripting language built right into your build tool. - -== Availability - -The easiest way to get and install rake is via RubyGems ... - - gem install rake (you may need root/admin privileges) - -Otherwise, you can get it from the more from GitHub: - -GitHub:: git://github.com/jimweirich/rake.git - -== Thanks - -As usual, it was input from users that drove a lot of these changes. -The following people contributed patches, made suggestions or made -otherwise helpful comments. Thanks to ... - -* Michael Nikitochkin (general code cleanup) -* Vipul A M (general code cleanup) -* Dennis Bell (variable length task argument lists) -* Jacob Swanner (rules arguments) -* Rafael Rosa Fu (documentation typo) -* Stuart Nelson (install.rb fixes) -* Lee Hambley (application name in help banner) - --- Jim Weirich From 111f29554298eccc41144c10fd501012c242b348 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 18 Aug 2016 22:11:12 +0900 Subject: [PATCH 058/108] generate gh-pages task --- Rakefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Rakefile b/Rakefile index 97c22a45f..fdba19ad8 100644 --- a/Rakefile +++ b/Rakefile @@ -26,4 +26,13 @@ RDoc::Task.new do |doc| doc.rdoc_dir = 'html' end +task :ghpages => :rdoc do + `git checkout gh-pages` + require 'fileutils' + FileUtils.rm_rf '/tmp/html' + FileUtils.mv 'html', '/tmp' + FileUtils.rm_rf '*' + FileUtils.cp_r Dir.glob('/tmp/html/*'), '.' +end + task :default => :test From 0f0a870e0d74c2152d71306109f8d3db54239162 Mon Sep 17 00:00:00 2001 From: Jesse Bowes Date: Thu, 25 Aug 2016 09:54:44 -0600 Subject: [PATCH 059/108] #156 Remove arguments on clear --- lib/rake/task.rb | 9 ++++++++- test/test_rake_task.rb | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 1f4f591d5..b1356ed89 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -141,11 +141,12 @@ def reenable @already_invoked = false end - # Clear the existing prerequisites and actions of a rake task. + # Clear the existing prerequisites, actions, comments, and arguments of a rake task. def clear clear_prerequisites clear_actions clear_comments + clear_args self end @@ -167,6 +168,12 @@ def clear_comments self end + # Clear the existing arguments on a rake task. + def clear_args + @arg_names = nil + self + end + # Invoke the task if it is needed. Prerequisites are invoked first. def invoke(*args) task_args = TaskArguments.new(arg_names, args) diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 9a4c3fc23..91185257c 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -112,11 +112,12 @@ def test_can_double_invoke_with_reenable def test_clear desc "a task" - t = task("t" => "a") { } + t = task("t", ["b"] => "a") { } t.clear assert t.prerequisites.empty?, "prerequisites should be empty" assert t.actions.empty?, "actions should be empty" assert_nil t.comment, "comments should be empty" + assert_empty t.arg_names, "arg names should be empty" end def test_clear_prerequisites @@ -148,6 +149,18 @@ def test_clear_comments assert_equal 1, task(:foo).actions.size end + def test_clear_args + task :foo, [:x] do + # Dummy action + end + + task(:foo).clear_args + + task :foo + + assert_empty task(:foo).arg_names + end + def test_find task :tfind assert_equal "tfind", Task[:tfind].name From 20ae9ff3a87bfd06a6203154f5c697d19086d91f Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 26 Aug 2016 11:13:47 +0900 Subject: [PATCH 060/108] History --- History.rdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/History.rdoc b/History.rdoc index 188b12f34..21366be0c 100644 --- a/History.rdoc +++ b/History.rdoc @@ -2,6 +2,7 @@ Compatibility Changes: +* Remove arguments on clear #157 by Jesse Bowes * Removed `rake/contrib` packages. These are extracted to `rake-contrib` gem. * Removed to deprecated warnings for `last\_comment`. From 3576c22c2e4816f1f5ff51f46ec3b6693027f6a2 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 27 Aug 2016 17:28:08 +0900 Subject: [PATCH 061/108] replaced 10.1.1 release changes --- History.rdoc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/History.rdoc b/History.rdoc index 21366be0c..f39a48728 100644 --- a/History.rdoc +++ b/History.rdoc @@ -229,11 +229,10 @@ Bug fixes: * Fixed bug in can\_detect\_signals? in test. Patch from #243 by Alexey Borzenkov. -=== 10.1.1 and earlier +=== 10.1.1 -Additions to the old CHANGES file were not made consistently so some -versions are missing from this file. These changes are usually described in -the individual release notes files. +* Use http://github.com/jimweirich/rake instead of http://rake.rubyforge.org for + canonical project url. === 10.1.0 From 9ecb16e9fef43927bd08bfb3436fb589191454e8 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 27 Aug 2016 17:30:25 +0900 Subject: [PATCH 062/108] formatting for rdoc --- History.rdoc | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/History.rdoc b/History.rdoc index f39a48728..be971eab8 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,6 +1,6 @@ === 12.0.0(dev) -Compatibility Changes: +==== Compatibility Changes * Remove arguments on clear #157 by Jesse Bowes * Removed `rake/contrib` packages. These are extracted to `rake-contrib` gem. @@ -8,19 +8,19 @@ Compatibility Changes: === 11.2.2 / 2016-06-12 -Bug fixes: +==== Bug fixes * Fix unexpected behavior with multiple dependencies on Rake::TestTask === 11.2.1 / 2016-06-12 -Bug fixes: +==== Bug fixes * Fix regression of dependencies handling on Rake::TestTask. Report #139 === 11.2.0 / 2016-06-11 -Bug fixes: +==== Bug fixes * Fix unexpected cut-out behavior on task description using triple dots and exclamation. Report #106 from Stephan Kämper and Pull request #134 by Lee @@ -28,7 +28,7 @@ Bug fixes: by bakunyo * Ignore to use `hwprefs` on Darwin platform. Use sysctl now. Report #128 -Enhancements: +==== Enhancements * Spawn options for sh Pull equest #138 by Eric Hodel. * Allow to specify dependencies(prerequisites) for Rake::TestTask @@ -40,39 +40,39 @@ Enhancements: === 11.1.2 / 2016-03-28 -Bug fixes: +==== Bug fixes * Remove `-W` option when Rake::TestTask#verbose enabled. It's misunderstanding specification change with Rake 11. Partly revert #67 === 11.1.1 / 2016-03-14 -Bug fixes: +==== Bug fixes * Use `-W` instead of `--verbose` when Rake::TestTask#verbose enabled. JRuby doesn't have `--verbose` option. === 11.1.0 / 2016-03-11 -Compatibility Changes: +==== Compatibility Changes * Revert to remove `last\_comment`. It will remove Rake 12. === 11.0.1 / 2016-03-09 -Bug fixes: +==== Bug fixes * Fixed packaging manifest. === 11.0.0 / 2016-03-09 -Bug fixes: +==== Bug fixes * Correctly handle bad encoding in exception messages. Pull request #113 by Tomer Brisker * Fix verbose option at TestTask. Pull request #67 by Mike Blumtritt -Enhancements: +==== Enhancements * Make FileList#exclude more analogous to FileList#include. * Use IO.open instead of Open3.popen3 for CPU counter. @@ -86,7 +86,7 @@ Enhancements: Pull request #12 by Chris Keathley * Use ruby warnings by default. Pull request #97 by Harold Giménez -Compatibility Changes: +==== Compatibility Changes * Removed to support Ruby 1.8.x * Removed constant named `RAKEVERSION` @@ -100,7 +100,7 @@ Compatibility Changes: === 10.5.0 / 2016-01-13 -Enhancements: +==== Enhancements * Removed monkey patching for Ruby 1.8. Pull request #46 by Pablo Herrero. * Inheritance class of Rake::FileList returns always self class. @@ -108,7 +108,7 @@ Enhancements: === 10.4.2 / 2014-12-02 -Bug fixes: +==== Bug fixes * Rake no longer edits ARGV. This allows you to re-exec rake from a rake task. Pull requset #9 by Matt Palmer. @@ -119,14 +119,14 @@ Bug fixes: === 10.4.1 / 2014-12-01 -Bug fixes: +==== Bug fixes * Reverted fix for #277 as it caused numerous issues for rake users. rails/spring issue #366 by Gustavo Dutra. === 10.4.0 / 2014-11-22 -Enhancements: +==== Enhancements * Upgraded to minitest 5. Pull request #292 by Teo Ljungberg. * Added support for Pathname in rake tasks. Pull request #271 by Randy @@ -137,7 +137,7 @@ Enhancements: task. Issue #277 by Matt Palmer. * Etc.nprocessors is used for counting the number of CPUs. -Bug fixes: +==== Bug fixes * Updated rake manpage. Issue #283 by Nathan Long, pull request #291 by skittleys. @@ -150,7 +150,7 @@ Bug fixes: === 10.3.2 / 2014-05-15 -Bug fixes: +==== Bug fixes * Rake no longer infinitely loops when showing exception causes that refer to each other. Bug #272 by Chris Bandy. @@ -158,7 +158,7 @@ Bug fixes: === 10.3.1 / 2014-04-17 -Bug fixes: +==== Bug fixes * Really stop reporting an error when cleaning already-deleted files. Pull request #269 by Randy Coulman @@ -166,13 +166,13 @@ Bug fixes: === 10.3 / 2014-04-15 -Enhancements: +==== Enhancements * Added --build-all option to rake which treats all file prerequisites as out-of-date. Pull request #254 by Andrew Gilbert. * Added Rake::NameSpace#scope. Issue #263 by Jon San Miguel. -Bug fixes: +==== Bug fixes * Suppress org.jruby package files in rake error messages for JRuby users. Issue #213 by Charles Nutter. @@ -184,13 +184,13 @@ Bug fixes: === 10.2.2 / 2014-03-27 -Bug fixes: +==== Bug fixes * Restored Ruby 1.8.7 compatibility === 10.2.1 / 2014-03-25 -Bug fixes: +==== Bug fixes * File tasks including a ':' are now top-level tasks again. Issue #262 by Josh Holtrop. @@ -199,7 +199,7 @@ Bug fixes: === 10.2.0 / 2014-03-24 -Enhancements: +==== Enhancements * Rake now requires Ruby 1.9 or newer. For me, this is a breaking change, but it seems that Jim planned to release it with Rake 10.2. See also pull @@ -217,7 +217,7 @@ Enhancements: Filip Hrbek. * Rake now prints the exception class on errors. Patch #251 by David Cornu. -Bug fixes: +==== Bug fixes * Fixed typos. Pull request #256 by Valera Rozuvan, #250 via Jake Worth, #260 by Zachary Scott. From 01657b91e0bbde0a3b1530ac165eaa8a1cb07d5d Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 28 Aug 2016 08:18:36 +0900 Subject: [PATCH 063/108] Added help message for -AT combination fix GH-155 --- lib/rake/application.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 23db9b890..7e1ba9a52 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -550,7 +550,8 @@ def standard_rake_options # :nodoc: ], ['--tasks', '-T [PATTERN]', "Display the tasks (matching optional PATTERN) " + - "with descriptions, then exit.", + "with descriptions, then exit. " + + "-AT combination displays all of tasks contained no description.", lambda { |value| select_tasks_to_show(options, :tasks, value) } From 443e1cc64a0acb20aa8798b255c2779cb89ba94d Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:19:54 +0900 Subject: [PATCH 064/108] added global configuration for rubocop --- .rubocop.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 385e49289..860acafbb 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,9 @@ +AllCops: + TargetRubyVersion: 2.3 + DisabledByDefault: true + Exclude: + - rake.gemspec + StringLiterals: Enabled: false From deb7c2ac15fa59ebea9331f24b4859c70c25add2 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:20:11 +0900 Subject: [PATCH 065/108] expand line length to 120chars --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 860acafbb..1c1a6fcfd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -15,7 +15,7 @@ HashSyntax: LineLength: Enabled: true - Max: 90 + Max: 120 WhileUntilModifier: Enabled: false From f8f686ec84ba4166623bcd791f608f66d0f2ad49 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:22:19 +0900 Subject: [PATCH 066/108] enforce to use Ruby 1.9 style hash syntax --- .rubocop.yml | 4 ++-- Rakefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 1c1a6fcfd..6e330f411 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -10,8 +10,8 @@ StringLiterals: SpaceAroundEqualsInParameterDefault: Enabled: false -HashSyntax: - Enabled: false +Style/HashSyntax: + Enabled: true LineLength: Enabled: true diff --git a/Rakefile b/Rakefile index fdba19ad8..7741400fe 100644 --- a/Rakefile +++ b/Rakefile @@ -26,7 +26,7 @@ RDoc::Task.new do |doc| doc.rdoc_dir = 'html' end -task :ghpages => :rdoc do +task ghpages: :rdoc do `git checkout gh-pages` require 'fileutils' FileUtils.rm_rf '/tmp/html' @@ -35,4 +35,4 @@ task :ghpages => :rdoc do FileUtils.cp_r Dir.glob('/tmp/html/*'), '.' end -task :default => :test +task default: :test From 7863b97587e3d4c0e3d4e5f51fb04c54f063fb39 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:25:29 +0900 Subject: [PATCH 067/108] prefer to use double quotes string literals --- .rubocop.yml | 5 +- Gemfile | 2 +- Rakefile | 26 +- exe/rake | 2 +- lib/rake.rb | 68 ++--- lib/rake/application.rb | 130 ++++----- lib/rake/backtrace.rb | 2 +- lib/rake/clean.rb | 4 +- lib/rake/cpu_counter.rb | 2 +- lib/rake/dsl_definition.rb | 2 +- lib/rake/ext/pathname.rb | 6 +- lib/rake/ext/string.rb | 42 +-- lib/rake/file_creation_task.rb | 4 +- lib/rake/file_list.rb | 12 +- lib/rake/file_task.rb | 4 +- lib/rake/file_utils.rb | 18 +- lib/rake/file_utils_ext.rb | 6 +- lib/rake/late_time.rb | 2 +- lib/rake/loaders/makefile.rb | 8 +- lib/rake/packagetask.rb | 10 +- lib/rake/phony.rb | 2 +- lib/rake/rake_module.rb | 2 +- lib/rake/rake_test_loader.rb | 2 +- lib/rake/rule_recursion_overflow_error.rb | 2 +- lib/rake/task.rb | 2 +- lib/rake/task_arguments.rb | 2 +- lib/rake/task_manager.rb | 6 +- lib/rake/tasklib.rb | 2 +- lib/rake/testtask.rb | 28 +- lib/rake/thread_history_display.rb | 2 +- lib/rake/thread_pool.rb | 4 +- lib/rake/version.rb | 4 +- lib/rake/win32.rb | 16 +- test/helper.rb | 76 +++--- test/support/rakefile_definitions.rb | 40 +-- test/test_private_reader.rb | 4 +- test/test_rake.rb | 16 +- test/test_rake_application.rb | 80 +++--- test/test_rake_application_options.rb | 136 +++++----- test/test_rake_backtrace.rb | 10 +- test/test_rake_clean.rb | 12 +- test/test_rake_cpu_counter.rb | 4 +- test/test_rake_definitions.rb | 6 +- test/test_rake_directory_task.rb | 28 +- test/test_rake_dsl.rb | 2 +- test/test_rake_early_time.rb | 2 +- test/test_rake_extension.rb | 4 +- test/test_rake_file_creation_task.rb | 6 +- test/test_rake_file_list.rb | 252 +++++++++--------- test/test_rake_file_list_path_map.rb | 8 +- test/test_rake_file_task.rb | 34 +-- test/test_rake_file_utils.rb | 72 ++--- test/test_rake_functional.rb | 48 ++-- test/test_rake_invocation_chain.rb | 4 +- test/test_rake_late_time.rb | 4 +- test/test_rake_linked_list.rb | 2 +- test/test_rake_makefile_loader.rb | 22 +- test/test_rake_multi_task.rb | 8 +- test/test_rake_name_space.rb | 6 +- test/test_rake_package_task.rb | 54 ++-- test/test_rake_path_map.rb | 2 +- test/test_rake_path_map_explode.rb | 26 +- test/test_rake_path_map_partial.rb | 2 +- test/test_rake_pathname_extensions.rb | 4 +- test/test_rake_pseudo_status.rb | 2 +- test/test_rake_rake_test_loader.rb | 10 +- test/test_rake_reduce_compat.rb | 4 +- test/test_rake_require.rb | 10 +- test/test_rake_rules.rb | 108 ++++---- test/test_rake_scope.rb | 2 +- test/test_rake_task.rb | 14 +- test/test_rake_task_argument_parsing.rb | 8 +- test/test_rake_task_arguments.rb | 36 +-- test/test_rake_task_manager.rb | 14 +- ...t_rake_task_manager_argument_resolution.rb | 2 +- test/test_rake_task_with_arguments.rb | 2 +- test/test_rake_test_task.rb | 54 ++-- test/test_rake_thread_pool.rb | 4 +- test/test_rake_top_level_functions.rb | 12 +- test/test_rake_win32.rb | 46 ++-- test/test_thread_history_display.rb | 4 +- test/test_trace_output.rb | 4 +- 82 files changed, 870 insertions(+), 869 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 6e330f411..0fe6f92e9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,8 +4,9 @@ AllCops: Exclude: - rake.gemspec -StringLiterals: - Enabled: false +Style/StringLiterals: + Enabled: true + EnforcedStyle: double_quotes SpaceAroundEqualsInParameterDefault: Enabled: false diff --git a/Gemfile b/Gemfile index fa75df156..b4e2a20bb 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ -source 'https://rubygems.org' +source "https://rubygems.org" gemspec diff --git a/Rakefile b/Rakefile index 7741400fe..e0d2ced3d 100644 --- a/Rakefile +++ b/Rakefile @@ -6,33 +6,33 @@ # This file may be distributed under an MIT style license. See # MIT-LICENSE for details. -lib = File.expand_path('../lib', __FILE__) +lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'bundler/gem_tasks' -require 'rake/testtask' -require 'rdoc/task' +require "bundler/gem_tasks" +require "rake/testtask" +require "rdoc/task" Rake::TestTask.new(:test) do |t| t.libs << "test" t.verbose = true - t.test_files = FileList['test/**/test_*.rb'] + t.test_files = FileList["test/**/test_*.rb"] end RDoc::Task.new do |doc| - doc.main = 'README.rdoc' - doc.title = 'Rake -- Ruby Make' + doc.main = "README.rdoc" + doc.title = "Rake -- Ruby Make" doc.rdoc_files = FileList.new %w[lib MIT-LICENSE doc/**/*.rdoc *.rdoc] - doc.rdoc_dir = 'html' + doc.rdoc_dir = "html" end task ghpages: :rdoc do `git checkout gh-pages` - require 'fileutils' - FileUtils.rm_rf '/tmp/html' - FileUtils.mv 'html', '/tmp' - FileUtils.rm_rf '*' - FileUtils.cp_r Dir.glob('/tmp/html/*'), '.' + require "fileutils" + FileUtils.rm_rf "/tmp/html" + FileUtils.mv "html", "/tmp" + FileUtils.rm_rf "*" + FileUtils.cp_r Dir.glob("/tmp/html/*"), "." end task default: :test diff --git a/exe/rake b/exe/rake index f1ac568c6..a00975f30 100755 --- a/exe/rake +++ b/exe/rake @@ -22,6 +22,6 @@ # IN THE SOFTWARE. #++ -require 'rake' +require "rake" Rake.application.run diff --git a/lib/rake.rb b/lib/rake.rb index a2f1b448e..ece6882c6 100644 --- a/lib/rake.rb +++ b/lib/rake.rb @@ -22,44 +22,44 @@ module Rake; end -require 'rake/version' +require "rake/version" -require 'rbconfig' -require 'fileutils' -require 'singleton' -require 'monitor' -require 'optparse' -require 'ostruct' +require "rbconfig" +require "fileutils" +require "singleton" +require "monitor" +require "optparse" +require "ostruct" -require 'rake/ext/string' -require 'rake/ext/fixnum' +require "rake/ext/string" +require "rake/ext/fixnum" -require 'rake/win32' +require "rake/win32" -require 'rake/linked_list' -require 'rake/cpu_counter' -require 'rake/scope' -require 'rake/task_argument_error' -require 'rake/rule_recursion_overflow_error' -require 'rake/rake_module' -require 'rake/trace_output' -require 'rake/pseudo_status' -require 'rake/task_arguments' -require 'rake/invocation_chain' -require 'rake/task' -require 'rake/file_task' -require 'rake/file_creation_task' -require 'rake/multi_task' -require 'rake/dsl_definition' -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' -require 'rake/backtrace' +require "rake/linked_list" +require "rake/cpu_counter" +require "rake/scope" +require "rake/task_argument_error" +require "rake/rule_recursion_overflow_error" +require "rake/rake_module" +require "rake/trace_output" +require "rake/pseudo_status" +require "rake/task_arguments" +require "rake/invocation_chain" +require "rake/task" +require "rake/file_task" +require "rake/file_creation_task" +require "rake/multi_task" +require "rake/dsl_definition" +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" +require "rake/backtrace" $trace = false diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 7e1ba9a52..464b11374 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -1,11 +1,11 @@ -require 'optparse' +require "optparse" -require 'rake/task_manager' -require 'rake/file_list' -require 'rake/thread_pool' -require 'rake/thread_history_display' -require 'rake/trace_output' -require 'rake/win32' +require "rake/task_manager" +require "rake/file_list" +require "rake/thread_pool" +require "rake/thread_history_display" +require "rake/trace_output" +require "rake/win32" module Rake @@ -38,16 +38,16 @@ class Application attr_writer :tty_output DEFAULT_RAKEFILES = [ - 'rakefile', - 'Rakefile', - 'rakefile.rb', - 'Rakefile.rb' + "rakefile", + "Rakefile", + "rakefile.rb", + "Rakefile.rb" ].freeze # Initialize a Rake::Application object. def initialize super - @name = 'rake' + @name = "rake" @rakefiles = DEFAULT_RAKEFILES.dup @rakefile = nil @pending_imports = [] @@ -56,11 +56,11 @@ def initialize @default_loader = Rake::DefaultLoader.new @original_dir = Dir.pwd @top_level_tasks = [] - add_loader('rb', DefaultLoader.new) - add_loader('rf', DefaultLoader.new) - add_loader('rake', DefaultLoader.new) + add_loader("rb", DefaultLoader.new) + add_loader("rf", DefaultLoader.new) + add_loader("rake", DefaultLoader.new) @tty_output = STDOUT.tty? - @terminal_columns = ENV['RAKE_COLUMNS'].to_i + @terminal_columns = ENV["RAKE_COLUMNS"].to_i end # Run the Rake application. The run method performs the following @@ -82,7 +82,7 @@ def run end # Initialize the command line parameters and app name. - def init(app_name='rake') + def init(app_name="rake") standard_exception_handling do @name = app_name args = handle_options @@ -259,7 +259,7 @@ def have_rakefile # :nodoc: if File.exist?(fn) others = FileList.glob(fn, File::FNM_CASEFOLD) return others.size == 1 ? others.first : fn - elsif fn == '' + elsif fn == "" return fn end end @@ -342,7 +342,7 @@ def dynamic_width_tput # :nodoc: end def unix? # :nodoc: - RbConfig::CONFIG['host_os'] =~ + RbConfig::CONFIG["host_os"] =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i end @@ -385,38 +385,38 @@ def sort_options(options) # :nodoc: def standard_rake_options # :nodoc: sort_options( [ - ['--all', '-A', + ["--all", "-A", "Show all tasks, even uncommented ones (in combination with -T or -D)", lambda { |value| options.show_all_tasks = value } ], - ['--backtrace=[OUT]', + ["--backtrace=[OUT]", "Enable full backtrace. OUT can be stderr (default) or stdout.", lambda { |value| options.backtrace = true - select_trace_output(options, 'backtrace', value) + select_trace_output(options, "backtrace", value) } ], - ['--build-all', '-B', + ["--build-all", "-B", "Build all prerequisites, including those which are up-to-date.", lambda { |value| options.build_all = true } ], - ['--comments', + ["--comments", "Show commented tasks only", lambda { |value| options.show_all_tasks = !value } ], - ['--describe', '-D [PATTERN]', + ["--describe", "-D [PATTERN]", "Describe the tasks (matching optional PATTERN), then exit.", lambda { |value| select_tasks_to_show(options, :describe, value) } ], - ['--dry-run', '-n', + ["--dry-run", "-n", "Do a dry run without executing actions.", lambda { |value| Rake.verbose(true) @@ -425,30 +425,30 @@ def standard_rake_options # :nodoc: options.trace = true } ], - ['--execute', '-e CODE', + ["--execute", "-e CODE", "Execute some Ruby code and exit.", lambda { |value| eval(value) exit } ], - ['--execute-print', '-p CODE', + ["--execute-print", "-p CODE", "Execute some Ruby code, print the result, then exit.", lambda { |value| puts eval(value) exit } ], - ['--execute-continue', '-E CODE', + ["--execute-continue", "-E CODE", "Execute some Ruby code, " + "then continue with normal task processing.", lambda { |value| eval(value) } ], - ['--jobs', '-j [NUMBER]', + ["--jobs", "-j [NUMBER]", "Specifies the maximum number of tasks to execute in parallel. " + "(default is number of CPU cores + 4)", lambda { |value| - if value.nil? || value == '' + if value.nil? || value == "" value = Fixnum::MAX elsif value =~ /^\d+$/ value = value.to_i @@ -459,7 +459,7 @@ def standard_rake_options # :nodoc: options.thread_pool_size = value - 1 } ], - ['--job-stats [LEVEL]', + ["--job-stats [LEVEL]", "Display job statistics. " + "LEVEL=history displays a complete job list", lambda { |value| @@ -470,42 +470,42 @@ def standard_rake_options # :nodoc: end } ], - ['--libdir', '-I LIBDIR', + ["--libdir", "-I LIBDIR", "Include LIBDIR in the search path for required modules.", lambda { |value| $:.push(value) } ], - ['--multitask', '-m', + ["--multitask", "-m", "Treat all tasks as multitasks.", lambda { |value| options.always_multitask = true } ], - ['--no-search', '--nosearch', - '-N', "Do not search parent directories for the Rakefile.", + ["--no-search", "--nosearch", + "-N", "Do not search parent directories for the Rakefile.", lambda { |value| options.nosearch = true } ], - ['--prereqs', '-P', + ["--prereqs", "-P", "Display the tasks and dependencies, then exit.", lambda { |value| options.show_prereqs = true } ], - ['--quiet', '-q', + ["--quiet", "-q", "Do not log messages to standard output.", lambda { |value| Rake.verbose(false) } ], - ['--rakefile', '-f [FILENAME]', + ["--rakefile", "-f [FILENAME]", "Use FILENAME as the rakefile to search for.", lambda { |value| - value ||= '' + value ||= "" @rakefiles.clear @rakefiles << value } ], - ['--rakelibdir', '--rakelib', '-R RAKELIBDIR', + ["--rakelibdir", "--rakelib", "-R RAKELIBDIR", "Auto-import any .rake files in RAKELIBDIR. " + "(default is 'rakelib')", lambda { |value| options.rakelib = value.split(File::PATH_SEPARATOR) } ], - ['--require', '-r MODULE', + ["--require", "-r MODULE", "Require MODULE before executing rakefile.", lambda { |value| begin @@ -519,11 +519,11 @@ def standard_rake_options # :nodoc: end } ], - ['--rules', + ["--rules", "Trace the rules resolution.", lambda { |value| options.trace_rules = true } ], - ['--silent', '-s', + ["--silent", "-s", "Like --quiet, but also suppresses the " + "'in directory' announcement.", lambda { |value| @@ -531,24 +531,24 @@ def standard_rake_options # :nodoc: options.silent = true } ], - ['--suppress-backtrace PATTERN', + ["--suppress-backtrace PATTERN", "Suppress backtrace lines matching regexp PATTERN. " + "Ignored if --trace is on.", lambda { |value| options.suppress_backtrace_pattern = Regexp.new(value) } ], - ['--system', '-g', + ["--system", "-g", "Using system wide (global) rakefiles " + "(usually '~/.rake/*.rake').", lambda { |value| options.load_system = true } ], - ['--no-system', '--nosystem', '-G', + ["--no-system", "--nosystem", "-G", "Use standard project Rakefile search paths, " + "ignore system wide rakefiles.", lambda { |value| options.ignore_system = true } ], - ['--tasks', '-T [PATTERN]', + ["--tasks", "-T [PATTERN]", "Display the tasks (matching optional PATTERN) " + "with descriptions, then exit. " + "-AT combination displays all of tasks contained no description.", @@ -556,35 +556,35 @@ def standard_rake_options # :nodoc: select_tasks_to_show(options, :tasks, value) } ], - ['--trace=[OUT]', '-t', + ["--trace=[OUT]", "-t", "Turn on invoke/execute tracing, enable full backtrace. " + "OUT can be stderr (default) or stdout.", lambda { |value| options.trace = true options.backtrace = true - select_trace_output(options, 'trace', value) + select_trace_output(options, "trace", value) Rake.verbose(true) } ], - ['--verbose', '-v', + ["--verbose", "-v", "Log message to standard output.", lambda { |value| Rake.verbose(true) } ], - ['--version', '-V', + ["--version", "-V", "Display the program version.", lambda { |value| puts "rake, version #{Rake::VERSION}" exit } ], - ['--where', '-W [PATTERN]', + ["--where", "-W [PATTERN]", "Describe the tasks (matching optional PATTERN), then exit.", lambda { |value| select_tasks_to_show(options, :lines, value) options.show_all_tasks = true } ], - ['--no-deprecation-warnings', '-X', + ["--no-deprecation-warnings", "-X", "Disable the deprecation warnings.", lambda { |value| options.ignore_deprecate = true @@ -595,7 +595,7 @@ def standard_rake_options # :nodoc: def select_tasks_to_show(options, show_tasks, value) # :nodoc: options.show_tasks = show_tasks - options.show_task_pattern = Regexp.new(value || '') + options.show_task_pattern = Regexp.new(value || "") Rake::TaskManager.record_task_metadata = true end private :select_tasks_to_show @@ -603,9 +603,9 @@ def select_tasks_to_show(options, show_tasks, value) # :nodoc: def select_trace_output(options, trace_option, value) # :nodoc: value = value.strip unless value.nil? case value - when 'stdout' + when "stdout" options.trace_output = $stdout - when 'stderr', nil + when "stderr", nil options.trace_output = $stderr else fail CommandLineOptionError, @@ -618,7 +618,7 @@ def select_trace_output(options, trace_option, value) # :nodoc: # 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.rakelib = ["rakelib"] options.trace_output = $stderr OptionParser.new do |opts| @@ -632,7 +632,7 @@ def handle_options # :nodoc: end standard_rake_options.each { |args| opts.on(*args) } - opts.environment('RAKEOPT') + opts.environment("RAKEOPT") end.parse(ARGV) end @@ -685,7 +685,7 @@ def raw_load_rakefile # :nodoc: Dir.chdir(location) print_rakefile_directory(location) Rake.load_rakefile(File.expand_path(@rakefile)) if - @rakefile && @rakefile != '' + @rakefile && @rakefile != "" options.rakelib.each do |rlib| glob("#{rlib}/*.rake") do |name| add_import name @@ -696,7 +696,7 @@ def raw_load_rakefile # :nodoc: end def glob(path, &block) # :nodoc: - FileList.glob(path.tr("\\", '/')).each(&block) + FileList.glob(path.tr("\\", "/")).each(&block) end private :glob @@ -704,8 +704,8 @@ def glob(path, &block) # :nodoc: def system_dir # :nodoc: @system_dir ||= begin - if ENV['RAKE_SYSTEM'] - ENV['RAKE_SYSTEM'] + if ENV["RAKE_SYSTEM"] + ENV["RAKE_SYSTEM"] else standard_system_dir end @@ -719,7 +719,7 @@ def standard_system_dir #:nodoc: end else def standard_system_dir #:nodoc: - File.join(File.expand_path('~'), '.rake') + File.join(File.expand_path("~"), ".rake") end end private :standard_system_dir @@ -778,7 +778,7 @@ def rakefile_location(backtrace=caller) # :nodoc: re = /^#{@rakefile}$/ re = /#{re.source}/i if windows? - backtrace.find { |str| str =~ re } || '' + backtrace.find { |str| str =~ re } || "" end end diff --git a/lib/rake/backtrace.rb b/lib/rake/backtrace.rb index 9edf33ef1..a89dd9f4d 100644 --- a/lib/rake/backtrace.rb +++ b/lib/rake/backtrace.rb @@ -10,7 +10,7 @@ module Backtrace # :nodoc: all reject { |s| s.nil? || s =~ /^ *$/ } SUPPRESSED_PATHS_RE = SUPPRESSED_PATHS.map { |f| Regexp.quote(f) }.join("|") SUPPRESSED_PATHS_RE << "|^org\\/jruby\\/\\w+\\.java" if - Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby' + Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == "jruby" SUPPRESS_PATTERN = %r!(\A(#{SUPPRESSED_PATHS_RE})|bin/rake:\d+)!i diff --git a/lib/rake/clean.rb b/lib/rake/clean.rb index a2375aa99..1e5da81cb 100644 --- a/lib/rake/clean.rb +++ b/lib/rake/clean.rb @@ -11,7 +11,7 @@ # The intent of this task is to return a project to its # pristine, just unpacked state. -require 'rake' +require "rake" # :stopdoc: @@ -60,7 +60,7 @@ def cant_be_deleted?(path_name) CLEAN = ::Rake::FileList["**/*~", "**/*.bak", "**/core"] CLEAN.clear_exclude.exclude { |fn| - fn.pathmap("%f").downcase == 'core' && File.directory?(fn) + fn.pathmap("%f").downcase == "core" && File.directory?(fn) } desc "Remove any temporary products." diff --git a/lib/rake/cpu_counter.rb b/lib/rake/cpu_counter.rb index fc8848a5d..82a5eb8aa 100644 --- a/lib/rake/cpu_counter.rb +++ b/lib/rake/cpu_counter.rb @@ -14,7 +14,7 @@ def count_with_default(default=4) end begin - require 'etc' + require "etc" rescue LoadError else if Etc.respond_to?(:nprocessors) diff --git a/lib/rake/dsl_definition.rb b/lib/rake/dsl_definition.rb index 340cb580a..c52bd601f 100644 --- a/lib/rake/dsl_definition.rb +++ b/lib/rake/dsl_definition.rb @@ -1,5 +1,5 @@ # Rake DSL functions. -require 'rake/file_utils_ext' +require "rake/file_utils_ext" module Rake diff --git a/lib/rake/ext/pathname.rb b/lib/rake/ext/pathname.rb index 49e2cd47a..30130cd1a 100644 --- a/lib/rake/ext/pathname.rb +++ b/lib/rake/ext/pathname.rb @@ -1,5 +1,5 @@ -require 'rake/ext/core' -require 'pathname' +require "rake/ext/core" +require "pathname" class Pathname @@ -7,7 +7,7 @@ class Pathname # Return a new Pathname with String#ext applied to it. # # This Pathname extension comes from Rake - def ext(newext='') + def ext(newext="") Pathname.new(Rake.from_pathname(self).ext(newext)) end end diff --git a/lib/rake/ext/string.rb b/lib/rake/ext/string.rb index f212223e4..37764c845 100644 --- a/lib/rake/ext/string.rb +++ b/lib/rake/ext/string.rb @@ -1,4 +1,4 @@ -require 'rake/ext/core' +require "rake/ext/core" class String @@ -10,9 +10,9 @@ class String # +ext+ is a user added method for the String class. # # This String extension comes from Rake - def ext(newext='') - return self.dup if ['.', '..'].include? self - if newext != '' + def ext(newext="") + return self.dup if [".", ".."].include? self + if newext != "" newext = "." + newext unless newext =~ /^\./ end self.chomp(File.extname(self)) << newext @@ -26,8 +26,8 @@ def ext(newext='') def pathmap_explode head, tail = File.split(self) return [self] if head == self - return [tail] if head == '.' || tail == '/' - return [head, tail] if head == '/' + return [tail] if head == "." || tail == "/" + return [head, tail] if head == "/" return head.pathmap_explode + [tail] end protected :pathmap_explode @@ -57,15 +57,15 @@ def pathmap_partial(n) # This String extension comes from Rake def pathmap_replace(patterns, &block) result = self - patterns.split(';').each do |pair| - pattern, replacement = pair.split(',') + patterns.split(";").each do |pair| + pattern, replacement = pair.split(",") pattern = Regexp.new(pattern) - if replacement == '*' && block_given? + if replacement == "*" && block_given? result = result.sub(pattern, &block) elsif replacement result = result.sub(pattern, replacement) else - result = result.sub(pattern, '') + result = result.sub(pattern, "") end end result @@ -136,32 +136,32 @@ def pathmap_replace(patterns, &block) # This String extension comes from Rake def pathmap(spec=nil, &block) return self if spec.nil? - result = '' + result = "" spec.scan(/%\{[^}]*\}-?\d*[sdpfnxX%]|%-?\d+d|%.|[^%]+/) do |frag| case frag - when '%f' + when "%f" result << File.basename(self) - when '%n' + when "%n" result << File.basename(self).ext - when '%d' + when "%d" result << File.dirname(self) - when '%x' + when "%x" result << File.extname(self) - when '%X' + when "%X" result << self.ext - when '%p' + when "%p" result << self - when '%s' + when "%s" result << (File::ALT_SEPARATOR || File::SEPARATOR) - when '%-' + when "%-" # do nothing - when '%%' + when "%%" result << "%" when /%(-?\d+)d/ result << pathmap_partial($1.to_i) when /^%\{([^}]*)\}(\d*[dpfnxX])/ patterns, operator = $1, $2 - result << pathmap('%' + operator).pathmap_replace(patterns, &block) + result << pathmap("%" + operator).pathmap_replace(patterns, &block) when /^%/ fail ArgumentError, "Unknown pathmap specifier #{frag} in '#{spec}'" else diff --git a/lib/rake/file_creation_task.rb b/lib/rake/file_creation_task.rb index c87e2192b..f3c5c78a1 100644 --- a/lib/rake/file_creation_task.rb +++ b/lib/rake/file_creation_task.rb @@ -1,5 +1,5 @@ -require 'rake/file_task' -require 'rake/early_time' +require "rake/file_task" +require "rake/early_time" module Rake diff --git a/lib/rake/file_list.rb b/lib/rake/file_list.rb index 3b1239ad9..a30c6338c 100644 --- a/lib/rake/file_list.rb +++ b/lib/rake/file_list.rb @@ -1,6 +1,6 @@ -require 'rake/cloneable' -require 'rake/file_utils_ext' -require 'rake/ext/string' +require "rake/cloneable" +require "rake/file_utils_ext" +require "rake/ext/string" module Rake @@ -280,7 +280,7 @@ def pathmap(spec=nil, &block) # array.collect { |item| item.ext(newext) } # # +ext+ is a user added method for the Array class. - def ext(newext='') + def ext(newext="") collect { |fn| fn.ext(newext) } end @@ -342,7 +342,7 @@ def partition(&block) # :nodoc: # Convert a FileList to a string by joining all elements with a space. def to_s resolve - self.join(' ') + self.join(" ") end # Add matching glob patterns. @@ -416,7 +416,7 @@ class << self # Yield each file or directory component. def each_dir_parent(dir) # :nodoc: old_length = nil - while dir != '.' && dir.length != old_length + while dir != "." && dir.length != old_length yield(dir) old_length = dir.length dir = File.dirname(dir) diff --git a/lib/rake/file_task.rb b/lib/rake/file_task.rb index 4c9b04074..6656e7095 100644 --- a/lib/rake/file_task.rb +++ b/lib/rake/file_task.rb @@ -1,5 +1,5 @@ -require 'rake/task.rb' -require 'rake/early_time' +require "rake/task.rb" +require "rake/early_time" module Rake diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb index 14cb092fc..6bb41940d 100644 --- a/lib/rake/file_utils.rb +++ b/lib/rake/file_utils.rb @@ -1,18 +1,18 @@ -require 'rbconfig' -require 'fileutils' +require "rbconfig" +require "fileutils" #-- # This a FileUtils extension that defines several additional commands to be # added to the FileUtils utility functions. module FileUtils # Path to the currently running Ruby program - RUBY = ENV['RUBY'] || File.join( - RbConfig::CONFIG['bindir'], - RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']). + RUBY = ENV["RUBY"] || File.join( + RbConfig::CONFIG["bindir"], + RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]). sub(/.*\s.*/m, '"\&"') - OPT_TABLE['sh'] = %w(noop verbose) - OPT_TABLE['ruby'] = %w(noop verbose) + OPT_TABLE["sh"] = %w(noop verbose) + OPT_TABLE["ruby"] = %w(noop verbose) # Run the system command +cmd+. If multiple arguments are given the command # is run directly (without the shell, same semantics as Kernel::exec and @@ -132,8 +132,8 @@ def safe_ln(*args) # def split_all(path) head, tail = File.split(path) - return [tail] if head == '.' || tail == '/' - return [head, tail] if head == '/' + return [tail] if head == "." || tail == "/" + return [head, tail] if head == "/" return split_all(head) + [tail] end end diff --git a/lib/rake/file_utils_ext.rb b/lib/rake/file_utils_ext.rb index 309159aec..e5930d4ab 100644 --- a/lib/rake/file_utils_ext.rb +++ b/lib/rake/file_utils_ext.rb @@ -1,4 +1,4 @@ -require 'rake/file_utils' +require "rake/file_utils" module Rake # @@ -22,10 +22,10 @@ class << self opts = FileUtils.options_of name default_options = [] if opts.include?("verbose") - default_options << ':verbose => FileUtilsExt.verbose_flag' + default_options << ":verbose => FileUtilsExt.verbose_flag" end if opts.include?("noop") - default_options << ':noop => FileUtilsExt.nowrite_flag' + default_options << ":noop => FileUtilsExt.nowrite_flag" end next if default_options.empty? diff --git a/lib/rake/late_time.rb b/lib/rake/late_time.rb index d959a7821..d1d9470ec 100644 --- a/lib/rake/late_time.rb +++ b/lib/rake/late_time.rb @@ -9,7 +9,7 @@ def <=>(other) end def to_s - '' + "" end end diff --git a/lib/rake/loaders/makefile.rb b/lib/rake/loaders/makefile.rb index 2c4b2632a..d0436bb79 100644 --- a/lib/rake/loaders/makefile.rb +++ b/lib/rake/loaders/makefile.rb @@ -24,7 +24,7 @@ def load(fn) # :nodoc: lines = File.read fn lines.gsub!(/\\ /, SPACE_MARK) lines.gsub!(/#[^\n]*\n/m, "") - lines.gsub!(/\\\n/, ' ') + lines.gsub!(/\\\n/, " ") lines.each_line do |line| process_line(line) end @@ -34,7 +34,7 @@ def load(fn) # :nodoc: # Process one logical line of makefile data. def process_line(line) # :nodoc: - file_tasks, args = line.split(':', 2) + file_tasks, args = line.split(":", 2) return if args.nil? dependents = args.split.map { |d| respace(d) } file_tasks.scan(/\S+/) do |file_task| @@ -44,10 +44,10 @@ def process_line(line) # :nodoc: end def respace(str) # :nodoc: - str.tr SPACE_MARK, ' ' + str.tr SPACE_MARK, " " end end # Install the handler - Rake.application.add_loader('mf', MakefileLoader.new) + Rake.application.add_loader("mf", MakefileLoader.new) end diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb index ae7151949..034b8e9e8 100644 --- a/lib/rake/packagetask.rb +++ b/lib/rake/packagetask.rb @@ -1,8 +1,8 @@ # Define a package task library to aid in the definition of # redistributable package files. -require 'rake' -require 'rake/tasklib' +require "rake" +require "rake/tasklib" module Rake @@ -93,14 +93,14 @@ def init(name, version) @name = name @version = version @package_files = Rake::FileList.new - @package_dir = 'pkg' + @package_dir = "pkg" @need_tar = false @need_tar_gz = false @need_tar_bz2 = false @need_tar_xz = false @need_zip = false - @tar_command = 'tar' - @zip_command = 'zip' + @tar_command = "tar" + @zip_command = "zip" end # Create the tasks defined by this task library. diff --git a/lib/rake/phony.rb b/lib/rake/phony.rb index 29633ae06..a172f9c60 100644 --- a/lib/rake/phony.rb +++ b/lib/rake/phony.rb @@ -4,7 +4,7 @@ # # See FileTask#out_of_date? and Task#timestamp for more info. -require 'rake' +require "rake" task :phony diff --git a/lib/rake/rake_module.rb b/lib/rake/rake_module.rb index 369275343..75feb1261 100644 --- a/lib/rake/rake_module.rb +++ b/lib/rake/rake_module.rb @@ -1,4 +1,4 @@ -require 'rake/application' +require "rake/application" module Rake diff --git a/lib/rake/rake_test_loader.rb b/lib/rake/rake_test_loader.rb index bc4e1751e..d299efe35 100644 --- a/lib/rake/rake_test_loader.rb +++ b/lib/rake/rake_test_loader.rb @@ -1,4 +1,4 @@ -require 'rake' +require "rake" # Load the test files from the command line. argv = ARGV.select do |argument| diff --git a/lib/rake/rule_recursion_overflow_error.rb b/lib/rake/rule_recursion_overflow_error.rb index b71e08efb..39d44aac6 100644 --- a/lib/rake/rule_recursion_overflow_error.rb +++ b/lib/rake/rule_recursion_overflow_error.rb @@ -12,7 +12,7 @@ def add_target(target) end def message - super + ": [" + @targets.reverse.join(' => ') + "]" + super + ": [" + @targets.reverse.join(" => ") + "]" end end diff --git a/lib/rake/task.rb b/lib/rake/task.rb index b1356ed89..18c09eefd 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -1,4 +1,4 @@ -require 'rake/invocation_exception_mixin' +require "rake/invocation_exception_mixin" module Rake diff --git a/lib/rake/task_arguments.rb b/lib/rake/task_arguments.rb index 4eaf2f8b9..7d6275f44 100644 --- a/lib/rake/task_arguments.rb +++ b/lib/rake/task_arguments.rb @@ -17,7 +17,7 @@ def initialize(names, values, parent=nil) @hash = {} @values = values names.each_with_index { |name, i| - next if values[i].nil? || values[i] == '' + next if values[i].nil? || values[i] == "" @hash[name.to_sym] = values[i] } end diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index 202a8a688..960d70654 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -15,7 +15,7 @@ def initialize # :nodoc: def create_rule(*args, &block) # :nodoc: pattern, args, deps = resolve_args(args) - pattern = Regexp.new(Regexp.quote(pattern) + '$') if String === pattern + pattern = Regexp.new(Regexp.quote(pattern) + "$") if String === pattern @rules << [pattern, args, deps, block] end @@ -167,10 +167,10 @@ def lookup(task_name, initial_scope=nil) task_name = task_name.to_s if task_name =~ /^rake:/ scopes = Scope.make - task_name = task_name.sub(/^rake:/, '') + task_name = task_name.sub(/^rake:/, "") elsif task_name =~ /^(\^+)/ scopes = initial_scope.trim($1.size) - task_name = task_name.sub(/^(\^+)/, '') + task_name = task_name.sub(/^(\^+)/, "") else scopes = initial_scope end diff --git a/lib/rake/tasklib.rb b/lib/rake/tasklib.rb index b65ae7a6c..7bcda1789 100644 --- a/lib/rake/tasklib.rb +++ b/lib/rake/tasklib.rb @@ -1,4 +1,4 @@ -require 'rake' +require "rake" module Rake diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index cf9855147..4fb871e46 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -1,5 +1,5 @@ -require 'rake' -require 'rake/tasklib' +require "rake" +require "rake/tasklib" module Rake @@ -98,7 +98,7 @@ def initialize(name=:test) @name = @name.keys.first end yield self if block_given? - @pattern = 'test/test*.rb' if @pattern.nil? && @test_files.nil? + @pattern = "test/test*.rb" if @pattern.nil? && @test_files.nil? define end @@ -108,7 +108,7 @@ def define task @name => Array(deps) do FileUtilsExt.verbose(@verbose) do puts "Use TESTOPTS=\"--verbose\" to pass --verbose" \ - ", etc. to runners." if ARGV.include? '--verbose' + ", etc. to runners." if ARGV.include? "--verbose" args = "#{ruby_opts_string} #{run_code} " + "#{file_list_string} #{option_list}" @@ -126,10 +126,10 @@ def define end def option_list # :nodoc: - (ENV['TESTOPTS'] || - ENV['TESTOPT'] || - ENV['TEST_OPTS'] || - ENV['TEST_OPT'] || + (ENV["TESTOPTS"] || + ENV["TESTOPT"] || + ENV["TEST_OPTS"] || + ENV["TEST_OPT"] || @options || "") end @@ -146,12 +146,12 @@ def lib_path # :nodoc: end def file_list_string # :nodoc: - file_list.map { |fn| "\"#{fn}\"" }.join(' ') + file_list.map { |fn| "\"#{fn}\"" }.join(" ") end def file_list # :nodoc: - if ENV['TEST'] - FileList[ENV['TEST']] + if ENV["TEST"] + FileList[ENV["TEST"]] else result = [] result += @test_files.to_a if @test_files @@ -176,7 +176,7 @@ def run_code # :nodoc: end def rake_loader # :nodoc: - find_file('rake/rake_test_loader') or + find_file("rake/rake_test_loader") or fail "unable to find rake test loader" end @@ -189,7 +189,7 @@ def find_file(fn) # :nodoc: end def rake_include_arg # :nodoc: - spec = Gem.loaded_specs['rake'] + spec = Gem.loaded_specs["rake"] if spec.respond_to?(:default_gem?) && spec.default_gem? "" else @@ -198,7 +198,7 @@ def rake_include_arg # :nodoc: end def rake_lib_dir # :nodoc: - find_dir('rake') or + find_dir("rake") or fail "unable to find rake lib" end diff --git a/lib/rake/thread_history_display.rb b/lib/rake/thread_history_display.rb index a8158caf6..04273541e 100644 --- a/lib/rake/thread_history_display.rb +++ b/lib/rake/thread_history_display.rb @@ -1,4 +1,4 @@ -require 'rake/private_reader' +require "rake/private_reader" module Rake diff --git a/lib/rake/thread_pool.rb b/lib/rake/thread_pool.rb index 91628259b..370caa18c 100644 --- a/lib/rake/thread_pool.rb +++ b/lib/rake/thread_pool.rb @@ -1,6 +1,6 @@ -require 'set' +require "set" -require 'rake/promise' +require "rake/promise" module Rake diff --git a/lib/rake/version.rb b/lib/rake/version.rb index c9660a45e..636c5cea1 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,8 +1,8 @@ module Rake - VERSION = '11.2.2' + VERSION = "11.2.2" module Version # :nodoc: all - MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split '.' + MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "." NUMBERS = [MAJOR, MINOR, BUILD, *OTHER] end diff --git a/lib/rake/win32.rb b/lib/rake/win32.rb index cf497a43d..1fc02a5ae 100644 --- a/lib/rake/win32.rb +++ b/lib/rake/win32.rb @@ -1,4 +1,4 @@ -require 'rbconfig' +require "rbconfig" module Rake # Win 32 interface methods for Rake. Windows specific functionality @@ -27,22 +27,22 @@ def windows? # # If the above are not defined, the return nil. def win32_system_dir #:nodoc: - win32_shared_path = ENV['HOME'] - if win32_shared_path.nil? && ENV['HOMEDRIVE'] && ENV['HOMEPATH'] - win32_shared_path = ENV['HOMEDRIVE'] + ENV['HOMEPATH'] + win32_shared_path = ENV["HOME"] + if win32_shared_path.nil? && ENV["HOMEDRIVE"] && ENV["HOMEPATH"] + win32_shared_path = ENV["HOMEDRIVE"] + ENV["HOMEPATH"] end - win32_shared_path ||= ENV['APPDATA'] - win32_shared_path ||= ENV['USERPROFILE'] + win32_shared_path ||= ENV["APPDATA"] + win32_shared_path ||= ENV["USERPROFILE"] raise Win32HomeError, "Unable to determine home path environment variable." if win32_shared_path.nil? or win32_shared_path.empty? - normalize(File.join(win32_shared_path, 'Rake')) + normalize(File.join(win32_shared_path, "Rake")) end # Normalize a win32 path so that the slashes are all forward slashes. def normalize(path) - path.gsub(/\\/, '/') + path.gsub(/\\/, "/") end end diff --git a/test/helper.rb b/test/helper.rb index f8f1fe106..7736da72f 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,13 +1,13 @@ -$:.unshift File.expand_path('../../lib', __FILE__) +$:.unshift File.expand_path("../../lib", __FILE__) -gem 'minitest', '~> 5' -require 'minitest/autorun' -require 'rake' -require 'tmpdir' +gem "minitest", "~> 5" +require "minitest/autorun" +require "rake" +require "tmpdir" -require_relative 'support/file_creation' -require_relative 'support/ruby_runner' -require_relative 'support/rakefile_definitions' +require_relative "support/file_creation" +require_relative "support/ruby_runner" +require_relative "support/rakefile_definitions" class Rake::TestCase < Minitest::Test include FileCreation @@ -23,25 +23,25 @@ class TaskManager def setup ARGV.clear - @verbose = ENV['VERBOSE'] + @verbose = ENV["VERBOSE"] - @rake_root = File.expand_path '../../', __FILE__ - @rake_exec = File.join @rake_root, 'exe', 'rake' - @rake_lib = File.join @rake_root, 'lib' + @rake_root = File.expand_path "../../", __FILE__ + @rake_exec = File.join @rake_root, "exe", "rake" + @rake_lib = File.join @rake_root, "lib" @ruby_options = ["-I#{@rake_lib}", "-I."] @orig_pwd = Dir.pwd - @orig_appdata = ENV['APPDATA'] - @orig_home = ENV['HOME'] - @orig_homedrive = ENV['HOMEDRIVE'] - @orig_homepath = ENV['HOMEPATH'] - @orig_rake_columns = ENV['RAKE_COLUMNS'] - @orig_rake_system = ENV['RAKE_SYSTEM'] - @orig_rakeopt = ENV['RAKEOPT'] - @orig_userprofile = ENV['USERPROFILE'] - ENV.delete 'RAKE_COLUMNS' - ENV.delete 'RAKE_SYSTEM' - ENV.delete 'RAKEOPT' + @orig_appdata = ENV["APPDATA"] + @orig_home = ENV["HOME"] + @orig_homedrive = ENV["HOMEDRIVE"] + @orig_homepath = ENV["HOMEPATH"] + @orig_rake_columns = ENV["RAKE_COLUMNS"] + @orig_rake_system = ENV["RAKE_SYSTEM"] + @orig_rakeopt = ENV["RAKEOPT"] + @orig_userprofile = ENV["USERPROFILE"] + ENV.delete "RAKE_COLUMNS" + ENV.delete "RAKE_SYSTEM" + ENV.delete "RAKEOPT" tmpdir = Dir.chdir Dir.tmpdir do Dir.pwd end @tempdir = File.join tmpdir, "test_rake_#{$$}" @@ -60,18 +60,18 @@ def teardown FileUtils.rm_rf @tempdir if @orig_appdata - ENV['APPDATA'] = @orig_appdata + ENV["APPDATA"] = @orig_appdata else - ENV.delete 'APPDATA' + ENV.delete "APPDATA" end - ENV['HOME'] = @orig_home - ENV['HOMEDRIVE'] = @orig_homedrive - ENV['HOMEPATH'] = @orig_homepath - ENV['RAKE_COLUMNS'] = @orig_rake_columns - ENV['RAKE_SYSTEM'] = @orig_rake_system - ENV['RAKEOPT'] = @orig_rakeopt - ENV['USERPROFILE'] = @orig_userprofile + ENV["HOME"] = @orig_home + ENV["HOMEDRIVE"] = @orig_homedrive + ENV["HOMEPATH"] = @orig_homepath + ENV["RAKE_COLUMNS"] = @orig_rake_columns + ENV["RAKE_SYSTEM"] = @orig_rake_system + ENV["RAKEOPT"] = @orig_rakeopt + ENV["USERPROFILE"] = @orig_userprofile end def ignore_deprecations @@ -82,11 +82,11 @@ def ignore_deprecations end def rake_system_dir - @system_dir = 'system' + @system_dir = "system" FileUtils.mkdir_p @system_dir - open File.join(@system_dir, 'sys1.rake'), 'w' do |io| + open File.join(@system_dir, "sys1.rake"), "w" do |io| io << <<-SYS task "sys1" do puts "SYS1" @@ -94,11 +94,11 @@ def rake_system_dir SYS end - ENV['RAKE_SYSTEM'] = @system_dir + ENV["RAKE_SYSTEM"] = @system_dir end def rakefile(contents) - open 'Rakefile', 'w' do |io| + open "Rakefile", "w" do |io| io << contents end end @@ -108,11 +108,11 @@ def jruby? end def jruby17? - jruby? && (JRUBY_VERSION < '9.0.0.0') + jruby? && (JRUBY_VERSION < "9.0.0.0") end def jruby9? - jruby? && (JRUBY_VERSION >= '9.0.0.0') + jruby? && (JRUBY_VERSION >= "9.0.0.0") end include RakefileDefinitions diff --git a/test/support/rakefile_definitions.rb b/test/support/rakefile_definitions.rb index 82eae11ec..e0af05a67 100644 --- a/test/support/rakefile_definitions.rb +++ b/test/support/rakefile_definitions.rb @@ -158,16 +158,16 @@ def rakefile_dryrun end DRYRUN - FileUtils.touch 'temp_main' - FileUtils.touch 'temp_two' + FileUtils.touch "temp_main" + FileUtils.touch "temp_two" end def rakefile_extra - rakefile 'task :default' + rakefile "task :default" - FileUtils.mkdir_p 'rakelib' + FileUtils.mkdir_p "rakelib" - open File.join('rakelib', 'extra.rake'), 'w' do |io| + open File.join("rakelib", "extra.rake"), "w" do |io| io << <<-EXTRA_RAKE # Added for testing @@ -236,7 +236,7 @@ def rakefile_imports puts "FIRST" IMPORTS - open 'deps.mf', 'w' do |io| + open "deps.mf", "w" do |io| io << <<-DEPS default: other DEPS @@ -361,14 +361,14 @@ def rakefile_namespace end def rakefile_nosearch - FileUtils.touch 'dummy' + FileUtils.touch "dummy" end def rakefile_rakelib - FileUtils.mkdir_p 'rakelib' + FileUtils.mkdir_p "rakelib" - Dir.chdir 'rakelib' do - open 'test1.rb', 'w' do |io| + Dir.chdir "rakelib" do + open "test1.rb", "w" do |io| io << <<-TEST1 task :default do puts "TEST1" @@ -376,7 +376,7 @@ def rakefile_rakelib TEST1 end - open 'test2.rake', 'w' do |io| + open "test2.rake", "w" do |io| io << <<-TEST1 task :default do puts "TEST2" @@ -387,15 +387,15 @@ def rakefile_rakelib end def rakefile_rbext - open 'rakefile.rb', 'w' do |io| + open "rakefile.rb", "w" do |io| io << 'task :default do puts "OK" end' end end def rakefile_unittest - rakefile '# Empty Rakefile for Unit Test' + rakefile "# Empty Rakefile for Unit Test" - readme = File.join 'subdir', 'README' + readme = File.join "subdir", "README" FileUtils.mkdir_p File.dirname readme FileUtils.touch readme @@ -458,14 +458,14 @@ def rakefile_test_signal task :default => :test TEST_SIGNAL - open 'a_test.rb', 'w' do |io| + open "a_test.rb", "w" do |io| io << 'puts "ATEST"' << "\n" - io << '$stdout.flush' << "\n" + io << "$stdout.flush" << "\n" io << 'Process.kill("TERM", $$)' << "\n" end - open 'b_test.rb', 'w' do |io| + open "b_test.rb", "w" do |io| io << 'puts "BTEST"' << "\n" - io << '$stdout.flush' << "\n" + io << "$stdout.flush" << "\n" end end @@ -478,7 +478,7 @@ def rakefile_failing_test_task t.test_files = ['a_test.rb'] end TEST_TASK - open 'a_test.rb', 'w' do |io| + open "a_test.rb", "w" do |io| io << "require 'minitest/autorun'\n" io << "class ExitTaskTest < Minitest::Test\n" io << " def test_exit\n" @@ -489,7 +489,7 @@ def rakefile_failing_test_task end def rakefile_stand_alone_filelist - open 'stand_alone_filelist.rb', 'w' do |io| + open "stand_alone_filelist.rb", "w" do |io| io << "require 'rake/file_list'\n" io << "FL = Rake::FileList['*.rb']\n" io << "puts FL\n" diff --git a/test/test_private_reader.rb b/test/test_private_reader.rb index f86d4249b..56160f062 100644 --- a/test/test_private_reader.rb +++ b/test/test_private_reader.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'rake/private_reader' +require File.expand_path("../helper", __FILE__) +require "rake/private_reader" class TestPrivateAttrs < Rake::TestCase diff --git a/test/test_rake.rb b/test/test_rake.rb index b2a3928b2..dfbb7d232 100644 --- a/test/test_rake.rb +++ b/test/test_rake.rb @@ -1,18 +1,18 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRake < Rake::TestCase def test_each_dir_parent - assert_equal ['a'], alldirs('a') - assert_equal ['a/b', 'a'], alldirs('a/b') - assert_equal ['/a/b', '/a', '/'], alldirs('/a/b') + assert_equal ["a"], alldirs("a") + assert_equal ["a/b", "a"], alldirs("a/b") + assert_equal ["/a/b", "/a", "/"], alldirs("/a/b") if File.dirname("c:/foo") == "c:" # Under Unix - assert_equal ['c:/a/b', 'c:/a', 'c:'], alldirs('c:/a/b') - assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b') + assert_equal ["c:/a/b", "c:/a", "c:"], alldirs("c:/a/b") + assert_equal ["c:a/b", "c:a"], alldirs("c:a/b") else # Under Windows - assert_equal ['c:/a/b', 'c:/a', 'c:/'], alldirs('c:/a/b') - assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b') + assert_equal ["c:/a/b", "c:/a", "c:/"], alldirs("c:/a/b") + assert_equal ["c:a/b", "c:a"], alldirs("c:a/b") end end diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index e3bc43842..740579737 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -1,5 +1,5 @@ #encoding: UTF-8 -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeApplication < Rake::TestCase @@ -31,13 +31,13 @@ def test_display_exception_details assert_empty out - assert_match 'rake aborted!', err + assert_match "rake aborted!", err assert_match __method__.to_s, err end def test_display_exception_details_bad_encoding begin - raise 'El Niño is coming!'.force_encoding('US-ASCII') + raise "El Niño is coming!".force_encoding("US-ASCII") rescue => ex end @@ -46,18 +46,18 @@ def test_display_exception_details_bad_encoding end assert_empty out - assert_match 'El Niño is coming!', err.force_encoding('UTF-8') + assert_match "El Niño is coming!", err.force_encoding("UTF-8") end def test_display_exception_details_cause - skip 'Exception#cause not implemented' unless + skip "Exception#cause not implemented" unless Exception.method_defined? :cause begin - raise 'cause a' + raise "cause a" rescue begin - raise 'cause b' + raise "cause b" rescue => ex end end @@ -68,21 +68,21 @@ def test_display_exception_details_cause assert_empty out - assert_match 'cause a', err - assert_match 'cause b', err + assert_match "cause a", err + assert_match "cause b", err end def test_display_exception_details_cause_loop - skip 'Exception#cause not implemented' unless + skip "Exception#cause not implemented" unless Exception.method_defined? :cause skip if jruby9? # https://github.com/jruby/jruby/issues/3654 begin begin - raise 'cause a' + raise "cause a" rescue => a begin - raise 'cause b' + raise "cause b" rescue raise a end @@ -96,8 +96,8 @@ def test_display_exception_details_cause_loop assert_empty out - assert_match 'cause a', err - assert_match 'cause b', err + assert_match "cause a", err + assert_match "cause b", err end def test_display_tasks @@ -194,7 +194,7 @@ def test_show_lines @app.options.show_task_pattern = // @app.last_description = "COMMENT" @app.define_task(Rake::Task, "t") - @app['t'].locations << "HERE:1" + @app["t"].locations << "HERE:1" out, = capture_io do @app.instance_eval { display_tasks_and_comments } end assert_match(/^rake t +[^:]+:\d+ *$/, out) end @@ -206,7 +206,7 @@ def test_finding_rakefile end def test_not_finding_rakefile - @app.instance_eval { @rakefiles = ['NEVER_FOUND'] } + @app.instance_eval { @rakefiles = ["NEVER_FOUND"] } assert(! @app.instance_eval do have_rakefile end) assert_nil @app.rakefile end @@ -240,7 +240,7 @@ def test_load_rakefile_doesnt_print_rakefile_directory_from_same_dir def test_load_rakefile_from_subdir rakefile_unittest - Dir.chdir 'subdir' + Dir.chdir "subdir" @app.instance_eval do handle_options @@ -254,7 +254,7 @@ def test_load_rakefile_from_subdir def test_load_rakefile_prints_rakefile_directory_from_subdir rakefile_unittest - Dir.chdir 'subdir' + Dir.chdir "subdir" app = Rake::Application.new app.options.rakelib = [] @@ -270,7 +270,7 @@ def test_load_rakefile_prints_rakefile_directory_from_subdir def test_load_rakefile_doesnt_print_rakefile_directory_from_subdir_if_silent rakefile_unittest - Dir.chdir 'subdir' + Dir.chdir "subdir" _, err = capture_io do @app.instance_eval do @@ -286,7 +286,7 @@ def test_load_rakefile_doesnt_print_rakefile_directory_from_subdir_if_silent def test_load_rakefile_not_found ARGV.clear Dir.chdir @tempdir - ENV['RAKE_SYSTEM'] = 'not_exist' + ENV["RAKE_SYSTEM"] = "not_exist" @app.instance_eval do handle_options @@ -317,7 +317,7 @@ def test_load_from_system_rakefile assert_equal @system_dir, @app.system_dir assert_nil @app.rakefile rescue SystemExit - flunk 'failed to load rakefile' + flunk "failed to load rakefile" end def test_load_from_calculated_system_rakefile @@ -326,7 +326,7 @@ def @app.standard_system_dir "__STD_SYS_DIR__" end - ENV['RAKE_SYSTEM'] = nil + ENV["RAKE_SYSTEM"] = nil @app.instance_eval do handle_options @@ -338,22 +338,22 @@ def @app.standard_system_dir assert_equal "__STD_SYS_DIR__", @app.system_dir rescue SystemExit - flunk 'failed to find system rakefile' + flunk "failed to find system rakefile" end def test_terminal_columns - old_rake_columns = ENV['RAKE_COLUMNS'] + old_rake_columns = ENV["RAKE_COLUMNS"] - ENV['RAKE_COLUMNS'] = '42' + ENV["RAKE_COLUMNS"] = "42" app = Rake::Application.new assert_equal 42, app.terminal_columns ensure if old_rake_columns - ENV['RAKE_COLUMNS'] = old_rake_columns + ENV["RAKE_COLUMNS"] = old_rake_columns else - ENV.delete 'RAKE_COLUMNS' + ENV.delete "RAKE_COLUMNS" end end @@ -389,7 +389,7 @@ def test_building_imported_files_on_demand def test_handle_options_should_not_strip_options_from_argv assert !@app.options.trace - valid_option = '--trace' + valid_option = "--trace" setup_command_line(valid_option) @app.handle_options @@ -450,7 +450,7 @@ def test_good_run def test_display_task_run ran = false - setup_command_line('-f', '-s', '--tasks', '--rakelib=""') + setup_command_line("-f", "-s", "--tasks", '--rakelib=""') @app.last_description = "COMMENT" @app.define_task(Rake::Task, "default") out, = capture_io { @app.run } @@ -462,7 +462,7 @@ def test_display_task_run def test_display_prereqs ran = false - setup_command_line('-f', '-s', '--prereqs', '--rakelib=""') + setup_command_line("-f", "-s", "--prereqs", '--rakelib=""') @app.last_description = "COMMENT" t = @app.define_task(Rake::Task, "default") t.enhance([:a, :b]) @@ -478,7 +478,7 @@ def test_display_prereqs def test_bad_run @app.intern(Rake::Task, "default").enhance { fail } - setup_command_line('-f', '-s', '--rakelib=""') + setup_command_line("-f", "-s", '--rakelib=""') _, err = capture_io { assert_raises(SystemExit){ @app.run } } @@ -489,7 +489,7 @@ def test_bad_run def test_bad_run_with_trace @app.intern(Rake::Task, "default").enhance { fail } - setup_command_line('-f', '-s', '-t') + setup_command_line("-f", "-s", "-t") _, err = capture_io { assert_raises(SystemExit) { @app.run } } @@ -500,7 +500,7 @@ def test_bad_run_with_trace def test_bad_run_with_backtrace @app.intern(Rake::Task, "default").enhance { fail } - setup_command_line('-f', '-s', '--backtrace') + setup_command_line("-f", "-s", "--backtrace") _, err = capture_io { assert_raises(SystemExit) { @app.run @@ -517,7 +517,7 @@ def test_bad_run_includes_exception_name @app.intern(Rake::Task, "default").enhance { raise CustomError, "intentional" } - setup_command_line('-f', '-s') + setup_command_line("-f", "-s") _, err = capture_io { assert_raises(SystemExit) { @app.run @@ -530,7 +530,7 @@ def test_rake_error_excludes_exception_name @app.intern(Rake::Task, "default").enhance { fail "intentional" } - setup_command_line('-f', '-s') + setup_command_line("-f", "-s") _, err = capture_io { assert_raises(SystemExit) { @app.run @@ -554,7 +554,7 @@ def test_printing_original_exception_cause raise custom_error, "Secondary Error" end } - setup_command_line('-f', '-s') + setup_command_line("-f", "-s") _ ,err = capture_io { assert_raises(SystemExit) { @app.run @@ -570,7 +570,7 @@ def test_printing_original_exception_cause def test_run_with_bad_options @app.intern(Rake::Task, "default").enhance { fail } - setup_command_line('-f', '-s', '--xyzzy') + setup_command_line("-f", "-s", "--xyzzy") assert_raises(SystemExit) { capture_io { @app.run } } @@ -582,7 +582,7 @@ def test_standard_exception_handling_invalid_option out, err = capture_io do e = assert_raises SystemExit do @app.standard_exception_handling do - raise OptionParser::InvalidOption, 'blah' + raise OptionParser::InvalidOption, "blah" end end @@ -597,7 +597,7 @@ def test_standard_exception_handling_other out, err = capture_io do e = assert_raises SystemExit do @app.standard_exception_handling do - raise 'blah' + raise "blah" end end @@ -644,7 +644,7 @@ def util_loader loader.instance_variable_set :@load_called, false def loader.load arg - raise ArgumentError, arg unless arg == 'x.dummy' + raise ArgumentError, arg unless arg == "x.dummy" @load_called = true end diff --git a/test/test_rake_application_options.rb b/test/test_rake_application_options.rb index 1525bcd6a..4c9a8bf31 100644 --- a/test/test_rake_application_options.rb +++ b/test/test_rake_application_options.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) TESTING_REQUIRE = [] @@ -7,7 +7,7 @@ class TestRakeApplicationOptions < Rake::TestCase def setup super - @testkey = ENV['TESTKEY'] + @testkey = ENV["TESTKEY"] clear_argv Rake::FileUtilsExt.verbose_flag = false Rake::FileUtilsExt.nowrite_flag = false @@ -15,7 +15,7 @@ def setup end def teardown - ENV['TESTKEY'] = @testkey + ENV["TESTKEY"] = @testkey clear_argv Rake::FileUtilsExt.verbose_flag = false Rake::FileUtilsExt.nowrite_flag = false @@ -35,20 +35,20 @@ def test_default_options assert_nil opts.load_system assert_nil opts.always_multitask assert_nil opts.nosearch - assert_equal ['rakelib'], opts.rakelib + assert_equal ["rakelib"], opts.rakelib assert_nil opts.show_prereqs assert_nil opts.show_task_pattern assert_nil opts.show_tasks assert_nil opts.silent assert_nil opts.trace assert_nil opts.thread_pool_size - assert_equal ['rakelib'], opts.rakelib + assert_equal ["rakelib"], opts.rakelib assert ! Rake::FileUtilsExt.verbose_flag assert ! Rake::FileUtilsExt.nowrite_flag end def test_dry_run - flags('--dry-run', '-n') do |opts| + flags("--dry-run", "-n") do |opts| assert opts.dryrun assert opts.trace assert Rake::FileUtilsExt.verbose_flag @@ -57,14 +57,14 @@ def test_dry_run end def test_describe - flags('--describe') do |opts| + flags("--describe") do |opts| assert_equal :describe, opts.show_tasks assert_equal(//.to_s, opts.show_task_pattern.to_s) end end def test_describe_with_pattern - flags('--describe=X') do |opts| + flags("--describe=X") do |opts| assert_equal :describe, opts.show_tasks assert_equal(/X/.to_s, opts.show_task_pattern.to_s) end @@ -72,7 +72,7 @@ def test_describe_with_pattern def test_execute $xyzzy = 0 - flags('--execute=$xyzzy=1', '-e $xyzzy=1') do + flags("--execute=$xyzzy=1", "-e $xyzzy=1") do assert_equal 1, $xyzzy assert_equal :exit, @exit $xyzzy = 0 @@ -81,7 +81,7 @@ def test_execute def test_execute_and_continue $xyzzy = 0 - flags('--execute-continue=$xyzzy=1', '-E $xyzzy=1') do + flags("--execute-continue=$xyzzy=1", "-E $xyzzy=1") do assert_equal 1, $xyzzy refute_equal :exit, @exit $xyzzy = 0 @@ -92,7 +92,7 @@ def test_execute_and_print $xyzzy = 0 out, = capture_io do flags('--execute-print=$xyzzy="pugh"', '-p $xyzzy="pugh"') do - assert_equal 'pugh', $xyzzy + assert_equal "pugh", $xyzzy assert_equal :exit, @exit $xyzzy = 0 end @@ -103,7 +103,7 @@ def test_execute_and_print def test_help out, = capture_io do - flags '--help', '-H', '-h' + flags "--help", "-H", "-h" end assert_match(/\Arake/, out) @@ -116,62 +116,62 @@ def test_jobs flags([]) do |opts| assert_nil opts.thread_pool_size end - flags(['--jobs', '0'], ['-j', '0']) do |opts| + flags(["--jobs", "0"], ["-j", "0"]) do |opts| assert_equal 0, opts.thread_pool_size end - flags(['--jobs', '1'], ['-j', '1']) do |opts| + flags(["--jobs", "1"], ["-j", "1"]) do |opts| assert_equal 0, opts.thread_pool_size end - flags(['--jobs', '4'], ['-j', '4']) do |opts| + flags(["--jobs", "4"], ["-j", "4"]) do |opts| assert_equal 3, opts.thread_pool_size end - flags(['--jobs', 'asdas'], ['-j', 'asdas']) do |opts| + flags(["--jobs", "asdas"], ["-j", "asdas"]) do |opts| assert_equal Rake.suggested_thread_count-1, opts.thread_pool_size end - flags('--jobs', '-j') do |opts| + flags("--jobs", "-j") do |opts| assert opts.thread_pool_size > 1_000_000, "thread pool size should be huge (was #{opts.thread_pool_size})" end end def test_libdir - flags(['--libdir', 'xx'], ['-I', 'xx'], ['-Ixx']) do - $:.include?('xx') + flags(["--libdir", "xx"], ["-I", "xx"], ["-Ixx"]) do + $:.include?("xx") end ensure - $:.delete('xx') + $:.delete("xx") end def test_multitask - flags('--multitask', '-m') do |opts| + flags("--multitask", "-m") do |opts| assert_equal opts.always_multitask, true end end def test_rakefile - flags(['--rakefile', 'RF'], ['--rakefile=RF'], ['-f', 'RF'], ['-fRF']) do - assert_equal ['RF'], @app.instance_eval { @rakefiles } + flags(["--rakefile", "RF"], ["--rakefile=RF"], ["-f", "RF"], ["-fRF"]) do + assert_equal ["RF"], @app.instance_eval { @rakefiles } end end def test_rakelib dirs = %w(A B C).join(File::PATH_SEPARATOR) flags( - ['--rakelibdir', dirs], + ["--rakelibdir", dirs], ["--rakelibdir=#{dirs}"], - ['-R', dirs], + ["-R", dirs], ["-R#{dirs}"]) do |opts| - assert_equal ['A', 'B', 'C'], opts.rakelib + assert_equal ["A", "B", "C"], opts.rakelib end end def test_require $LOAD_PATH.unshift @tempdir - open 'reqfile.rb', 'w' do |io| io << 'TESTING_REQUIRE << 1' end - open 'reqfile2.rb', 'w' do |io| io << 'TESTING_REQUIRE << 2' end - open 'reqfile3.rake', 'w' do |io| io << 'TESTING_REQUIRE << 3' end + open "reqfile.rb", "w" do |io| io << "TESTING_REQUIRE << 1" end + open "reqfile2.rb", "w" do |io| io << "TESTING_REQUIRE << 2" end + open "reqfile3.rake", "w" do |io| io << "TESTING_REQUIRE << 3" end - flags(['--require', 'reqfile'], '-rreqfile2', '-rreqfile3') + flags(["--require", "reqfile"], "-rreqfile2", "-rreqfile3") assert_includes TESTING_REQUIRE, 1 assert_includes TESTING_REQUIRE, 2 @@ -184,7 +184,7 @@ def test_require def test_missing_require ex = assert_raises(LoadError) do - flags(['--require', 'test/missing']) do |opts| + flags(["--require", "test/missing"]) do |opts| end end assert_match(/such file/, ex.message) @@ -192,47 +192,47 @@ def test_missing_require end def test_prereqs - flags('--prereqs', '-P') do |opts| + flags("--prereqs", "-P") do |opts| assert opts.show_prereqs end end def test_quiet Rake::FileUtilsExt.verbose_flag = true - flags('--quiet', '-q') do |opts| + flags("--quiet", "-q") do |opts| assert ! Rake::FileUtilsExt.verbose_flag, "verbose flag should be false" assert ! opts.silent, "should not be silent" end end def test_no_search - flags('--nosearch', '--no-search', '-N') do |opts| + flags("--nosearch", "--no-search", "-N") do |opts| assert opts.nosearch end end def test_silent Rake::FileUtilsExt.verbose_flag = true - flags('--silent', '-s') do |opts| + flags("--silent", "-s") do |opts| assert ! Rake::FileUtilsExt.verbose_flag, "verbose flag should be false" assert opts.silent, "should be silent" end end def test_system - flags('--system', '-g') do |opts| + flags("--system", "-g") do |opts| assert opts.load_system end end def test_no_system - flags('--no-system', '-G') do |opts| + flags("--no-system", "-G") do |opts| assert opts.ignore_system end end def test_trace - flags('--trace', '-t') do |opts| + flags("--trace", "-t") do |opts| assert opts.trace, "should enable trace option" assert opts.backtrace, "should enabled backtrace option" assert_equal $stderr, opts.trace_output @@ -242,7 +242,7 @@ def test_trace end def test_trace_with_stdout - flags('--trace=stdout', '-tstdout') do |opts| + flags("--trace=stdout", "-tstdout") do |opts| assert opts.trace, "should enable trace option" assert opts.backtrace, "should enabled backtrace option" assert_equal $stdout, opts.trace_output @@ -252,7 +252,7 @@ def test_trace_with_stdout end def test_trace_with_stderr - flags('--trace=stderr', '-tstderr') do |opts| + flags("--trace=stderr", "-tstderr") do |opts| assert opts.trace, "should enable trace option" assert opts.backtrace, "should enabled backtrace option" assert_equal $stderr, opts.trace_output @@ -263,23 +263,23 @@ def test_trace_with_stderr def test_trace_with_error ex = assert_raises(Rake::CommandLineOptionError) do - flags('--trace=xyzzy') do |opts| end + flags("--trace=xyzzy") do |opts| end end assert_match(/un(known|recognized).*\btrace\b.*xyzzy/i, ex.message) end def test_trace_with_following_task_name - flags(['--trace', 'taskname'], ['-t', 'taskname']) do |opts| + flags(["--trace", "taskname"], ["-t", "taskname"]) do |opts| assert opts.trace, "should enable trace option" assert opts.backtrace, "should enabled backtrace option" assert_equal $stderr, opts.trace_output assert Rake::FileUtilsExt.verbose_flag - assert_equal ['taskname'], @app.top_level_tasks + assert_equal ["taskname"], @app.top_level_tasks end end def test_backtrace - flags('--backtrace') do |opts| + flags("--backtrace") do |opts| assert opts.backtrace, "should enable backtrace option" assert_equal $stderr, opts.trace_output assert ! opts.trace, "should not enable trace option" @@ -287,7 +287,7 @@ def test_backtrace end def test_backtrace_with_stdout - flags('--backtrace=stdout') do |opts| + flags("--backtrace=stdout") do |opts| assert opts.backtrace, "should enable backtrace option" assert_equal $stdout, opts.trace_output assert ! opts.trace, "should not enable trace option" @@ -295,7 +295,7 @@ def test_backtrace_with_stdout end def test_backtrace_with_stderr - flags('--backtrace=stderr') do |opts| + flags("--backtrace=stderr") do |opts| assert opts.backtrace, "should enable backtrace option" assert_equal $stderr, opts.trace_output assert ! opts.trace, "should not enable trace option" @@ -304,38 +304,38 @@ def test_backtrace_with_stderr def test_backtrace_with_error ex = assert_raises(Rake::CommandLineOptionError) do - flags('--backtrace=xyzzy') do |opts| end + flags("--backtrace=xyzzy") do |opts| end end assert_match(/un(known|recognized).*\bbacktrace\b.*xyzzy/i, ex.message) end def test_backtrace_with_following_task_name - flags(['--backtrace', 'taskname']) do |opts| + flags(["--backtrace", "taskname"]) do |opts| assert ! opts.trace, "should enable trace option" assert opts.backtrace, "should enabled backtrace option" assert_equal $stderr, opts.trace_output - assert_equal ['taskname'], @app.top_level_tasks + assert_equal ["taskname"], @app.top_level_tasks end end def test_trace_rules - flags('--rules') do |opts| + flags("--rules") do |opts| assert opts.trace_rules end end def test_tasks - flags('--tasks', '-T') do |opts| + flags("--tasks", "-T") do |opts| assert_equal :tasks, opts.show_tasks assert_equal(//.to_s, opts.show_task_pattern.to_s) assert_equal nil, opts.show_all_tasks end - flags(['--tasks', 'xyz'], ['-Txyz']) do |opts| + flags(["--tasks", "xyz"], ["-Txyz"]) do |opts| assert_equal :tasks, opts.show_tasks assert_equal(/xyz/.to_s, opts.show_task_pattern.to_s) assert_equal nil, opts.show_all_tasks end - flags(['--tasks', 'xyz', '--comments']) do |opts| + flags(["--tasks", "xyz", "--comments"]) do |opts| assert_equal :tasks, opts.show_tasks assert_equal(/xyz/.to_s, opts.show_task_pattern.to_s) assert_equal false, opts.show_all_tasks @@ -343,17 +343,17 @@ def test_tasks end def test_where - flags('--where', '-W') do |opts| + flags("--where", "-W") do |opts| assert_equal :lines, opts.show_tasks assert_equal(//.to_s, opts.show_task_pattern.to_s) assert_equal true, opts.show_all_tasks end - flags(['--where', 'xyz'], ['-Wxyz']) do |opts| + flags(["--where", "xyz"], ["-Wxyz"]) do |opts| assert_equal :lines, opts.show_tasks assert_equal(/xyz/.to_s, opts.show_task_pattern.to_s) assert_equal true, opts.show_all_tasks end - flags(['--where', 'xyz', '--comments'], ['-Wxyz', '--comments']) do |opts| + flags(["--where", "xyz", "--comments"], ["-Wxyz", "--comments"]) do |opts| assert_equal :lines, opts.show_tasks assert_equal(/xyz/.to_s, opts.show_task_pattern.to_s) assert_equal false, opts.show_all_tasks @@ -361,14 +361,14 @@ def test_where end def test_no_deprecated_messages - flags('--no-deprecation-warnings', '-X') do |opts| + flags("--no-deprecation-warnings", "-X") do |opts| assert opts.ignore_deprecate end end def test_verbose capture_io do - flags('--verbose', '-v') do |opts| + flags("--verbose", "-v") do |opts| assert Rake::FileUtilsExt.verbose_flag, "verbose should be true" assert ! opts.silent, "opts should not be silent" end @@ -377,7 +377,7 @@ def test_verbose def test_version out, _ = capture_io do - flags '--version', '-V' + flags "--version", "-V" end assert_match(/\bversion\b/, out) @@ -388,7 +388,7 @@ def test_version def test_bad_option _, err = capture_io do ex = assert_raises(OptionParser::InvalidOption) do - flags('--bad-option') + flags("--bad-option") end if ex.message =~ /^While/ # Ruby 1.9 error message @@ -399,7 +399,7 @@ def test_bad_option end end - assert_equal '', err + assert_equal "", err end def test_task_collection @@ -413,26 +413,26 @@ def test_default_task_collection end def test_environment_definition - ENV.delete('TESTKEY') + ENV.delete("TESTKEY") command_line("TESTKEY=12") - assert_equal '12', ENV['TESTKEY'] + assert_equal "12", ENV["TESTKEY"] end def test_multiline_environment_definition - ENV.delete('TESTKEY') + ENV.delete("TESTKEY") command_line("TESTKEY=a\nb\n") - assert_equal "a\nb\n", ENV['TESTKEY'] + assert_equal "a\nb\n", ENV["TESTKEY"] end def test_environment_and_tasks_together - ENV.delete('TESTKEY') + ENV.delete("TESTKEY") command_line("a", "b", "TESTKEY=12") assert_equal ["a", "b"], @tasks.sort - assert_equal '12', ENV['TESTKEY'] + assert_equal "12", ENV["TESTKEY"] end def test_rake_explicit_task_library - Rake.add_rakelib 'app/task', 'other' + Rake.add_rakelib "app/task", "other" libs = Rake.application.options.rakelib diff --git a/test/test_rake_backtrace.rb b/test/test_rake_backtrace.rb index 78eaa8d52..ec727a292 100644 --- a/test/test_rake_backtrace.rb +++ b/test/test_rake_backtrace.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'open3' +require File.expand_path("../helper", __FILE__) +require "open3" class TestBacktraceSuppression < Rake::TestCase def test_bin_rake_suppressed @@ -11,7 +11,7 @@ def test_bin_rake_suppressed end def test_system_dir_suppressed - path = RbConfig::CONFIG['rubylibprefix'] + path = RbConfig::CONFIG["rubylibprefix"] skip if path.nil? path = File.expand_path path @@ -23,7 +23,7 @@ def test_system_dir_suppressed end def test_near_system_dir_isnt_suppressed - path = RbConfig::CONFIG['rubylibprefix'] + path = RbConfig::CONFIG["rubylibprefix"] skip if path.nil? path = File.expand_path path @@ -41,7 +41,7 @@ class TestRakeBacktrace < Rake::TestCase def setup super - skip 'tmpdir is suppressed in backtrace' if + skip "tmpdir is suppressed in backtrace" if Rake::Backtrace::SUPPRESS_PATTERN =~ Dir.pwd end diff --git a/test/test_rake_clean.rb b/test/test_rake_clean.rb index f94d8c31c..04367907a 100644 --- a/test/test_rake_clean.rb +++ b/test/test_rake_clean.rb @@ -1,13 +1,13 @@ -require File.expand_path('../helper', __FILE__) -require 'rake/clean' +require File.expand_path("../helper", __FILE__) +require "rake/clean" class TestRakeClean < Rake::TestCase def test_clean - load 'rake/clean.rb', true + load "rake/clean.rb", true - assert Rake::Task['clean'], "Should define clean" - assert Rake::Task['clobber'], "Should define clobber" - assert Rake::Task['clobber'].prerequisites.include?("clean"), + assert Rake::Task["clean"], "Should define clean" + assert Rake::Task["clobber"], "Should define clobber" + assert Rake::Task["clobber"].prerequisites.include?("clean"), "Clobber should require clean" end diff --git a/test/test_rake_cpu_counter.rb b/test/test_rake_cpu_counter.rb index 87d0601c6..aac16b2d7 100644 --- a/test/test_rake_cpu_counter.rb +++ b/test/test_rake_cpu_counter.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeCpuCounter < Rake::TestCase @@ -10,7 +10,7 @@ def setup def test_count num = @cpu_counter.count - skip 'cannot count CPU' if num == nil + skip "cannot count CPU" if num == nil assert_kind_of Numeric, num assert_operator num, :>=, 1 end diff --git a/test/test_rake_definitions.rb b/test/test_rake_definitions.rb index a0314621d..464cc6309 100644 --- a/test/test_rake_definitions.rb +++ b/test/test_rake_definitions.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'fileutils' +require File.expand_path("../helper", __FILE__) +require "fileutils" class TestRakeDefinitions < Rake::TestCase include Rake @@ -69,7 +69,7 @@ def test_implicit_file_dependencies create_existing_file task y: [EXISTINGFILE] do |t| runs << t.name end Task[:y].invoke - assert_equal runs, ['y'] + assert_equal runs, ["y"] end private # ---------------------------------------------------------- diff --git a/test/test_rake_directory_task.rb b/test/test_rake_directory_task.rb index 0014d1c15..e42bd9c77 100644 --- a/test/test_rake_directory_task.rb +++ b/test/test_rake_directory_task.rb @@ -1,6 +1,6 @@ -require File.expand_path('../helper', __FILE__) -require 'fileutils' -require 'pathname' +require File.expand_path("../helper", __FILE__) +require "fileutils" +require "pathname" class TestRakeDirectoryTask < Rake::TestCase include Rake @@ -19,7 +19,7 @@ def test_directory assert_equal "DESC", Task["a/b/c"].comment verbose(false) { - Task['a/b'].invoke + Task["a/b"].invoke } assert File.exist?("a/b") @@ -29,20 +29,20 @@ def test_directory def test_directory_colon directory "a:b" - assert_equal FileCreationTask, Task['a:b'].class + assert_equal FileCreationTask, Task["a:b"].class end unless Rake::Win32.windows? if Rake::Win32.windows? def test_directory_win32 desc "WIN32 DESC" - directory 'c:/a/b/c' - assert_equal FileTask, Task['c:'].class - assert_equal FileCreationTask, Task['c:/a'].class - assert_equal FileCreationTask, Task['c:/a/b'].class - assert_equal FileCreationTask, Task['c:/a/b/c'].class - assert_nil Task['c:/'].comment - assert_equal "WIN32 DESC", Task['c:/a/b/c'].comment - assert_nil Task['c:/a/b'].comment + directory "c:/a/b/c" + assert_equal FileTask, Task["c:"].class + assert_equal FileCreationTask, Task["c:/a"].class + assert_equal FileCreationTask, Task["c:/a/b"].class + assert_equal FileCreationTask, Task["c:/a/b/c"].class + assert_nil Task["c:/"].comment + assert_equal "WIN32 DESC", Task["c:/a/b/c"].comment + assert_nil Task["c:/a/b"].comment end end @@ -68,7 +68,7 @@ def test_can_use_pathname assert_equal FileCreationTask, Task["a/b/c"].class verbose(false) { - Task['a/b/c'].invoke + Task["a/b/c"].invoke } assert File.directory?("a/b/c") diff --git a/test/test_rake_dsl.rb b/test/test_rake_dsl.rb index ad52f760b..7f82c6afa 100644 --- a/test/test_rake_dsl.rb +++ b/test/test_rake_dsl.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeDsl < Rake::TestCase diff --git a/test/test_rake_early_time.rb b/test/test_rake_early_time.rb index 18c4dad32..71ee3e157 100644 --- a/test/test_rake_early_time.rb +++ b/test/test_rake_early_time.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeEarlyTime < Rake::TestCase def test_create diff --git a/test/test_rake_extension.rb b/test/test_rake_extension.rb index 18d55f19f..f9b2e2885 100644 --- a/test/test_rake_extension.rb +++ b/test/test_rake_extension.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'stringio' +require File.expand_path("../helper", __FILE__) +require "stringio" class TestRakeExtension < Rake::TestCase diff --git a/test/test_rake_file_creation_task.rb b/test/test_rake_file_creation_task.rb index d8dcd965a..3e2d4726b 100644 --- a/test/test_rake_file_creation_task.rb +++ b/test/test_rake_file_creation_task.rb @@ -1,12 +1,12 @@ -require File.expand_path('../helper', __FILE__) -require 'fileutils' +require File.expand_path("../helper", __FILE__) +require "fileutils" ###################################################################### class TestRakeFileCreationTask < Rake::TestCase include Rake include Rake::DSL - DUMMY_DIR = 'dummy_dir' + DUMMY_DIR = "dummy_dir" def setup super diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index ca881f34b..aaf818b86 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'pathname' +require File.expand_path("../helper", __FILE__) +require "pathname" class TestRakeFileList < Rake::TestCase FileList = Rake::FileList @@ -22,9 +22,9 @@ def setup FileUtils.touch "abc.x" FileUtils.touch "existing" - open 'xyzzy.txt', 'w' do |io| - io.puts 'x' - io.puts 'XYZZY' + open "xyzzy.txt", "w" do |io| + io.puts "x" + io.puts "XYZZY" end end @@ -90,21 +90,21 @@ def test_include_with_pathname def test_append fl = FileList.new fl << "a.rb" << "b.rb" - assert_equal ['a.rb', 'b.rb'], fl + assert_equal ["a.rb", "b.rb"], fl end def test_append_pathname fl = FileList.new fl << Pathname.new("a.rb") - assert_equal ['a.rb'], fl + assert_equal ["a.rb"], fl end def test_add_many fl = FileList.new fl.include %w(a d c) - fl.include('x', 'y') - assert_equal ['a', 'd', 'c', 'x', 'y'], fl - assert_equal ['a', 'd', 'c', 'x', 'y'], fl.resolve + fl.include("x", "y") + assert_equal ["a", "d", "c", "x", "y"], fl + assert_equal ["a", "d", "c", "x", "y"], fl.resolve end def test_add_return @@ -117,7 +117,7 @@ def test_add_return def test_match fl = FileList.new - fl.include '*.c' + fl.include "*.c" assert_equal %w[abc.c x.c xyz.c], fl.sort end @@ -125,18 +125,18 @@ def test_match def test_add_matching fl = FileList.new fl << "a.java" - fl.include '*.c' + fl.include "*.c" assert_equal %w[a.java abc.c x.c xyz.c], fl.sort end def test_multiple_patterns fl = FileList.new - fl.include('*.z', '*foo*') + fl.include("*.z", "*foo*") assert_equal [], fl - fl.include('*.c', '*xist*') + fl.include("*.c", "*xist*") assert_equal %w[x.c xyz.c abc.c existing].sort, fl.sort end @@ -164,7 +164,7 @@ def test_reject end def test_exclude - fl = FileList['x.c', 'abc.c', 'xyz.c', 'existing'] + fl = FileList["x.c", "abc.c", "xyz.c", "existing"] fl.each { |fn| touch fn, verbose: false } x = fl.exclude(%r{^x.+\.}) @@ -173,57 +173,57 @@ def test_exclude assert_equal %w(x.c abc.c existing), fl assert_equal fl.object_id, x.object_id - fl.exclude('*.c') + fl.exclude("*.c") - assert_equal ['existing'], fl + assert_equal ["existing"], fl - fl.exclude('existing') + fl.exclude("existing") assert_equal [], fl end def test_exclude_pathname - fl = FileList['x.c', 'abc.c', 'other'] + fl = FileList["x.c", "abc.c", "other"] fl.each { |fn| touch fn, verbose: false } - fl.exclude(Pathname.new('*.c')) + fl.exclude(Pathname.new("*.c")) - assert_equal ['other'], fl + assert_equal ["other"], fl end def test_excluding_via_block - fl = FileList['a.c', 'b.c', 'xyz.c'] - fl.exclude { |fn| fn.pathmap('%n') == 'xyz' } + fl = FileList["a.c", "b.c", "xyz.c"] + fl.exclude { |fn| fn.pathmap("%n") == "xyz" } assert fl.excluded_from_list?("xyz.c"), "Should exclude xyz.c" - assert_equal ['a.c', 'b.c'], fl + assert_equal ["a.c", "b.c"], fl end def test_exclude_return_on_create - fl = FileList['*'].exclude(/.*\.[hcx]$/) + fl = FileList["*"].exclude(/.*\.[hcx]$/) assert_equal %w[cfiles existing xyzzy.txt], fl.sort assert_equal FileList, fl.class end def test_exclude_with_string_return_on_create - fl = FileList['*'].exclude('abc.c') + fl = FileList["*"].exclude("abc.c") assert_equal %w[abc.h abc.x cfiles existing x.c xyz.c xyzzy.txt], fl.sort assert_equal FileList, fl.class end def test_exclude_curly_bracket_pattern - skip 'brace pattern matches not supported' unless defined? File::FNM_EXTGLOB - fl = FileList['*'].exclude('{abc,xyz}.c') + skip "brace pattern matches not supported" unless defined? File::FNM_EXTGLOB + fl = FileList["*"].exclude("{abc,xyz}.c") assert_equal %w[abc.h abc.x cfiles existing x.c xyzzy.txt], fl end def test_exclude_an_array - fl = FileList['*'].exclude(['existing', '*.c']) + fl = FileList["*"].exclude(["existing", "*.c"]) assert_equal %w[abc.h abc.x cfiles xyzzy.txt], fl end def test_exclude_a_filelist - excluded = FileList['existing', '*.c'] - fl = FileList['*'].exclude(excluded) + excluded = FileList["existing", "*.c"] + fl = FileList["*"].exclude(excluded) assert_equal %w[abc.h abc.x cfiles xyzzy.txt], fl end @@ -238,9 +238,9 @@ def test_default_exclude def test_unique fl = FileList.new fl << "x.c" << "a.c" << "b.rb" << "a.c" - assert_equal ['x.c', 'a.c', 'b.rb', 'a.c'], fl + assert_equal ["x.c", "a.c", "b.rb", "a.c"], fl fl.uniq! - assert_equal ['x.c', 'a.c', 'b.rb'], fl + assert_equal ["x.c", "a.c", "b.rb"], fl end def test_to_string @@ -251,15 +251,15 @@ def test_to_string end def test_to_array - fl = FileList['a.java', 'b.java'] - assert_equal ['a.java', 'b.java'], fl.to_a + fl = FileList["a.java", "b.java"] + assert_equal ["a.java", "b.java"], fl.to_a assert_equal Array, fl.to_a.class - assert_equal ['a.java', 'b.java'], fl.to_ary + assert_equal ["a.java", "b.java"], fl.to_ary assert_equal Array, fl.to_ary.class end def test_to_s_pending - fl = FileList['abc.*'] + fl = FileList["abc.*"] result = fl.to_s assert_match(%r{abc\.c}, result) assert_match(%r{abc\.h}, result) @@ -268,7 +268,7 @@ def test_to_s_pending end def test_inspect_pending - fl = FileList['abc.*'] + fl = FileList["abc.*"] result = fl.inspect assert_match(%r{"abc\.c"}, result) assert_match(%r{"abc\.h"}, result) @@ -289,24 +289,24 @@ def test_sub end def test_claim_to_be_a_kind_of_array - fl = FileList['*.c'] + fl = FileList["*.c"] assert fl.is_a?(Array) assert fl.kind_of?(Array) end def test_claim_to_be_a_kind_of_filelist - fl = FileList['*.c'] + fl = FileList["*.c"] assert fl.is_a?(FileList) assert fl.kind_of?(FileList) end def test_claim_to_be_a_filelist_instance - fl = FileList['*.c'] + fl = FileList["*.c"] assert fl.instance_of?(FileList) end def test_dont_claim_to_be_an_array_instance - fl = FileList['*.c'] + fl = FileList["*.c"] assert ! fl.instance_of?(Array) end @@ -343,7 +343,7 @@ def test_string_ext assert_equal ".onerc.net", ".onerc.dot".ext("net") assert_equal ".onerc.net", ".onerc".ext("net") assert_equal ".a/.onerc.net", ".a/.onerc".ext("net") - assert_equal "one", "one.two".ext('') + assert_equal "one", "one.two".ext("") assert_equal "one", "one.two".ext assert_equal ".one", ".one.two".ext assert_equal ".one", ".one".ext @@ -357,8 +357,8 @@ def test_string_ext end def test_filelist_ext - assert_equal FileList['one.c', '.one.c'], - FileList['one.net', '.one'].ext('c') + assert_equal FileList["one.c", ".one.c"], + FileList["one.net", ".one"].ext("c") end def test_gsub @@ -376,12 +376,12 @@ def test_gsub! end def test_egrep_returns_0_if_no_matches - files = FileList['test/lib/*_test.rb'].exclude("test/lib/filelist_test.rb") + files = FileList["test/lib/*_test.rb"].exclude("test/lib/filelist_test.rb") assert_equal 0, files.egrep(/XYZZY/) { } end def test_egrep_with_output - files = FileList['*.txt'] + files = FileList["*.txt"] out, = capture_io do files.egrep(/XYZZY/) @@ -391,7 +391,7 @@ def test_egrep_with_output end def test_egrep_with_block - files = FileList['*.txt'] + files = FileList["*.txt"] found = nil files.egrep(/XYZZY/) do |fn, ln, line| @@ -402,7 +402,7 @@ def test_egrep_with_block end def test_egrep_with_error - files = FileList['*.txt'] + files = FileList["*.txt"] _, err = capture_io do files.egrep(/XYZZY/) do |fn, ln, line | @@ -414,20 +414,20 @@ def test_egrep_with_error end def test_existing - fl = FileList['abc.c', 'notthere.c'] + fl = FileList["abc.c", "notthere.c"] assert_equal ["abc.c"], fl.existing assert fl.existing.is_a?(FileList) end def test_existing! - fl = FileList['abc.c', 'notthere.c'] + fl = FileList["abc.c", "notthere.c"] result = fl.existing! assert_equal ["abc.c"], fl assert_equal fl.object_id, result.object_id end def test_ignore_special - f = FileList['*'] + f = FileList["*"] assert ! f.include?("CVS"), "Should not contain CVS" assert ! f.include?(".svn"), "Should not contain .svn" assert ! f.include?(".dummy"), "Should not contain dot files" @@ -437,7 +437,7 @@ def test_ignore_special end def test_clear_ignore_patterns - f = FileList['*', '.svn'] + f = FileList["*", ".svn"] f.clear_exclude assert f.include?("abc.c") assert f.include?("xyz.c") @@ -470,34 +470,34 @@ def test_add_default_exclude_list end def test_basic_array_functions - f = FileList['b', 'c', 'a'] - assert_equal 'b', f.first - assert_equal 'b', f[0] - assert_equal 'a', f.last - assert_equal 'a', f[2] - assert_equal 'a', f[-1] - assert_equal ['a', 'b', 'c'], f.sort + f = FileList["b", "c", "a"] + assert_equal "b", f.first + assert_equal "b", f[0] + assert_equal "a", f.last + assert_equal "a", f[2] + assert_equal "a", f[-1] + assert_equal ["a", "b", "c"], f.sort f.sort! - assert_equal ['a', 'b', 'c'], f + assert_equal ["a", "b", "c"], f end def test_flatten - assert_equal ['a', 'x.c', 'xyz.c', 'abc.c'].sort, - ['a', FileList['*.c']].flatten.sort + assert_equal ["a", "x.c", "xyz.c", "abc.c"].sort, + ["a", FileList["*.c"]].flatten.sort end def test_clone_and_dup - a = FileList['a', 'b', 'c'] + a = FileList["a", "b", "c"] c = a.clone d = a.dup - a << 'd' - assert_equal ['a', 'b', 'c', 'd'], a - assert_equal ['a', 'b', 'c'], c - assert_equal ['a', 'b', 'c'], d + a << "d" + assert_equal ["a", "b", "c", "d"], a + assert_equal ["a", "b", "c"], c + assert_equal ["a", "b", "c"], d end def test_dup_and_clone_replicate_taint - a = FileList['a', 'b', 'c'] + a = FileList["a", "b", "c"] a.taint c = a.clone d = a.dup @@ -506,27 +506,27 @@ def test_dup_and_clone_replicate_taint end def test_duped_items_will_thaw - a = FileList['a', 'b', 'c'] + a = FileList["a", "b", "c"] a.freeze d = a.dup - d << 'more' - assert_equal ['a', 'b', 'c', 'more'], d + d << "more" + assert_equal ["a", "b", "c", "more"], d end def test_cloned_items_stay_frozen - a = FileList['a', 'b', 'c'] + a = FileList["a", "b", "c"] a.freeze c = a.clone assert_raises(TypeError, RuntimeError) do - c << 'more' + c << "more" end end def test_array_comparisons - fl = FileList['b', 'b'] - a = ['b', 'a'] - b = ['b', 'b'] - c = ['b', 'c'] + fl = FileList["b", "b"] + a = ["b", "a"] + b = ["b", "b"] + c = ["b", "c"] assert_equal(1, fl <=> a) assert_equal(0, fl <=> b) assert_equal(-1, fl <=> c) @@ -536,8 +536,8 @@ def test_array_comparisons end def test_array_equality - a = FileList['a', 'b'] - b = ['a', 'b'] + a = FileList["a", "b"] + b = ["a", "b"] assert a == b assert b == a # assert a.eql?(b) @@ -547,115 +547,115 @@ def test_array_equality end def test_enumeration_methods - a = FileList['a', 'b'] + a = FileList["a", "b"] b = a.map(&:upcase) - assert_equal ['A', 'B'], b + assert_equal ["A", "B"], b assert_equal FileList, b.class b = a.map(&:upcase) - assert_equal ['A', 'B'], b + assert_equal ["A", "B"], b assert_equal FileList, b.class b = a.sort - assert_equal ['a', 'b'], b + assert_equal ["a", "b"], b assert_equal FileList, b.class b = a.sort_by { |it| it } - assert_equal ['a', 'b'], b + assert_equal ["a", "b"], b assert_equal FileList, b.class - b = a.select { |it| it == 'b' } - assert_equal ['b'], b + b = a.select { |it| it == "b" } + assert_equal ["b"], b assert_equal FileList, b.class b = a.select { |it| it.size == 1 } - assert_equal ['a', 'b'], b + assert_equal ["a", "b"], b assert_equal FileList, b.class - b = a.reject { |it| it == 'b' } - assert_equal ['a'], b + b = a.reject { |it| it == "b" } + assert_equal ["a"], b assert_equal FileList, b.class b = a.grep(/./) - assert_equal ['a', 'b'], b + assert_equal ["a", "b"], b assert_equal FileList, b.class - b = a.partition { |it| it == 'b' } - assert_equal [['b'], ['a']], b + b = a.partition { |it| it == "b" } + assert_equal [["b"], ["a"]], b assert_equal Array, b.class assert_equal FileList, b[0].class assert_equal FileList, b[1].class - b = a.zip(['x', 'y']).to_a - assert_equal [['a', 'x'], ['b', 'y']], b + b = a.zip(["x", "y"]).to_a + assert_equal [["a", "x"], ["b", "y"]], b assert_equal Array, b.class assert_equal Array, b[0].class assert_equal Array, b[1].class end def test_array_operators - a = ['a', 'b'] - b = ['c', 'd'] - f = FileList['x', 'y'] - g = FileList['w', 'z'] + a = ["a", "b"] + b = ["c", "d"] + f = FileList["x", "y"] + g = FileList["w", "z"] r = f + g - assert_equal ['x', 'y', 'w', 'z'], r + assert_equal ["x", "y", "w", "z"], r assert_equal FileList, r.class r = a + g - assert_equal ['a', 'b', 'w', 'z'], r + assert_equal ["a", "b", "w", "z"], r assert_equal Array, r.class r = f + b - assert_equal ['x', 'y', 'c', 'd'], r + assert_equal ["x", "y", "c", "d"], r assert_equal FileList, r.class - r = FileList['w', 'x', 'y', 'z'] - f - assert_equal ['w', 'z'], r + r = FileList["w", "x", "y", "z"] - f + assert_equal ["w", "z"], r assert_equal FileList, r.class - r = FileList['w', 'x', 'y', 'z'] & f - assert_equal ['x', 'y'], r + r = FileList["w", "x", "y", "z"] & f + assert_equal ["x", "y"], r assert_equal FileList, r.class r = f * 2 - assert_equal ['x', 'y', 'x', 'y'], r + assert_equal ["x", "y", "x", "y"], r assert_equal FileList, r.class - r = f * ',' - assert_equal 'x,y', r + r = f * "," + assert_equal "x,y", r assert_equal String, r.class - r = f | ['a', 'x'] - assert_equal ['a', 'x', 'y'].sort, r.sort + r = f | ["a", "x"] + assert_equal ["a", "x", "y"].sort, r.sort assert_equal FileList, r.class end def test_other_array_returning_methods - f = FileList['a', nil, 'b'] + f = FileList["a", nil, "b"] r = f.compact - assert_equal ['a', 'b'], r + assert_equal ["a", "b"], r assert_equal FileList, r.class - f = FileList['a', 'b'] - r = f.concat(['x', 'y']) - assert_equal ['a', 'b', 'x', 'y'], r + f = FileList["a", "b"] + r = f.concat(["x", "y"]) + assert_equal ["a", "b", "x", "y"], r assert_equal FileList, r.class - f = FileList['a', ['b', 'c'], FileList['d', 'e']] + f = FileList["a", ["b", "c"], FileList["d", "e"]] r = f.flatten - assert_equal ['a', 'b', 'c', 'd', 'e'], r + assert_equal ["a", "b", "c", "d", "e"], r assert_equal FileList, r.class - f = FileList['a', 'b', 'a'] + f = FileList["a", "b", "a"] r = f.uniq - assert_equal ['a', 'b'], r + assert_equal ["a", "b"], r assert_equal FileList, r.class - f = FileList['a', 'b', 'c', 'd'] + f = FileList["a", "b", "c", "d"] r = f.values_at(1, 3) - assert_equal ['b', 'd'], r + assert_equal ["b", "d"], r assert_equal FileList, r.class end @@ -675,13 +675,13 @@ def test_special_return_delegating_methods_object_type end def test_file_utils_can_use_filelists - cfiles = FileList['*.c'] + cfiles = FileList["*.c"] cp cfiles, @cdir, verbose: false - assert File.exist?(File.join(@cdir, 'abc.c')) - assert File.exist?(File.join(@cdir, 'xyz.c')) - assert File.exist?(File.join(@cdir, 'x.c')) + assert File.exist?(File.join(@cdir, "abc.c")) + assert File.exist?(File.join(@cdir, "xyz.c")) + assert File.exist?(File.join(@cdir, "x.c")) end end diff --git a/test/test_rake_file_list_path_map.rb b/test/test_rake_file_list_path_map.rb index 7881a3f10..b75d040d7 100644 --- a/test/test_rake_file_list_path_map.rb +++ b/test/test_rake_file_list_path_map.rb @@ -1,15 +1,15 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeFileListPathMap < Rake::TestCase def test_file_list_supports_pathmap - assert_equal ['a', 'b'], FileList['dir/a.rb', 'dir/b.rb'].pathmap("%n") + assert_equal ["a", "b"], FileList["dir/a.rb", "dir/b.rb"].pathmap("%n") end def test_file_list_supports_pathmap_with_a_block - mapped = FileList['dir/a.rb', 'dir/b.rb'].pathmap("%{.*,*}n") do |name| + mapped = FileList["dir/a.rb", "dir/b.rb"].pathmap("%{.*,*}n") do |name| name.upcase end - assert_equal ['A', 'B'], mapped + assert_equal ["A", "B"], mapped end end diff --git a/test/test_rake_file_task.rb b/test/test_rake_file_task.rb index 6a4211559..e6caf2a46 100644 --- a/test/test_rake_file_task.rb +++ b/test/test_rake_file_task.rb @@ -1,6 +1,6 @@ -require File.expand_path('../helper', __FILE__) -require 'fileutils' -require 'pathname' +require File.expand_path("../helper", __FILE__) +require "fileutils" +require "pathname" class TestRakeFileTask < Rake::TestCase include Rake @@ -96,11 +96,11 @@ def test_existing_file_depends_on_non_existing_file end def test_needed_eh_build_all - create_file 'a' + create_file "a" - file 'a' + file "a" - a_task = Task['a'] + a_task = Task["a"] refute a_task.needed? @@ -108,30 +108,30 @@ def test_needed_eh_build_all assert a_task.needed? ensure - delete_file 'a' + delete_file "a" end def test_needed_eh_dependency - create_file 'a', Time.now - create_file 'b', Time.now - 60 + create_file "a", Time.now + create_file "b", Time.now - 60 - create_file 'c', Time.now - create_file 'd', Time.now - 60 + create_file "c", Time.now + create_file "d", Time.now - 60 - file 'b' => 'a' + file "b" => "a" - b_task = Task['b'] + b_task = Task["b"] assert b_task.needed? - file 'c' => 'd' + file "c" => "d" - c_task = Task['c'] + c_task = Task["c"] refute c_task.needed? ensure - delete_file 'old' - delete_file 'new' + delete_file "old" + delete_file "new" end def test_needed_eh_exists diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index 4dec00968..218c25415 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -1,17 +1,17 @@ -require File.expand_path('../helper', __FILE__) -require 'fileutils' -require 'stringio' +require File.expand_path("../helper", __FILE__) +require "fileutils" +require "stringio" class TestRakeFileUtils < Rake::TestCase def setup super - @rake_test_sh = ENV['RAKE_TEST_SH'] + @rake_test_sh = ENV["RAKE_TEST_SH"] end def teardown FileUtils::LN_SUPPORTED[0] = true RakeFileUtils.verbose_flag = Rake::FileUtilsExt::DEFAULT - ENV['RAKE_TEST_SH'] = @rake_test_sh + ENV["RAKE_TEST_SH"] = @rake_test_sh super end @@ -43,7 +43,7 @@ def test_ln Rake::FileUtilsExt.safe_ln("a", "b", verbose: false) - assert_equal "TEST_LN\n", File.read('b') + assert_equal "TEST_LN\n", File.read("b") end class BadLink @@ -69,16 +69,16 @@ def test_safe_ln_failover_to_cp_on_standard_error FileUtils::LN_SUPPORTED[0] = true c = BadLink.new(StandardError) c.safe_ln "a", "b" - assert_equal ['a', 'b'], c.cp_args + assert_equal ["a", "b"], c.cp_args c.safe_ln "x", "y" - assert_equal ['x', 'y'], c.cp_args + assert_equal ["x", "y"], c.cp_args end def test_safe_ln_failover_to_cp_on_not_implemented_error FileUtils::LN_SUPPORTED[0] = true c = BadLink.new(NotImplementedError) c.safe_ln "a", "b" - assert_equal ['a', 'b'], c.cp_args + assert_equal ["a", "b"], c.cp_args end def test_safe_ln_fails_on_script_error @@ -135,7 +135,7 @@ def test_sh def test_sh_with_a_single_string_argument check_expansion - ENV['RAKE_TEST_SH'] = 'someval' + ENV["RAKE_TEST_SH"] = "someval" verbose(false) { sh %{#{RUBY} check_expansion.rb #{env_var} someval} } @@ -145,11 +145,11 @@ def test_sh_with_env check_environment env = { - 'RAKE_TEST_SH' => 'someval' + "RAKE_TEST_SH" => "someval" } verbose(false) { - sh env, RUBY, 'check_environment.rb', 'RAKE_TEST_SH', 'someval' + sh env, RUBY, "check_environment.rb", "RAKE_TEST_SH", "someval" } end @@ -157,22 +157,22 @@ def test_sh_with_multiple_arguments skip if jruby9? # https://github.com/jruby/jruby/issues/3653 check_no_expansion - ENV['RAKE_TEST_SH'] = 'someval' + ENV["RAKE_TEST_SH"] = "someval" verbose(false) { - sh RUBY, 'check_no_expansion.rb', env_var, 'someval' + sh RUBY, "check_no_expansion.rb", env_var, "someval" } end def test_sh_with_spawn_options - skip 'JRuby does not support spawn options' if jruby? + skip "JRuby does not support spawn options" if jruby? echocommand r, w = IO.pipe verbose(false) { - sh RUBY, 'echocommand.rb', out: w + sh RUBY, "echocommand.rb", out: w } w.close @@ -217,7 +217,7 @@ def test_sh_noop def test_sh_bad_option # Skip on JRuby because option checking is performed by spawn via system # now. - skip 'JRuby does not support spawn options' if jruby? + skip "JRuby does not support spawn options" if jruby? shellcommand @@ -248,7 +248,7 @@ def test_sh_verbose_false } end - assert_equal '', err + assert_equal "", err end def test_sh_verbose_flag_nil @@ -264,7 +264,7 @@ def test_sh_verbose_flag_nil def test_ruby_with_a_single_string_argument check_expansion - ENV['RAKE_TEST_SH'] = 'someval' + ENV["RAKE_TEST_SH"] = "someval" verbose(false) { replace_ruby { @@ -275,10 +275,10 @@ def test_ruby_with_a_single_string_argument def test_sh_show_command env = { - 'RAKE_TEST_SH' => 'someval' + "RAKE_TEST_SH" => "someval" } - cmd = [env, RUBY, 'some_file.rb', 'some argument'] + cmd = [env, RUBY, "some_file.rb", "some argument"] show_cmd = send :sh_show_command, cmd @@ -292,31 +292,31 @@ def test_ruby_with_multiple_arguments check_no_expansion - ENV['RAKE_TEST_SH'] = 'someval' + ENV["RAKE_TEST_SH"] = "someval" verbose(false) { replace_ruby { - ruby 'check_no_expansion.rb', env_var, 'someval' + ruby "check_no_expansion.rb", env_var, "someval" } } end def test_split_all - assert_equal ['a'], Rake::FileUtilsExt.split_all('a') - assert_equal ['..'], Rake::FileUtilsExt.split_all('..') - assert_equal ['/'], Rake::FileUtilsExt.split_all('/') - assert_equal ['a', 'b'], Rake::FileUtilsExt.split_all('a/b') - assert_equal ['/', 'a', 'b'], Rake::FileUtilsExt.split_all('/a/b') - assert_equal ['..', 'a', 'b'], Rake::FileUtilsExt.split_all('../a/b') + assert_equal ["a"], Rake::FileUtilsExt.split_all("a") + assert_equal [".."], Rake::FileUtilsExt.split_all("..") + assert_equal ["/"], Rake::FileUtilsExt.split_all("/") + assert_equal ["a", "b"], Rake::FileUtilsExt.split_all("a/b") + assert_equal ["/", "a", "b"], Rake::FileUtilsExt.split_all("/a/b") + assert_equal ["..", "a", "b"], Rake::FileUtilsExt.split_all("../a/b") end def command(name, text) - open name, 'w', 0750 do |io| + open name, "w", 0750 do |io| io << text end end def check_no_expansion - command 'check_no_expansion.rb', <<-CHECK_EXPANSION + command "check_no_expansion.rb", <<-CHECK_EXPANSION if ARGV[0] != ARGV[1] exit 0 else @@ -326,7 +326,7 @@ def check_no_expansion end def check_environment - command 'check_environment.rb', <<-CHECK_ENVIRONMENT + command "check_environment.rb", <<-CHECK_ENVIRONMENT if ENV[ARGV[0]] != ARGV[1] exit 1 else @@ -336,7 +336,7 @@ def check_environment end def check_expansion - command 'check_expansion.rb', <<-CHECK_EXPANSION + command "check_expansion.rb", <<-CHECK_EXPANSION if ARGV[0] != ARGV[1] exit 1 else @@ -346,7 +346,7 @@ def check_expansion end def echocommand - command 'echocommand.rb', <<-ECHOCOMMAND + command "echocommand.rb", <<-ECHOCOMMAND #!/usr/bin/env ruby puts "echocommand.rb" @@ -366,7 +366,7 @@ def replace_ruby end def shellcommand - command 'shellcommand.rb', <<-SHELLCOMMAND + command "shellcommand.rb", <<-SHELLCOMMAND #!/usr/bin/env ruby exit((ARGV[0] || "0").to_i) @@ -374,7 +374,7 @@ def shellcommand end def env_var - windows? ? '%RAKE_TEST_SH%' : '$RAKE_TEST_SH' + windows? ? "%RAKE_TEST_SH%" : "$RAKE_TEST_SH" end def windows? diff --git a/test/test_rake_functional.rb b/test/test_rake_functional.rb index 703413383..55e141728 100644 --- a/test/test_rake_functional.rb +++ b/test/test_rake_functional.rb @@ -1,6 +1,6 @@ -require File.expand_path('../helper', __FILE__) -require 'fileutils' -require 'open3' +require File.expand_path("../helper", __FILE__) +require "fileutils" +require "open3" class TestRakeFunctional < Rake::TestCase include RubyRunner @@ -11,9 +11,9 @@ def setup if @verbose puts puts - puts '-' * 80 + puts "-" * 80 puts @__name__ - puts '-' * 80 + puts "-" * 80 end end @@ -28,7 +28,7 @@ def test_rake_default def test_rake_error_on_bad_task rakefile_default - rake '-t', 'xyz' + rake "-t", "xyz" assert_match(/rake aborted/, @err) end @@ -44,7 +44,7 @@ def test_env_available_at_top_scope def test_env_available_at_task_scope rakefile_default - rake 'TESTTASKSCOPE=1', 'task_scope' + rake "TESTTASKSCOPE=1", "task_scope" assert_match(/^TASKSCOPE$/, @out) end @@ -52,13 +52,13 @@ def test_env_available_at_task_scope def test_task_override rakefile_override - rake 't1' + rake "t1" assert_match(/foo\nbar\n/, @out) end def test_multi_desc - ENV['RAKE_COLUMNS'] = '80' + ENV["RAKE_COLUMNS"] = "80" rakefile_multidesc rake "-T" @@ -99,7 +99,7 @@ def test_rbext def test_system rake_system_dir - rake '-g', "sys1" + rake "-g", "sys1" assert_match %r{^SYS1}, @out end @@ -107,7 +107,7 @@ def test_system def test_system_excludes_rakelib_files_too rake_system_dir - rake '-g', "sys1", '-T', 'extra' + rake "-g", "sys1", "-T", "extra" refute_match %r{extra:extra}, @out end @@ -116,7 +116,7 @@ def test_by_default_rakelib_files_are_included rake_system_dir rakefile_extra - rake '-T', 'extra', '--trace' + rake "-T", "extra", "--trace" assert_match %r{extra:extra}, @out end @@ -134,7 +134,7 @@ def test_no_system rake_system_dir rakefile_extra - rake '-G', "sys1" + rake "-G", "sys1" assert_match %r{^Don't know how to build task}, @err # emacs wart: ' end @@ -158,7 +158,7 @@ def test_nosearch_without_rakefile_finds_system def test_nosearch_without_rakefile_and_no_system_fails rakefile_nosearch - ENV['RAKE_SYSTEM'] = 'not_exist' + ENV["RAKE_SYSTEM"] = "not_exist" rake "--nosearch" @@ -246,7 +246,7 @@ def test_dry_run_bug rake - FileUtils.rm_f 'temp_one' + FileUtils.rm_f "temp_one" rake "--dry-run" @@ -259,7 +259,7 @@ def test_trace_bug rake - FileUtils.rm_f 'temp_one' + FileUtils.rm_f "temp_one" rake "--trace" @@ -271,7 +271,7 @@ def test_imports rake - assert File.exist?(File.join(@tempdir, 'dynamic_deps')), + assert File.exist?(File.join(@tempdir, "dynamic_deps")), "'dynamic_deps' file should exist" assert_match(/^FIRST$\s+^DYNAMIC$\s+^STATIC$\s+^OTHER$/, @out) end @@ -289,7 +289,7 @@ def test_rules_chaining_to_file_task rake - assert File.exist?(File.join(@tempdir, 'play.app')), + assert File.exist?(File.join(@tempdir, "play.app")), "'play.app' file should exist" end @@ -306,7 +306,7 @@ def test_file_creation_task def test_dash_f_with_no_arg_foils_rakefile_lookup rakefile_rakelib - rake '-I', 'rakelib', '-rtest1', '-f' + rake "-I", "rakelib", "-rtest1", "-f" assert_match(/^TEST1$/, @out) end @@ -314,7 +314,7 @@ def test_dash_f_with_no_arg_foils_rakefile_lookup def test_dot_rake_files_can_be_loaded_with_dash_r rakefile_rakelib - rake '-I', 'rakelib', '-rtest2', '-f' + rake "-I", "rakelib", "-rtest2", "-f" assert_empty @err assert_match(/^TEST2$/, @out) @@ -394,14 +394,14 @@ def test_test_task_descriptions def test_test_task_when_verbose_unless_verbose_passed_not_prompt_testopts rakefile_test_task_verbose - rake 'unit' + rake "unit" exp = /TESTOPTS="--verbose" to pass --verbose/ refute_match exp, @out end def test_test_task_when_verbose_passed_prompts_testopts rakefile_test_task - rake '--verbose', 'unit' + rake "--verbose", "unit" exp = /TESTOPTS="--verbose" to pass --verbose/ assert_match exp, @out end @@ -449,12 +449,12 @@ def test_correct_number_of_tasks_reported def test_file_list_is_requirable_separately skip if jruby9? # https://github.com/jruby/jruby/issues/3655 - ruby '-rrake/file_list', '-e', 'puts Rake::FileList["a"].size' + ruby "-rrake/file_list", "-e", 'puts Rake::FileList["a"].size' assert_equal "1\n", @out end def can_detect_signals? - system RUBY, '-e', 'Process.kill "TERM", $$' + system RUBY, "-e", 'Process.kill "TERM", $$' status = $? if @verbose puts " SIG status = #{$?.inspect}" diff --git a/test/test_rake_invocation_chain.rb b/test/test_rake_invocation_chain.rb index 0176339bd..ba5f8724f 100644 --- a/test/test_rake_invocation_chain.rb +++ b/test/test_rake_invocation_chain.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeInvocationChain < Rake::TestCase include Rake @@ -29,7 +29,7 @@ def test_make_on_invocation_chains def test_append_with_one_argument chain = @empty.append("A") - assert_equal 'TOP => A', chain.to_s # HACK + assert_equal "TOP => A", chain.to_s # HACK end def test_append_one_circular diff --git a/test/test_rake_late_time.rb b/test/test_rake_late_time.rb index 4b910a708..a88826da7 100644 --- a/test/test_rake_late_time.rb +++ b/test/test_rake_late_time.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeLateTime < Rake::TestCase def test_late_time_comparisons @@ -13,6 +13,6 @@ def test_late_time_comparisons end def test_to_s - assert_equal '', Rake::LATE.to_s + assert_equal "", Rake::LATE.to_s end end diff --git a/test/test_rake_linked_list.rb b/test/test_rake_linked_list.rb index 32d730626..a3c4d1972 100644 --- a/test/test_rake_linked_list.rb +++ b/test/test_rake_linked_list.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestLinkedList < Rake::TestCase include Rake diff --git a/test/test_rake_makefile_loader.rb b/test/test_rake_makefile_loader.rb index 9e9265ad1..bd70fd3b6 100644 --- a/test/test_rake_makefile_loader.rb +++ b/test/test_rake_makefile_loader.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'rake/loaders/makefile' +require File.expand_path("../helper", __FILE__) +require "rake/loaders/makefile" class TestRakeMakefileLoader < Rake::TestCase include Rake @@ -7,7 +7,7 @@ class TestRakeMakefileLoader < Rake::TestCase def test_parse Dir.chdir @tempdir - open 'sample.mf', 'w' do |io| + open "sample.mf", "w" do |io| io << <<-'SAMPLE_MF' # Comments a: a1 a2 a3 a4 @@ -28,19 +28,19 @@ def test_parse Task.clear loader = Rake::MakefileLoader.new - loader.load 'sample.mf' + loader.load "sample.mf" %w(a b c d).each do |t| assert Task.task_defined?(t), "#{t} should be a defined task" end - assert_equal %w(a1 a2 a3 a4 a5 a6 a7).sort, Task['a'].prerequisites.sort - assert_equal %w(b1 b2 b3 b4 b5 b6 b7).sort, Task['b'].prerequisites.sort - assert_equal %w(c1).sort, Task['c'].prerequisites.sort - assert_equal %w(d1 d2).sort, Task['d'].prerequisites.sort - assert_equal %w(e1 f1).sort, Task['e'].prerequisites.sort - assert_equal %w(e1 f1).sort, Task['f'].prerequisites.sort + assert_equal %w(a1 a2 a3 a4 a5 a6 a7).sort, Task["a"].prerequisites.sort + assert_equal %w(b1 b2 b3 b4 b5 b6 b7).sort, Task["b"].prerequisites.sort + assert_equal %w(c1).sort, Task["c"].prerequisites.sort + assert_equal %w(d1 d2).sort, Task["d"].prerequisites.sort + assert_equal %w(e1 f1).sort, Task["e"].prerequisites.sort + assert_equal %w(e1 f1).sort, Task["f"].prerequisites.sort assert_equal( ["g1", "g 2", "g 3", "g4"].sort, - Task['g 0'].prerequisites.sort) + Task["g 0"].prerequisites.sort) assert_equal 7, Task.tasks.size end end diff --git a/test/test_rake_multi_task.rb b/test/test_rake_multi_task.rb index b2c6495a6..bab25b158 100644 --- a/test/test_rake_multi_task.rb +++ b/test/test_rake_multi_task.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'thread' +require File.expand_path("../helper", __FILE__) +require "thread" class TestRakeMultiTask < Rake::TestCase include Rake @@ -56,7 +56,7 @@ def test_all_multitasks_wait_on_slow_prerequisites def test_multitasks_with_parameters task :a, [:arg] do |t, args| add_run(args[:arg]) end - multitask :b, [:arg] => [:a] do |t, args| add_run(args[:arg] + 'mt') end + multitask :b, [:arg] => [:a] do |t, args| add_run(args[:arg] + "mt") end Task[:b].invoke "b" assert @runs[0] == "b" assert @runs[1] == "bmt" @@ -68,7 +68,7 @@ def test_cross_thread_prerequisite_failures multitask :fail_once do fail_now = !failed failed = true - raise 'failing once' if fail_now + raise "failing once" if fail_now end task a: :fail_once diff --git a/test/test_rake_name_space.rb b/test/test_rake_name_space.rb index ceb7b412f..e043c07fa 100644 --- a/test/test_rake_name_space.rb +++ b/test/test_rake_name_space.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeNameSpace < Rake::TestCase @@ -44,8 +44,8 @@ def test_namespace_reports_tasks_it_owns def test_scope mgr = TM.new - scope = Rake::LinkedList.new 'b' - scope = scope.conj 'a' + scope = Rake::LinkedList.new "b" + scope = scope.conj "a" ns = Rake::NameSpace.new mgr, scope diff --git a/test/test_rake_package_task.rb b/test/test_rake_package_task.rb index d7821e032..6a8b73f4c 100644 --- a/test/test_rake_package_task.rb +++ b/test/test_rake_package_task.rb @@ -1,21 +1,21 @@ -require File.expand_path('../helper', __FILE__) -require 'rake/packagetask' +require File.expand_path("../helper", __FILE__) +require "rake/packagetask" class TestRakePackageTask < Rake::TestCase def test_initialize - touch 'install.rb' - touch 'a.c' - touch 'b.c' - mkdir 'CVS' - touch 'a.rb~' + touch "install.rb" + touch "a.c" + touch "b.c" + mkdir "CVS" + touch "a.rb~" pkg = Rake::PackageTask.new("pkgr", "1.2.3") { |p| p.package_files << "install.rb" - p.package_files.include '*.c' + p.package_files.include "*.c" p.package_files.exclude(/\bCVS\b/) p.package_files.exclude(/~$/) - p.package_dir = 'pkg' + p.package_dir = "pkg" p.need_tar = true p.need_tar_gz = true p.need_tar_bz2 = true @@ -25,34 +25,34 @@ def test_initialize assert_equal "pkg", pkg.package_dir - assert_includes pkg.package_files, 'a.c' + assert_includes pkg.package_files, "a.c" - assert_equal 'pkgr', pkg.name - assert_equal '1.2.3', pkg.version + assert_equal "pkgr", pkg.name + assert_equal "1.2.3", pkg.version assert Rake::Task[:package] - assert Rake::Task['pkg/pkgr-1.2.3.tgz'] - assert Rake::Task['pkg/pkgr-1.2.3.tar.gz'] - assert Rake::Task['pkg/pkgr-1.2.3.tar.bz2'] - assert Rake::Task['pkg/pkgr-1.2.3.tar.xz'] - assert Rake::Task['pkg/pkgr-1.2.3.zip'] - assert Rake::Task['pkg/pkgr-1.2.3'] + assert Rake::Task["pkg/pkgr-1.2.3.tgz"] + assert Rake::Task["pkg/pkgr-1.2.3.tar.gz"] + assert Rake::Task["pkg/pkgr-1.2.3.tar.bz2"] + assert Rake::Task["pkg/pkgr-1.2.3.tar.xz"] + assert Rake::Task["pkg/pkgr-1.2.3.zip"] + assert Rake::Task["pkg/pkgr-1.2.3"] assert Rake::Task[:clobber_package] assert Rake::Task[:repackage] end def test_initialize_no_version e = assert_raises RuntimeError do - Rake::PackageTask.new 'pkgr' + Rake::PackageTask.new "pkgr" end - assert_equal 'Version required (or :noversion)', e.message + assert_equal "Version required (or :noversion)", e.message end def test_initialize_noversion - pkg = Rake::PackageTask.new 'pkgr', :noversion + pkg = Rake::PackageTask.new "pkgr", :noversion - assert_equal 'pkg', pkg.package_dir - assert_equal 'pkgr', pkg.name + assert_equal "pkg", pkg.package_dir + assert_equal "pkgr", pkg.name assert_equal nil, pkg.version end @@ -66,15 +66,15 @@ def test_clone end def test_package_name - pkg = Rake::PackageTask.new 'a', '1' + pkg = Rake::PackageTask.new "a", "1" - assert_equal 'a-1', pkg.package_name + assert_equal "a-1", pkg.package_name end def test_package_name_noversion - pkg = Rake::PackageTask.new 'a', :noversion + pkg = Rake::PackageTask.new "a", :noversion - assert_equal 'a', pkg.package_name + assert_equal "a", pkg.package_name end end diff --git a/test/test_rake_path_map.rb b/test/test_rake_path_map.rb index 98e8df062..040692930 100644 --- a/test/test_rake_path_map.rb +++ b/test/test_rake_path_map.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakePathMap < Rake::TestCase diff --git a/test/test_rake_path_map_explode.rb b/test/test_rake_path_map_explode.rb index a79235ee7..5845abf90 100644 --- a/test/test_rake_path_map_explode.rb +++ b/test/test_rake_path_map_explode.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakePathMapExplode < Rake::TestCase def setup @@ -14,20 +14,20 @@ def teardown end def test_explode - assert_equal ['a'], 'a'.pathmap_explode - assert_equal ['a', 'b'], 'a/b'.pathmap_explode - assert_equal ['a', 'b', 'c'], 'a/b/c'.pathmap_explode - assert_equal ['/', 'a'], '/a'.pathmap_explode - assert_equal ['/', 'a', 'b'], '/a/b'.pathmap_explode - assert_equal ['/', 'a', 'b', 'c'], '/a/b/c'.pathmap_explode + assert_equal ["a"], "a".pathmap_explode + assert_equal ["a", "b"], "a/b".pathmap_explode + assert_equal ["a", "b", "c"], "a/b/c".pathmap_explode + assert_equal ["/", "a"], "/a".pathmap_explode + assert_equal ["/", "a", "b"], "/a/b".pathmap_explode + assert_equal ["/", "a", "b", "c"], "/a/b/c".pathmap_explode if File::ALT_SEPARATOR - assert_equal ['c:.', 'a'], 'c:a'.pathmap_explode - assert_equal ['c:.', 'a', 'b'], 'c:a/b'.pathmap_explode - assert_equal ['c:.', 'a', 'b', 'c'], 'c:a/b/c'.pathmap_explode - assert_equal ['c:/', 'a'], 'c:/a'.pathmap_explode - assert_equal ['c:/', 'a', 'b'], 'c:/a/b'.pathmap_explode - assert_equal ['c:/', 'a', 'b', 'c'], 'c:/a/b/c'.pathmap_explode + assert_equal ["c:.", "a"], "c:a".pathmap_explode + assert_equal ["c:.", "a", "b"], "c:a/b".pathmap_explode + assert_equal ["c:.", "a", "b", "c"], "c:a/b/c".pathmap_explode + assert_equal ["c:/", "a"], "c:/a".pathmap_explode + assert_equal ["c:/", "a", "b"], "c:/a/b".pathmap_explode + assert_equal ["c:/", "a", "b", "c"], "c:/a/b/c".pathmap_explode end end end diff --git a/test/test_rake_path_map_partial.rb b/test/test_rake_path_map_partial.rb index 566e681bb..2a71239fe 100644 --- a/test/test_rake_path_map_partial.rb +++ b/test/test_rake_path_map_partial.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakePathMapPartial < Rake::TestCase def test_pathmap_partial diff --git a/test/test_rake_pathname_extensions.rb b/test/test_rake_pathname_extensions.rb index 7da702d0c..c0d8410d6 100644 --- a/test/test_rake_pathname_extensions.rb +++ b/test/test_rake_pathname_extensions.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'rake/ext/pathname' +require File.expand_path("../helper", __FILE__) +require "rake/ext/pathname" class TestRakePathnameExtensions < Rake::TestCase def test_ext_works_on_pathnames diff --git a/test/test_rake_pseudo_status.rb b/test/test_rake_pseudo_status.rb index 51b3fef34..d9fe42216 100644 --- a/test/test_rake_pseudo_status.rb +++ b/test/test_rake_pseudo_status.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakePseudoStatus < Rake::TestCase def test_with_zero_exit_status diff --git a/test/test_rake_rake_test_loader.rb b/test/test_rake_rake_test_loader.rb index 0485c4c8a..21c494ffe 100644 --- a/test/test_rake_rake_test_loader.rb +++ b/test/test_rake_rake_test_loader.rb @@ -1,16 +1,16 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeRakeTestLoader < Rake::TestCase def test_pattern orig_loaded_features = $:.dup - FileUtils.touch 'foo.rb' - FileUtils.touch 'test_a.rb' - FileUtils.touch 'test_b.rb' + FileUtils.touch "foo.rb" + FileUtils.touch "test_a.rb" + FileUtils.touch "test_b.rb" ARGV.replace %w[foo.rb test_*.rb -v] - load File.join(@rake_lib, 'rake/rake_test_loader.rb') + load File.join(@rake_lib, "rake/rake_test_loader.rb") assert_equal %w[-v], ARGV ensure diff --git a/test/test_rake_reduce_compat.rb b/test/test_rake_reduce_compat.rb index d29526654..de81b474b 100644 --- a/test/test_rake_reduce_compat.rb +++ b/test/test_rake_reduce_compat.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'open3' +require File.expand_path("../helper", __FILE__) +require "open3" class TestRakeReduceCompat < Rake::TestCase include RubyRunner diff --git a/test/test_rake_require.rb b/test/test_rake_require.rb index 80b5f0f1c..c77344cc3 100644 --- a/test/test_rake_require.rb +++ b/test/test_rake_require.rb @@ -1,9 +1,9 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeRequire < Rake::TestCase def setup super - $LOAD_PATH.unshift '.' if jruby17? + $LOAD_PATH.unshift "." if jruby17? end def test_can_load_rake_library @@ -11,7 +11,7 @@ def test_can_load_rake_library app = Rake::Application.new assert app.instance_eval { - rake_require("test2", ['rakelib'], []) + rake_require("test2", ["rakelib"], []) } end @@ -19,7 +19,7 @@ def test_wont_reload_rake_library rakefile_rakelib app = Rake::Application.new - paths = ['rakelib'] + paths = ["rakelib"] loaded_files = [] app.rake_require("test2", paths, loaded_files) @@ -34,7 +34,7 @@ def test_throws_error_if_library_not_found app = Rake::Application.new ex = assert_raises(LoadError) { assert app.instance_eval { - rake_require("testx", ['rakelib'], []) + rake_require("testx", ["rakelib"], []) } } assert_match(/(can *not|can't)\s+find/i, ex.message) diff --git a/test/test_rake_rules.rb b/test/test_rake_rules.rb index ee18ed7ed..6608b038b 100644 --- a/test/test_rake_rules.rb +++ b/test/test_rake_rules.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'fileutils' +require File.expand_path("../helper", __FILE__) +require "fileutils" class TestRakeRules < Rake::TestCase include Rake @@ -22,8 +22,8 @@ def test_multiple_rules1 create_file(FTNFILE) delete_file(SRCFILE) delete_file(OBJFILE) - rule(/\.o$/ => ['.c']) do @runs << :C end - rule(/\.o$/ => ['.f']) do @runs << :F end + rule(/\.o$/ => [".c"]) do @runs << :C end + rule(/\.o$/ => [".f"]) do @runs << :F end t = Task[OBJFILE] t.invoke Task[OBJFILE].invoke @@ -34,15 +34,15 @@ def test_multiple_rules2 create_file(FTNFILE) delete_file(SRCFILE) delete_file(OBJFILE) - rule(/\.o$/ => ['.f']) do @runs << :F end - rule(/\.o$/ => ['.c']) do @runs << :C end + rule(/\.o$/ => [".f"]) do @runs << :F end + rule(/\.o$/ => [".c"]) do @runs << :C end Task[OBJFILE].invoke assert_equal [:F], @runs end def test_create_with_source create_file(SRCFILE) - rule(/\.o$/ => ['.c']) do |t| + rule(/\.o$/ => [".c"]) do |t| @runs << t.name assert_equal OBJFILE, t.name assert_equal SRCFILE, t.source @@ -53,7 +53,7 @@ def test_create_with_source def test_single_dependent create_file(SRCFILE) - rule(/\.o$/ => '.c') do |t| + rule(/\.o$/ => ".c") do |t| @runs << t.name end Task[OBJFILE].invoke @@ -62,7 +62,7 @@ def test_single_dependent def test_rule_can_be_created_by_string create_file(SRCFILE) - rule '.o' => ['.c'] do |t| + rule ".o" => [".c"] do |t| @runs << t.name end Task[OBJFILE].invoke @@ -71,7 +71,7 @@ def test_rule_can_be_created_by_string def test_rule_prereqs_can_be_created_by_string create_file(SRCFILE) - rule '.o' => '.c' do |t| + rule ".o" => ".c" do |t| @runs << t.name end Task[OBJFILE].invoke @@ -80,7 +80,7 @@ def test_rule_prereqs_can_be_created_by_string def test_plain_strings_as_dependents_refer_to_files create_file(SRCFILE) - rule '.o' => SRCFILE do |t| + rule ".o" => SRCFILE do |t| @runs << t.name end Task[OBJFILE].invoke @@ -89,8 +89,8 @@ def test_plain_strings_as_dependents_refer_to_files def test_file_names_beginning_with_dot_can_be_tricked_into_referring_to_file verbose(false) do - create_file('.foo') - rule '.o' => "./.foo" do |t| + create_file(".foo") + rule ".o" => "./.foo" do |t| @runs << t.name end Task[OBJFILE].invoke @@ -102,7 +102,7 @@ def test_file_names_beginning_with_dot_can_be_wrapped_in_lambda verbose(false) do create_file(".foo") - rule '.o' => lambda { ".foo" } do |t| + rule ".o" => lambda { ".foo" } do |t| @runs << "#{t.name} - #{t.source}" end Task[OBJFILE].invoke @@ -113,7 +113,7 @@ def test_file_names_beginning_with_dot_can_be_wrapped_in_lambda def test_file_names_containing_percent_can_be_wrapped_in_lambda verbose(false) do create_file("foo%x") - rule '.o' => lambda { "foo%x" } do |t| + rule ".o" => lambda { "foo%x" } do |t| @runs << "#{t.name} - #{t.source}" end Task[OBJFILE].invoke @@ -124,7 +124,7 @@ def test_file_names_containing_percent_can_be_wrapped_in_lambda def test_non_extension_rule_name_refers_to_file verbose(false) do create_file("abc.c") - rule "abc" => '.c' do |t| + rule "abc" => ".c" do |t| @runs << t.name end Task["abc"].invoke @@ -135,7 +135,7 @@ def test_non_extension_rule_name_refers_to_file def test_pathmap_automatically_applies_to_name verbose(false) do create_file("zzabc.c") - rule ".o" => 'zz%{x,a}n.c' do |t| + rule ".o" => "zz%{x,a}n.c" do |t| @runs << "#{t.name} - #{t.source}" end Task["xbc.o"].invoke @@ -146,7 +146,7 @@ def test_pathmap_automatically_applies_to_name def test_plain_strings_are_just_filenames verbose(false) do create_file("plainname") - rule ".o" => 'plainname' do |t| + rule ".o" => "plainname" do |t| @runs << "#{t.name} - #{t.source}" end Task["xbc.o"].invoke @@ -158,7 +158,7 @@ def test_rule_runs_when_explicit_task_has_no_actions create_file(SRCFILE) create_file(SRCFILE2) delete_file(OBJFILE) - rule '.o' => '.c' do |t| + rule ".o" => ".c" do |t| @runs << t.source end file OBJFILE => [SRCFILE2] @@ -168,16 +168,16 @@ def test_rule_runs_when_explicit_task_has_no_actions def test_close_matches_on_name_do_not_trigger_rule create_file("x.c") - rule '.o' => ['.c'] do |t| + rule ".o" => [".c"] do |t| @runs << t.name end - assert_raises(RuntimeError) { Task['x.obj'].invoke } - assert_raises(RuntimeError) { Task['x.xyo'].invoke } + assert_raises(RuntimeError) { Task["x.obj"].invoke } + assert_raises(RuntimeError) { Task["x.xyo"].invoke } end def test_rule_rebuilds_obj_when_source_is_newer create_timed_files(OBJFILE, SRCFILE) - rule(/\.o$/ => ['.c']) do + rule(/\.o$/ => [".c"]) do @runs << :RULE end Task[OBJFILE].invoke @@ -204,15 +204,15 @@ def test_rule_with_two_sources_but_one_missing_does_not_run end def test_rule_with_two_sources_builds_both_sources - task 'x.aa' - task 'x.bb' - rule '.a' => '.aa' do + task "x.aa" + task "x.bb" + rule ".a" => ".aa" do @runs << "A" end - rule '.b' => '.bb' do + rule ".b" => ".bb" do @runs << "B" end - rule ".c" => ['.a', '.b'] do + rule ".c" => [".a", ".b"] do @runs << "C" end Task["x.c"].invoke @@ -262,11 +262,11 @@ def test_rule_with_proc_dependent_will_trigger rule %r(classes/.*\.class) => [ proc { |fn| fn.pathmap("%{classes,src}d/%n.java") } ] do |task| - assert_equal task.name, 'classes/jw/X.class' - assert_equal task.source, 'src/jw/X.java' + assert_equal task.name, "classes/jw/X.class" + assert_equal task.source, "src/jw/X.java" @runs << :RULE end - Task['classes/jw/X.class'].invoke + Task["classes/jw/X.class"].invoke assert_equal [:RULE], @runs ensure rm_r("src", verbose: false) rescue nil @@ -276,11 +276,11 @@ def test_proc_returning_lists_are_flattened_into_prereqs ran = false mkdir_p("flatten") create_file("flatten/a.txt") - task 'flatten/b.data' do |t| + task "flatten/b.data" do |t| ran = true touch t.name, verbose: false end - rule '.html' => + rule ".html" => proc { |fn| [ fn.ext("txt"), @@ -288,7 +288,7 @@ def test_proc_returning_lists_are_flattened_into_prereqs ] } do |task| end - Task['flatten/a.html'].invoke + Task["flatten/a.html"].invoke assert ran, "Should have triggered flattened dependency" ensure rm_r("flatten", verbose: false) rescue nil @@ -297,18 +297,18 @@ def test_proc_returning_lists_are_flattened_into_prereqs def test_recursive_rules_will_work_as_long_as_they_terminate actions = [] create_file("abc.xml") - rule '.y' => '.xml' do actions << 'y' end - rule '.c' => '.y' do actions << 'c'end - rule '.o' => '.c' do actions << 'o'end - rule '.exe' => '.o' do actions << 'exe'end + rule ".y" => ".xml" do actions << "y" end + rule ".c" => ".y" do actions << "c"end + rule ".o" => ".c" do actions << "o"end + rule ".exe" => ".o" do actions << "exe"end Task["abc.exe"].invoke - assert_equal ['y', 'c', 'o', 'exe'], actions + assert_equal ["y", "c", "o", "exe"], actions end def test_recursive_rules_that_dont_terminate_will_overflow create_file("a.a") - prev = 'a' - ('b'..'z').each do |letter| + prev = "a" + ("b".."z").each do |letter| rule ".#{letter}" => ".#{prev}" do |t| puts "#{t.name}" end prev = letter end @@ -320,43 +320,43 @@ def test_recursive_rules_that_dont_terminate_will_overflow def test_rules_with_bad_dependents_will_fail rule "a" => [1] do |t| puts t.name end - assert_raises(RuntimeError) do Task['a'].invoke end + assert_raises(RuntimeError) do Task["a"].invoke end end def test_string_rule_with_args delete_file(OBJFILE) create_file(SRCFILE) - rule '.o', [:a] => SRCFILE do |t, args| - assert_equal 'arg', args.a + rule ".o", [:a] => SRCFILE do |t, args| + assert_equal "arg", args.a end - Task[OBJFILE].invoke('arg') + Task[OBJFILE].invoke("arg") end def test_regex_rule_with_args delete_file(OBJFILE) create_file(SRCFILE) rule(/.o$/, [:a] => SRCFILE) do |t, args| - assert_equal 'arg', args.a + assert_equal "arg", args.a end - Task[OBJFILE].invoke('arg') + Task[OBJFILE].invoke("arg") end def test_string_rule_with_args_and_lambda_prereq delete_file(OBJFILE) create_file(SRCFILE) - rule '.o', [:a] => [lambda{SRCFILE}]do |t, args| - assert_equal 'arg', args.a + rule ".o", [:a] => [lambda{SRCFILE}]do |t, args| + assert_equal "arg", args.a end - Task[OBJFILE].invoke('arg') + Task[OBJFILE].invoke("arg") end def test_regex_rule_with_args_and_lambda_prereq delete_file(OBJFILE) create_file(SRCFILE) rule(/.o$/, [:a] => [lambda{SRCFILE}]) do |t, args| - assert_equal 'arg', args.a + assert_equal "arg", args.a end - Task[OBJFILE].invoke('arg') + Task[OBJFILE].invoke("arg") end def test_rule_with_method_prereq @@ -365,7 +365,7 @@ def test_rule_with_method_prereq def obj.find_prereq ".foo" end - rule '.o' => obj.method(:find_prereq) do |t| + rule ".o" => obj.method(:find_prereq) do |t| @runs << "#{t.name} - #{t.source}" end Task[OBJFILE].invoke @@ -378,7 +378,7 @@ def test_rule_with_one_arg_method_prereq def obj.find_prereq(task_name) task_name.ext(".c") end - rule '.o' => obj.method(:find_prereq) do |t| + rule ".o" => obj.method(:find_prereq) do |t| @runs << "#{t.name} - #{t.source}" end Task[OBJFILE].invoke diff --git a/test/test_rake_scope.rb b/test/test_rake_scope.rb index ef06618ba..169c0d9f9 100644 --- a/test/test_rake_scope.rb +++ b/test/test_rake_scope.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeScope < Rake::TestCase include Rake diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 91185257c..80243d83d 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'fileutils' +require File.expand_path("../helper", __FILE__) +require "fileutils" class TestRakeTask < Rake::TestCase include Rake @@ -122,7 +122,7 @@ def test_clear def test_clear_prerequisites t = task("t" => ["a", "b"]) - assert_equal ['a', 'b'], t.prerequisites + assert_equal ["a", "b"], t.prerequisites t.clear_prerequisites assert_equal [], t.prerequisites end @@ -301,7 +301,7 @@ def test_timestamp_returns_now_if_all_prereqs_have_no_times task :b task :c - assert_in_delta Time.now, a.timestamp, 0.1, 'computer too slow?' + assert_in_delta Time.now, a.timestamp, 0.1, "computer too slow?" end def test_timestamp_returns_latest_prereq_timestamp @@ -313,7 +313,7 @@ def test_timestamp_returns_latest_prereq_timestamp def b.timestamp() Time.now + 10 end def c.timestamp() Time.now + 5 end - assert_in_delta now, a.timestamp, 0.1, 'computer too slow?' + assert_in_delta now, a.timestamp, 0.1, "computer too slow?" end def test_always_multitask @@ -336,7 +336,7 @@ def test_always_multitask t_c.invoke # task should always run in order - assert_equal ['a', 'b', 'c'], result + assert_equal ["a", "b", "c"], result [t_a, t_b, t_c].each(&:reenable) result.clear @@ -345,7 +345,7 @@ def test_always_multitask t_c.invoke # with multitask, task 'b' should grab the mutex first - assert_equal ['b', 'a', 'c'], result + assert_equal ["b", "a", "c"], result end def test_investigation_output diff --git a/test/test_rake_task_argument_parsing.rb b/test/test_rake_task_argument_parsing.rb index 3cb5d9cfe..4bc0ff0ae 100644 --- a/test/test_rake_task_argument_parsing.rb +++ b/test/test_rake_task_argument_parsing.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeTaskArgumentParsing < Rake::TestCase def setup @@ -95,21 +95,21 @@ def @app.unix?() raise end end def test_no_rakeopt - ARGV << '--trace' + ARGV << "--trace" app = Rake::Application.new app.init assert !app.options.silent end def test_rakeopt_with_blank_options - ARGV << '--trace' + ARGV << "--trace" app = Rake::Application.new app.init assert !app.options.silent end def test_rakeopt_with_silent_options - ENV['RAKEOPT'] = '-s' + ENV["RAKEOPT"] = "-s" app = Rake::Application.new app.init diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index bf2b4cd42..22e84c448 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -1,10 +1,10 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) ###################################################################### class TestRakeTaskArguments < Rake::TestCase def teardown - ENV.delete('rev') - ENV.delete('VER') + ENV.delete("rev") + ENV.delete("VER") super end @@ -20,7 +20,7 @@ def test_multiple_values_in_args end def test_blank_values_in_args - ta = Rake::TaskArguments.new([:a, :b, :c], ['', :two, '']) + ta = Rake::TaskArguments.new([:a, :b, :c], ["", :two, ""]) assert_equal({b: :two}, ta.to_hash) end @@ -69,15 +69,15 @@ def test_extra_names_are_nil def test_args_do_not_reference_env_values ta = Rake::TaskArguments.new(["aa"], [1]) - ENV['rev'] = "1.2" - ENV['VER'] = "2.3" + ENV["rev"] = "1.2" + ENV["VER"] = "2.3" assert_nil ta.rev assert_nil ta.ver end def test_creating_new_argument_scopes - parent = Rake::TaskArguments.new(['p'], [1]) - child = parent.new_scope(['c', 'p']) + parent = Rake::TaskArguments.new(["p"], [1]) + child = parent.new_scope(["c", "p"]) assert_equal({p: 1}, child.to_hash) assert_equal 1, child.p assert_equal 1, child["p"] @@ -86,16 +86,16 @@ def test_creating_new_argument_scopes end def test_child_hides_parent_arg_names - parent = Rake::TaskArguments.new(['aa'], [1]) - child = Rake::TaskArguments.new(['aa'], [2], parent) + parent = Rake::TaskArguments.new(["aa"], [1]) + child = Rake::TaskArguments.new(["aa"], [2], parent) assert_equal 2, child.aa end def test_default_arguments_values_can_be_merged ta = Rake::TaskArguments.new(["aa", "bb"], [nil, "original_val"]) - ta.with_defaults({ aa: 'default_val' }) - assert_equal 'default_val', ta[:aa] - assert_equal 'original_val', ta[:bb] + ta.with_defaults({ aa: "default_val" }) + assert_equal "default_val", ta[:aa] + assert_equal "original_val", ta[:bb] end def test_default_arguments_that_dont_match_names_are_ignored @@ -109,8 +109,8 @@ def test_all_and_extra_arguments_without_named_arguments _, args = app.parse_task_string("task[1,two,more]") ta = Rake::TaskArguments.new([], args) assert_equal [], ta.names - assert_equal ['1', 'two', 'more'], ta.to_a - assert_equal ['1', 'two', 'more'], ta.extras + assert_equal ["1", "two", "more"], ta.to_a + assert_equal ["1", "two", "more"], ta.extras end def test_all_and_extra_arguments_with_named_arguments @@ -120,8 +120,8 @@ def test_all_and_extra_arguments_with_named_arguments assert_equal [:first, :second], ta.names assert_equal "1", ta[:first] assert_equal "two", ta[:second] - assert_equal ['1', 'two', 'more', 'still more'], ta.to_a - assert_equal ['more', 'still more'], ta.extras + assert_equal ["1", "two", "more", "still more"], ta.to_a + assert_equal ["more", "still more"], ta.extras end def test_extra_args_with_less_than_named_arguments @@ -132,7 +132,7 @@ def test_extra_args_with_less_than_named_arguments assert_equal "1", ta[:first] assert_equal "two", ta[:second] assert_equal nil, ta[:third] - assert_equal ['1', 'two'], ta.to_a + assert_equal ["1", "two"], ta.to_a assert_equal [], ta.extras end diff --git a/test/test_rake_task_manager.rb b/test/test_rake_task_manager.rb index 6f27a3d08..a611bd737 100644 --- a/test/test_rake_task_manager.rb +++ b/test/test_rake_task_manager.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeTaskManager < Rake::TestCase @@ -21,7 +21,7 @@ def test_define_task def test_index e = assert_raises RuntimeError do - @tm['bad'] + @tm["bad"] end assert_equal "Don't know how to build task 'bad' (see --tasks)", e.message @@ -41,7 +41,7 @@ def test_namespace_task_create end def test_define_namespaced_task - t = @tm.define_task(Rake::Task, 'n:a:m:e:t') + t = @tm.define_task(Rake::Task, "n:a:m:e:t") assert_equal Rake::Scope.make("e", "m", "a", "n"), t.scope assert_equal "n:a:m:e:t", t.name assert_equal @tm, t.application @@ -50,7 +50,7 @@ def test_define_namespaced_task def test_define_namespace_in_namespace t = nil @tm.in_namespace("n") do - t = @tm.define_task(Rake::Task, 'a:m:e:t') + t = @tm.define_task(Rake::Task, "a:m:e:t") end assert_equal Rake::Scope.make("e", "m", "a", "n"), t.scope assert_equal "n:a:m:e:t", t.name @@ -84,7 +84,7 @@ def test_namespace_yields_same_namespace_as_returned end def test_name_lookup_with_implicit_file_tasks - FileUtils.touch 'README.rdoc' + FileUtils.touch "README.rdoc" t = @tm["README.rdoc"] @@ -141,8 +141,8 @@ def test_name_lookup_in_multiple_scopes assert_equal Rake::Scope.make, @tm.current_scope assert_equal Rake::Scope.make, xx.scope - assert_equal Rake::Scope.make('a'), aa.scope - assert_equal Rake::Scope.make('b', 'a'), bb.scope + assert_equal Rake::Scope.make("a"), aa.scope + assert_equal Rake::Scope.make("b", "a"), bb.scope end def test_lookup_with_explicit_scopes diff --git a/test/test_rake_task_manager_argument_resolution.rb b/test/test_rake_task_manager_argument_resolution.rb index 2aa69aa19..6d292816d 100644 --- a/test/test_rake_task_manager_argument_resolution.rb +++ b/test/test_rake_task_manager_argument_resolution.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeTaskManagerArgumentResolution < Rake::TestCase diff --git a/test/test_rake_task_with_arguments.rb b/test/test_rake_task_with_arguments.rb index 022854df6..64001c5a9 100644 --- a/test/test_rake_task_with_arguments.rb +++ b/test/test_rake_task_with_arguments.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeTaskWithArguments < Rake::TestCase include Rake diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index caa4c3a3d..9b3450334 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'rake/testtask' +require File.expand_path("../helper", __FILE__) +require "rake/testtask" class TestRakeTestTask < Rake::TestCase include Rake @@ -8,8 +8,8 @@ def test_initialize tt = Rake::TestTask.new do |t| end refute_nil tt assert_equal :test, tt.name - assert_equal ['lib'], tt.libs - assert_equal 'test/test*.rb', tt.pattern + assert_equal ["lib"], tt.libs + assert_equal "test/test*.rb", tt.pattern assert_equal false, tt.verbose assert_equal true, tt.warning assert_equal [], tt.deps @@ -33,8 +33,8 @@ def test_initialize_multi_deps def test_initialize_override tt = Rake::TestTask.new(example: :bar) do |t| t.description = "Run example tests" - t.libs = ['src', 'ext'] - t.pattern = 'test/tc_*.rb' + t.libs = ["src", "ext"] + t.pattern = "test/tc_*.rb" t.warning = true t.verbose = true t.deps = [:env] @@ -42,8 +42,8 @@ def test_initialize_override refute_nil tt assert_equal "Run example tests", tt.description assert_equal :example, tt.name - assert_equal ['src', 'ext'], tt.libs - assert_equal 'test/tc_*.rb', tt.pattern + assert_equal ["src", "ext"], tt.libs + assert_equal "test/tc_*.rb", tt.pattern assert_equal true, tt.warning assert_equal true, tt.verbose assert_equal [:env], tt.deps @@ -52,14 +52,14 @@ def test_initialize_override end def test_file_list_env_test - ENV['TEST'] = 'testfile.rb' + ENV["TEST"] = "testfile.rb" tt = Rake::TestTask.new do |t| - t.pattern = '*' + t.pattern = "*" end assert_equal ["testfile.rb"], tt.file_list.to_a ensure - ENV.delete 'TEST' + ENV.delete "TEST" end def test_libs_equals @@ -78,22 +78,22 @@ def test_libs_equals_empty t.warning = false end - assert_equal '', test_task.ruby_opts_string + assert_equal "", test_task.ruby_opts_string end def test_pattern_equals tt = Rake::TestTask.new do |t| - t.pattern = '*.rb' + t.pattern = "*.rb" end - assert_equal ['*.rb'], tt.file_list.to_a + assert_equal ["*.rb"], tt.file_list.to_a end def test_pattern_equals_test_files_equals tt = Rake::TestTask.new do |t| - t.test_files = FileList['a.rb', 'b.rb'] - t.pattern = '*.rb' + t.test_files = FileList["a.rb", "b.rb"] + t.pattern = "*.rb" end - assert_equal ['a.rb', 'b.rb', '*.rb'], tt.file_list.to_a + assert_equal ["a.rb", "b.rb", "*.rb"], tt.file_list.to_a end def test_run_code_direct @@ -105,9 +105,9 @@ def test_run_code_direct end def test_run_code_rake - spec = Gem::Specification.new 'rake', 0 - spec.loaded_from = File.join Gem::Specification.dirs.last, 'rake-0.gemspec' - rake, Gem.loaded_specs['rake'] = Gem.loaded_specs['rake'], spec + spec = Gem::Specification.new "rake", 0 + spec.loaded_from = File.join Gem::Specification.dirs.last, "rake-0.gemspec" + rake, Gem.loaded_specs["rake"] = Gem.loaded_specs["rake"], spec test_task = Rake::TestTask.new do |t| t.loader = :rake @@ -115,15 +115,15 @@ def test_run_code_rake assert_match(/\A-I".*?" ".*?"\Z/, test_task.run_code) ensure - Gem.loaded_specs['rake'] = rake + Gem.loaded_specs["rake"] = rake end def test_test_files_equals tt = Rake::TestTask.new do |t| - t.test_files = FileList['a.rb', 'b.rb'] + t.test_files = FileList["a.rb", "b.rb"] end - assert_equal ["a.rb", 'b.rb'], tt.file_list.to_a + assert_equal ["a.rb", "b.rb"], tt.file_list.to_a end def test_task_prerequisites @@ -131,7 +131,7 @@ def test_task_prerequisites Rake::TestTask.new child: :parent task = Rake::Task[:child] - assert_includes task.prerequisites, 'parent' + assert_includes task.prerequisites, "parent" end def test_task_prerequisites_multi @@ -140,8 +140,8 @@ def test_task_prerequisites_multi Rake::TestTask.new child: [:parent, :parent2] task = Rake::Task[:child] - assert_includes task.prerequisites, 'parent' - assert_includes task.prerequisites, 'parent2' + assert_includes task.prerequisites, "parent" + assert_includes task.prerequisites, "parent2" end def test_task_prerequisites_deps @@ -152,6 +152,6 @@ def test_task_prerequisites_deps end task = Rake::Task[:child] - assert_includes task.prerequisites, 'parent' + assert_includes task.prerequisites, "parent" end end diff --git a/test/test_rake_thread_pool.rb b/test/test_rake_thread_pool.rb index 62dc59d00..d365574ba 100644 --- a/test/test_rake_thread_pool.rb +++ b/test/test_rake_thread_pool.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'rake/thread_pool' +require File.expand_path("../helper", __FILE__) +require "rake/thread_pool" class TestRakeTestThreadPool < Rake::TestCase include Rake diff --git a/test/test_rake_top_level_functions.rb b/test/test_rake_top_level_functions.rb index fee702dc1..a3bb2fbb8 100644 --- a/test/test_rake_top_level_functions.rb +++ b/test/test_rake_top_level_functions.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeTopLevelFunctions < Rake::TestCase @@ -26,19 +26,19 @@ def test_namespace namespace("xyz", &block) expected = [ - [[:in_namespace, 'xyz'], block] + [[:in_namespace, "xyz"], block] ] assert_equal expected, @app.called end def test_import - import('x', 'y', 'z') + import("x", "y", "z") expected = [ - [[:add_import, 'x'], nil], - [[:add_import, 'y'], nil], - [[:add_import, 'z'], nil], + [[:add_import, "x"], nil], + [[:add_import, "y"], nil], + [[:add_import, "z"], nil], ] assert_equal expected, @app.called diff --git a/test/test_rake_win32.rb b/test/test_rake_win32.rb index fc2746a0a..decb18f08 100644 --- a/test/test_rake_win32.rb +++ b/test/test_rake_win32.rb @@ -1,50 +1,50 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) class TestRakeWin32 < Rake::TestCase Win32 = Rake::Win32 def test_win32_system_dir_uses_home_if_defined - ENV['HOME'] = 'C:\\HP' + ENV["HOME"] = 'C:\\HP' assert_equal "C:/HP/Rake", Win32.win32_system_dir end def test_win32_system_dir_uses_homedrive_homepath_when_no_home_defined - ENV['HOME'] = nil - ENV['HOMEDRIVE'] = 'C:' - ENV['HOMEPATH'] = '\\HP' + ENV["HOME"] = nil + ENV["HOMEDRIVE"] = "C:" + ENV["HOMEPATH"] = '\\HP' assert_equal "C:/HP/Rake", Win32.win32_system_dir end def test_win32_system_dir_uses_appdata_when_no_home_or_home_combo - ENV['APPDATA'] = "C:\\Documents and Settings\\HP\\Application Data" - ENV['HOME'] = nil - ENV['HOMEDRIVE'] = nil - ENV['HOMEPATH'] = nil + ENV["APPDATA"] = "C:\\Documents and Settings\\HP\\Application Data" + ENV["HOME"] = nil + ENV["HOMEDRIVE"] = nil + ENV["HOMEPATH"] = nil assert_equal "C:/Documents and Settings/HP/Application Data/Rake", Win32.win32_system_dir end def test_win32_system_dir_fallback_to_userprofile_otherwise - ENV['HOME'] = nil - ENV['HOMEDRIVE'] = nil - ENV['HOMEPATH'] = nil - ENV['APPDATA'] = nil - ENV['USERPROFILE'] = "C:\\Documents and Settings\\HP" + ENV["HOME"] = nil + ENV["HOMEDRIVE"] = nil + ENV["HOMEPATH"] = nil + ENV["APPDATA"] = nil + ENV["USERPROFILE"] = "C:\\Documents and Settings\\HP" assert_equal "C:/Documents and Settings/HP/Rake", Win32.win32_system_dir end def test_win32_system_dir_nil_of_no_env_vars - ENV['APPDATA'] = nil - ENV['HOME'] = nil - ENV['HOMEDRIVE'] = nil - ENV['HOMEPATH'] = nil - ENV['RAKE_SYSTEM'] = nil - ENV['USERPROFILE'] = nil + ENV["APPDATA"] = nil + ENV["HOME"] = nil + ENV["HOMEDRIVE"] = nil + ENV["HOMEPATH"] = nil + ENV["RAKE_SYSTEM"] = nil + ENV["USERPROFILE"] = nil assert_raises(Rake::Win32::Win32HomeError) do Win32.win32_system_dir @@ -54,15 +54,15 @@ def test_win32_system_dir_nil_of_no_env_vars def test_win32_backtrace_with_different_case ex = nil begin - raise 'test exception' + raise "test exception" rescue => ex end - ex.set_backtrace ['abc', 'rakefile'] + ex.set_backtrace ["abc", "rakefile"] rake = Rake::Application.new rake.options.trace = true - rake.instance_variable_set(:@rakefile, 'Rakefile') + rake.instance_variable_set(:@rakefile, "Rakefile") _, err = capture_io { rake.display_error_message(ex) } diff --git a/test/test_thread_history_display.rb b/test/test_thread_history_display.rb index 6529302ce..f3466cef7 100644 --- a/test/test_thread_history_display.rb +++ b/test/test_thread_history_display.rb @@ -1,6 +1,6 @@ -require File.expand_path('../helper', __FILE__) +require File.expand_path("../helper", __FILE__) -require 'rake/thread_history_display' +require "rake/thread_history_display" class TestThreadHistoryDisplay < Rake::TestCase def setup diff --git a/test/test_trace_output.rb b/test/test_trace_output.rb index f9aead989..18d2eee0f 100644 --- a/test/test_trace_output.rb +++ b/test/test_trace_output.rb @@ -1,5 +1,5 @@ -require File.expand_path('../helper', __FILE__) -require 'stringio' +require File.expand_path("../helper", __FILE__) +require "stringio" class TestTraceOutput < Rake::TestCase include Rake::TraceOutput From b061c4cd24d61952b1357028da6a154bd7d84e80 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:25:51 +0900 Subject: [PATCH 068/108] order --- .rubocop.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 0fe6f92e9..538cd67e4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,19 +4,19 @@ AllCops: Exclude: - rake.gemspec -Style/StringLiterals: +LineLength: Enabled: true - EnforcedStyle: double_quotes - -SpaceAroundEqualsInParameterDefault: - Enabled: false + Max: 120 Style/HashSyntax: Enabled: true -LineLength: +Style/StringLiterals: Enabled: true - Max: 120 + EnforcedStyle: double_quotes + +SpaceAroundEqualsInParameterDefault: + Enabled: false WhileUntilModifier: Enabled: false From c4f34774136e376aa44358f51c0161bc05fb2c4d Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:34:13 +0900 Subject: [PATCH 069/108] adjust indentations --- .rubocop.yml | 7 +++++++ lib/rake/thread_pool.rb | 2 +- test/test_rake_application.rb | 4 ++-- test/test_rake_file_task.rb | 8 ++++---- test/test_rake_win32.rb | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 538cd67e4..9a18ef736 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,7 @@ AllCops: TargetRubyVersion: 2.3 DisabledByDefault: true Exclude: + - doc/**/*.rb - rake.gemspec LineLength: @@ -15,6 +16,12 @@ Style/StringLiterals: Enabled: true EnforcedStyle: double_quotes +Style/IndentationWidth: + Enabled: true + +Style/Tab: + Enabled: true + SpaceAroundEqualsInParameterDefault: Enabled: false diff --git a/lib/rake/thread_pool.rb b/lib/rake/thread_pool.rb index 370caa18c..1c2f5f50f 100644 --- a/lib/rake/thread_pool.rb +++ b/lib/rake/thread_pool.rb @@ -103,7 +103,7 @@ def process_queue_item #:nodoc: promise.work return true - rescue ThreadError # this means the queue is empty + rescue ThreadError # this means the queue is empty false end diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index 740579737..e5b7aa0e7 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -515,7 +515,7 @@ def test_bad_run_with_backtrace def test_bad_run_includes_exception_name @app.intern(Rake::Task, "default").enhance { - raise CustomError, "intentional" + raise CustomError, "intentional" } setup_command_line("-f", "-s") _, err = capture_io { @@ -535,7 +535,7 @@ def test_rake_error_excludes_exception_name assert_raises(SystemExit) { @app.run } - } + } refute_match(/RuntimeError/, err) assert_match(/intentional/, err) end diff --git a/test/test_rake_file_task.rb b/test/test_rake_file_task.rb index e6caf2a46..6330886d9 100644 --- a/test/test_rake_file_task.rb +++ b/test/test_rake_file_task.rb @@ -160,12 +160,12 @@ def test_sources_is_all_prerequisites end def test_task_can_be_pathname - name = "dummy" - file Pathname.new name + name = "dummy" + file Pathname.new name - ftask = Task[name] + ftask = Task[name] - assert_equal name.to_s, ftask.name + assert_equal name.to_s, ftask.name end def test_prerequisite_can_be_pathname diff --git a/test/test_rake_win32.rb b/test/test_rake_win32.rb index decb18f08..be95adb92 100644 --- a/test/test_rake_win32.rb +++ b/test/test_rake_win32.rb @@ -54,7 +54,7 @@ def test_win32_system_dir_nil_of_no_env_vars def test_win32_backtrace_with_different_case ex = nil begin - raise "test exception" + raise "test exception" rescue => ex end From 468d03a660b9ddf0e63863b83ed3e54bf4946fe2 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:34:42 +0900 Subject: [PATCH 070/108] full name --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 9a18ef736..2f710f12d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ AllCops: - doc/**/*.rb - rake.gemspec -LineLength: +Style/LineLength: Enabled: true Max: 120 From c969db3abc80da65f7985761149a21ff722d453e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:38:55 +0900 Subject: [PATCH 071/108] removed extra white lines --- .rubocop.yml | 9 +++++++++ lib/rake/name_space.rb | 1 - test/test_rake_application.rb | 1 - test/test_rake_extension.rb | 1 - test/test_rake_file_list_path_map.rb | 1 - test/test_rake_path_map_explode.rb | 1 - test/test_rake_path_map_partial.rb | 1 - 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 2f710f12d..fd03511ba 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -22,6 +22,15 @@ Style/IndentationWidth: Style/Tab: Enabled: true +Style/EmptyLines: + Enabled: true + +Style/TrailingBlankLines: + Enabled: true + +Style/TrailingWhitespace: + Enabled: true + SpaceAroundEqualsInParameterDefault: Enabled: false diff --git a/lib/rake/name_space.rb b/lib/rake/name_space.rb index 58f911e43..0d7eb80b6 100644 --- a/lib/rake/name_space.rb +++ b/lib/rake/name_space.rb @@ -35,4 +35,3 @@ def tasks end end - diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index e5b7aa0e7..8e932214a 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -293,7 +293,6 @@ def test_load_rakefile_not_found options.silent = true end - ex = assert_raises(RuntimeError) do @app.instance_eval do raw_load_rakefile diff --git a/test/test_rake_extension.rb b/test/test_rake_extension.rb index f9b2e2885..293ec1304 100644 --- a/test/test_rake_extension.rb +++ b/test/test_rake_extension.rb @@ -29,7 +29,6 @@ def ok_method end end - DUP_ERRS = error_redirect do rake_extension("duplicate_method") do def duplicate_method diff --git a/test/test_rake_file_list_path_map.rb b/test/test_rake_file_list_path_map.rb index b75d040d7..28953a97a 100644 --- a/test/test_rake_file_list_path_map.rb +++ b/test/test_rake_file_list_path_map.rb @@ -12,4 +12,3 @@ def test_file_list_supports_pathmap_with_a_block assert_equal ["A", "B"], mapped end end - diff --git a/test/test_rake_path_map_explode.rb b/test/test_rake_path_map_explode.rb index 5845abf90..554a02266 100644 --- a/test/test_rake_path_map_explode.rb +++ b/test/test_rake_path_map_explode.rb @@ -31,4 +31,3 @@ def test_explode end end end - diff --git a/test/test_rake_path_map_partial.rb b/test/test_rake_path_map_partial.rb index 2a71239fe..0adc24313 100644 --- a/test/test_rake_path_map_partial.rb +++ b/test/test_rake_path_map_partial.rb @@ -15,4 +15,3 @@ def @path.call(n) assert_equal("1/2", @path.call(-3)) end end - From a652a3b23ff9f9e029193152cfbec28f5e9877f6 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:40:37 +0900 Subject: [PATCH 072/108] removed unused cops --- .rubocop.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index fd03511ba..5aad6f666 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -30,12 +30,3 @@ Style/TrailingBlankLines: Style/TrailingWhitespace: Enabled: true - -SpaceAroundEqualsInParameterDefault: - Enabled: false - -WhileUntilModifier: - Enabled: false - -IfUnlessModifier: - Enabled: false From 63191d51f38374329ee1222b8973dd3d5bda4314 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:47:34 +0900 Subject: [PATCH 073/108] added space cop inside/outside blocks --- .rubocop.yml | 9 +++++++++ lib/rake/task_manager.rb | 2 +- test/support/ruby_runner.rb | 4 ++-- test/test_rake_application.rb | 2 +- test/test_rake_file_list.rb | 2 +- test/test_rake_rules.rb | 4 ++-- test/test_rake_task.rb | 4 ++-- test/test_rake_task_arguments.rb | 6 +++--- test/test_rake_task_with_arguments.rb | 6 +++--- 9 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 5aad6f666..299794a46 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -30,3 +30,12 @@ Style/TrailingBlankLines: Style/TrailingWhitespace: Enabled: true + +Style/SpaceBeforeBlockBraces: + Enabled: true + +Style/SpaceInsideBlockBraces: + Enabled: true + +Style/SpaceInsideHashLiteralBraces: + Enabled: true diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index 960d70654..9b3c0efb3 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -256,7 +256,7 @@ def attempt_rule(task_name, args, extensions, block, level) return nil end } - task = FileTask.define_task(task_name, {args => prereqs}, &block) + task = FileTask.define_task(task_name, { args => prereqs }, &block) task.sources = prereqs task end diff --git a/test/support/ruby_runner.rb b/test/support/ruby_runner.rb index d51dd24b8..199f60dd6 100644 --- a/test/support/ruby_runner.rb +++ b/test/support/ruby_runner.rb @@ -18,13 +18,13 @@ def rake(*rake_options) def run_ruby(option_list) puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose - Open3.popen3(RUBY, *option_list) {|inn, out, err, wait| + Open3.popen3(RUBY, *option_list) do |inn, out, err, wait| inn.close @exit = wait ? wait.value : $? @out = out.read @err = err.read - } + end puts "OUTPUT: [#{@out}]" if @verbose puts "ERROR: [#{@err}]" if @verbose diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index 8e932214a..85b55b013 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -479,7 +479,7 @@ def test_bad_run @app.intern(Rake::Task, "default").enhance { fail } setup_command_line("-f", "-s", '--rakelib=""') _, err = capture_io { - assert_raises(SystemExit){ @app.run } + assert_raises(SystemExit) { @app.run } } assert_match(/see full trace/i, err) ensure diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index aaf818b86..b910b7b9f 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -377,7 +377,7 @@ def test_gsub! def test_egrep_returns_0_if_no_matches files = FileList["test/lib/*_test.rb"].exclude("test/lib/filelist_test.rb") - assert_equal 0, files.egrep(/XYZZY/) { } + assert_equal 0, files.egrep(/XYZZY/) {} end def test_egrep_with_output diff --git a/test/test_rake_rules.rb b/test/test_rake_rules.rb index 6608b038b..7806ed11c 100644 --- a/test/test_rake_rules.rb +++ b/test/test_rake_rules.rb @@ -344,7 +344,7 @@ def test_regex_rule_with_args def test_string_rule_with_args_and_lambda_prereq delete_file(OBJFILE) create_file(SRCFILE) - rule ".o", [:a] => [lambda{SRCFILE}]do |t, args| + rule ".o", [:a] => [lambda { SRCFILE }]do |t, args| assert_equal "arg", args.a end Task[OBJFILE].invoke("arg") @@ -353,7 +353,7 @@ def test_string_rule_with_args_and_lambda_prereq def test_regex_rule_with_args_and_lambda_prereq delete_file(OBJFILE) create_file(SRCFILE) - rule(/.o$/, [:a] => [lambda{SRCFILE}]) do |t, args| + rule(/.o$/, [:a] => [lambda { SRCFILE }]) do |t, args| assert_equal "arg", args.a end Task[OBJFILE].invoke("arg") diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 80243d83d..36d50fe9f 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -112,7 +112,7 @@ def test_can_double_invoke_with_reenable def test_clear desc "a task" - t = task("t", ["b"] => "a") { } + t = task("t", ["b"] => "a") {} t.clear assert t.prerequisites.empty?, "prerequisites should be empty" assert t.actions.empty?, "actions should be empty" @@ -128,7 +128,7 @@ def test_clear_prerequisites end def test_clear_actions - t = task("t") { } + t = task("t") {} t.clear_actions assert t.actions.empty?, "actions should be empty" end diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index 22e84c448..abf010c81 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -16,12 +16,12 @@ def test_empty_arg_list_is_empty def test_multiple_values_in_args ta = Rake::TaskArguments.new([:a, :b, :c], [:one, :two, :three]) - assert_equal({a: :one, b: :two, c: :three}, ta.to_hash) + assert_equal({ a: :one, b: :two, c: :three }, ta.to_hash) end def test_blank_values_in_args ta = Rake::TaskArguments.new([:a, :b, :c], ["", :two, ""]) - assert_equal({b: :two}, ta.to_hash) + assert_equal({ b: :two }, ta.to_hash) end def test_has_key @@ -78,7 +78,7 @@ def test_args_do_not_reference_env_values def test_creating_new_argument_scopes parent = Rake::TaskArguments.new(["p"], [1]) child = parent.new_scope(["c", "p"]) - assert_equal({p: 1}, child.to_hash) + assert_equal({ p: 1 }, child.to_hash) assert_equal 1, child.p assert_equal 1, child["p"] assert_equal 1, child[:p] diff --git a/test/test_rake_task_with_arguments.rb b/test/test_rake_task_with_arguments.rb index 64001c5a9..ba28d11f9 100644 --- a/test/test_rake_task_with_arguments.rb +++ b/test/test_rake_task_with_arguments.rb @@ -48,7 +48,7 @@ def test_arg_list_is_empty_if_no_args_given def test_tasks_can_access_arguments_as_hash t = task :t, :a, :b, :c do |tt, args| - assert_equal({a: 1, b: 2, c: 3}, args.to_hash) + assert_equal({ a: 1, b: 2, c: 3 }, args.to_hash) assert_equal 1, args[:a] assert_equal 2, args[:b] assert_equal 3, args[:c] @@ -74,7 +74,7 @@ def test_actions_of_various_arity_are_ok_with_args t.enhance do |t2, args| notes << :d assert_equal t, t2 - assert_equal({x: 1}, args.to_hash) + assert_equal({ x: 1 }, args.to_hash) end t.invoke(1) assert_equal [:a, :b, :c, :d], notes @@ -111,7 +111,7 @@ def test_arguments_are_passed_to_all_blocks end def test_block_with_no_parameters_is_ok - t = task(:t) { } + t = task(:t) {} t.invoke(1, 2) end From e5f59e5c1a71fc29e2625f7a37c30c0c622d98db Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:53:47 +0900 Subject: [PATCH 074/108] adopt condition indentation and end alignment --- .rubocop.yml | 7 +++++++ test/test_rake_file_list.rb | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 299794a46..8fd6b5bfe 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -39,3 +39,10 @@ Style/SpaceInsideBlockBraces: Style/SpaceInsideHashLiteralBraces: Enabled: true + +Style/CaseIndentation: + Enabled: true + +Lint/EndAlignment: + Enabled: true + AlignWith: variable diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index b910b7b9f..32ca7a8e3 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -665,10 +665,10 @@ def test_special_return_delegating_methods_object_type FileList::SPECIAL_RETURN.each do |m| r = if [].method(m).arity == 1 - f.send(m, []) - else - f.send(m) - end + f.send(m, []) + else + f.send(m) + end assert_equal custom_file_list, r.class end From e824318a287818ec70cdec0c91b0ebad31b9bad7 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:55:47 +0900 Subject: [PATCH 075/108] use parentheses on method definitions --- .rubocop.yml | 3 +++ test/test_rake_application.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 8fd6b5bfe..0b69061f9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -43,6 +43,9 @@ Style/SpaceInsideHashLiteralBraces: Style/CaseIndentation: Enabled: true +Style/MethodDefParentheses: + Enabled: true + Lint/EndAlignment: Enabled: true AlignWith: variable diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index 85b55b013..c60dd8e4e 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -642,7 +642,7 @@ def util_loader loader = Object.new loader.instance_variable_set :@load_called, false - def loader.load arg + def loader.load(arg) raise ArgumentError, arg unless arg == "x.dummy" @load_called = true end From bc3ec67b6c76762ffeb5d1c4533ae235566d459e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 17:58:25 +0900 Subject: [PATCH 076/108] removed redundant braces --- .rubocop.yml | 3 +++ test/test_rake_task_arguments.rb | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 0b69061f9..2c89933e7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -46,6 +46,9 @@ Style/CaseIndentation: Style/MethodDefParentheses: Enabled: true +Style/BracesAroundHashParameters: + Enabled: true + Lint/EndAlignment: Enabled: true AlignWith: variable diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index abf010c81..fd7165a3d 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -93,14 +93,14 @@ def test_child_hides_parent_arg_names def test_default_arguments_values_can_be_merged ta = Rake::TaskArguments.new(["aa", "bb"], [nil, "original_val"]) - ta.with_defaults({ aa: "default_val" }) + ta.with_defaults(aa: "default_val") assert_equal "default_val", ta[:aa] assert_equal "original_val", ta[:bb] end def test_default_arguments_that_dont_match_names_are_ignored ta = Rake::TaskArguments.new(["aa", "bb"], [nil, "original_val"]) - ta.with_defaults({ "cc" => "default_val" }) + ta.with_defaults("cc" => "default_val") assert_nil ta[:cc] end From 3352b5f2cd9b0964f6eb7926f95ab642e37c5782 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Sep 2016 18:03:51 +0900 Subject: [PATCH 077/108] removed then --- .rubocop.yml | 3 +++ lib/rake/task_manager.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 2c89933e7..acdf2e117 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -43,6 +43,9 @@ Style/SpaceInsideHashLiteralBraces: Style/CaseIndentation: Enabled: true +Style/MultilineIfThen: + Enabled: true + Style/MethodDefParentheses: Enabled: true diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index 9b3c0efb3..b62edc8e3 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -24,7 +24,7 @@ def define_task(task_class, *args, &block) # :nodoc: original_scope = @scope if String === task_name and - not task_class.ancestors.include? Rake::FileTask then + not task_class.ancestors.include? Rake::FileTask task_name, *definition_scope = *(task_name.split(":").reverse) @scope = Scope.make(*(definition_scope + @scope.to_a)) end From 126d3ad412f8bf4a1e12f2ad324bdc70d9ea3ce4 Mon Sep 17 00:00:00 2001 From: jimweirich Date: Sun, 25 Jul 2004 03:59:46 +0000 Subject: [PATCH 078/108] Revert 0712aed to 0f28752 --- lib/rake/testtask.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 4fb871e46..40218ae53 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -155,7 +155,7 @@ def file_list # :nodoc: else result = [] result += @test_files.to_a if @test_files - result << @pattern if @pattern + result += FileList[@pattern].to_a if @pattern result end end From c04b7bf32fefc760a046084923bc371ddeb1b20e Mon Sep 17 00:00:00 2001 From: Code Ass Date: Fri, 2 Sep 2016 04:36:23 +0900 Subject: [PATCH 079/108] Fix t.pattern test, it supports glob --- test/test_rake_test_task.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 9b3450334..8d25c3d05 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -82,18 +82,24 @@ def test_libs_equals_empty end def test_pattern_equals + ['gl.rb', 'ob.rb'].each do |f| + create_file(f) + end tt = Rake::TestTask.new do |t| t.pattern = "*.rb" end - assert_equal ["*.rb"], tt.file_list.to_a + assert_equal ["gl.rb", "ob.rb"], tt.file_list.to_a end def test_pattern_equals_test_files_equals + ['gl.rb', 'ob.rb'].each do |f| + create_file(f) + end tt = Rake::TestTask.new do |t| t.test_files = FileList["a.rb", "b.rb"] t.pattern = "*.rb" end - assert_equal ["a.rb", "b.rb", "*.rb"], tt.file_list.to_a + assert_equal ["a.rb", "b.rb", "gl.rb", "ob.rb"], tt.file_list.to_a end def test_run_code_direct From 038cef6eaa2c94b650f512d510ef2b4ba0037fe1 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 9 Sep 2016 13:32:15 +0900 Subject: [PATCH 080/108] multiline --- rake.gemspec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index f5151fd1d..21c3f9cde 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -9,7 +9,17 @@ Gem::Specification.new do |s| s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze] s.summary = "Rake is a Make-like program implemented in Ruby".freeze - s.description = "Rake is a Make-like program implemented in Ruby. Tasks and dependencies are\nspecified in standard Ruby syntax.\n\nRake has the following features:\n\n* Rakefiles (rake's version of Makefiles) are completely defined in\n standard Ruby syntax. No XML files to edit. No quirky Makefile\n syntax to worry about (is that a tab or a space?)\n\n* Users can specify tasks with prerequisites.\n\n* Rake supports rule patterns to synthesize implicit tasks.\n\n* Flexible FileLists that act like arrays but know about manipulating\n file names and paths.\n\n* Supports parallel execution of tasks.".freeze + s.description = <<-DESCRIPTION +Rake is a Make-like program implemented in Ruby. Tasks and dependencies are +specified in standard Ruby syntax. +Rake has the following features: + * Rakefiles (rake's version of Makefiles) are completely defined in standard Ruby syntax. + No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?) + * Users can specify tasks with prerequisites. + * Rake supports rule patterns to synthesize implicit tasks. + * Flexible FileLists that act like arrays but know about manipulating file names and paths. + * Supports parallel execution of tasks. + DESCRIPTION s.homepage = "https://github.com/ruby/rake".freeze s.licenses = ["MIT".freeze] From 65b643209d82e7f04f5568aa1c22d3969fef3f2a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 10 Sep 2016 10:51:57 +0900 Subject: [PATCH 081/108] No Fixnum --- lib/rake.rb | 1 - lib/rake/application.rb | 2 +- lib/rake/ext/fixnum.rb | 18 ------------------ 3 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 lib/rake/ext/fixnum.rb diff --git a/lib/rake.rb b/lib/rake.rb index ece6882c6..07b03284b 100644 --- a/lib/rake.rb +++ b/lib/rake.rb @@ -32,7 +32,6 @@ module Rake; end require "ostruct" require "rake/ext/string" -require "rake/ext/fixnum" require "rake/win32" diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 464b11374..e94f17290 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -449,7 +449,7 @@ def standard_rake_options # :nodoc: "(default is number of CPU cores + 4)", lambda { |value| if value.nil? || value == "" - value = Fixnum::MAX + value = Float::INFINITY elsif value =~ /^\d+$/ value = value.to_i else diff --git a/lib/rake/ext/fixnum.rb b/lib/rake/ext/fixnum.rb deleted file mode 100644 index 56079ee6d..000000000 --- a/lib/rake/ext/fixnum.rb +++ /dev/null @@ -1,18 +0,0 @@ -#-- -# Extensions to fixnum to define some constants missing from Ruby itself - -class Fixnum - - unless constants.include? :MAX - - # future versions of Ruby may end up defining this constant - # in a more portable way, as documented by Matz himself in: - # - # https://bugs.ruby-lang.org/issues/7517 - # - # ... but until such time, we define the constant ourselves - MAX = (2**(0.size * 8 - 2) - 1) # :nodoc: - - end - -end From 9d82a27d0c13bfb287fdb892d264362aa032de7d Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 10 Sep 2016 12:26:16 +0900 Subject: [PATCH 082/108] avoid to test fail caused by bundler-1.13.0 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 62088270f..85b036757 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ rvm: - jruby-9.1.0.0 - jruby-head before_install: + - gem update --system - gem install bundler --no-document before_script: - unset JRUBY_OPTS From b82883f641b849f478cd46c29a8b108275a99d62 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 10 Sep 2016 14:00:38 +0900 Subject: [PATCH 083/108] use bundler-1.12.x --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 85b036757..32dc1880c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,8 @@ rvm: - jruby-9.1.0.0 - jruby-head before_install: - - gem update --system - - gem install bundler --no-document + - gem install bundler -v '~> 1.12.5' --no-document + before_script: - unset JRUBY_OPTS script: ruby -Ilib exe/rake From f6e54ca1a862dd5f126582db3a741af6970cc9c1 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 10 Sep 2016 15:26:04 +0900 Subject: [PATCH 084/108] removed latest bundler --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 32dc1880c..33ab17188 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ rvm: - jruby-9.1.0.0 - jruby-head before_install: + - gem uninstall bundler - gem install bundler -v '~> 1.12.5' --no-document before_script: From 5123a749b9a98adfe61373e0cfb7aea35ac10b9f Mon Sep 17 00:00:00 2001 From: Code Ass Date: Mon, 12 Sep 2016 01:49:15 +0900 Subject: [PATCH 085/108] Add test for Rake::TestTask#loader is :direct and file set not given --- test/test_rake_test_task.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 8d25c3d05..196c7fb54 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -103,11 +103,19 @@ def test_pattern_equals_test_files_equals end def test_run_code_direct + globbed = ['test_gl.rb', 'test_ob.rb'].map { |f| File.join('test', f) } + others = ['a.rb', 'b.rb'].map { |f| File.join('test', f) } + (globbed + others).each do |f| + create_file(f) + end test_task = Rake::TestTask.new do |t| t.loader = :direct + # if t.pettern and t.test_files are nil, + # t.pettern is "test/test*.rb" end assert_equal '-e "ARGV.each{|f| require f}"', test_task.run_code + assert_equal globbed, test_task.file_list.to_a end def test_run_code_rake From 65c55b0af15fd35b3807c3d102eeaaa1d6a38052 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 14 Sep 2016 07:20:35 +0900 Subject: [PATCH 086/108] try to 1.13.1 --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 33ab17188..62088270f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,7 @@ rvm: - jruby-9.1.0.0 - jruby-head before_install: - - gem uninstall bundler - - gem install bundler -v '~> 1.12.5' --no-document - + - gem install bundler --no-document before_script: - unset JRUBY_OPTS script: ruby -Ilib exe/rake From 1aa2db80f5b4a16f4db9b7d23fbfc516402a69df Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 15 Sep 2016 17:04:00 +0900 Subject: [PATCH 087/108] Try to ~> 1.12.x --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 62088270f..92ba4e650 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ rvm: - jruby-9.1.0.0 - jruby-head before_install: - - gem install bundler --no-document + - gem install bundler -v '~> 1.12.5' --no-document before_script: - unset JRUBY_OPTS script: ruby -Ilib exe/rake From 2d7668d00f2aea67e813e7279717b2db40301cdb Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 15 Sep 2016 22:24:26 +0900 Subject: [PATCH 088/108] added workaround for bundler internal --- .travis.yml | 2 +- Rakefile | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 92ba4e650..62088270f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ rvm: - jruby-9.1.0.0 - jruby-head before_install: - - gem install bundler -v '~> 1.12.5' --no-document + - gem install bundler --no-document before_script: - unset JRUBY_OPTS script: ruby -Ilib exe/rake diff --git a/Rakefile b/Rakefile index e0d2ced3d..6179be099 100644 --- a/Rakefile +++ b/Rakefile @@ -9,6 +9,9 @@ lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +# XXX: https://github.com/bundler/bundler/pull/4981 +require "bundler/plugin/api/source" + require "bundler/gem_tasks" require "rake/testtask" require "rdoc/task" From 36866f924de9421c25fe286e9e4d275b799d9475 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 15 Sep 2016 22:39:35 +0900 Subject: [PATCH 089/108] tweak bundler --- appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2710426ad..a2761f8ce 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,9 +4,8 @@ clone_depth: 10 install: - SET PATH=C:\Ruby%ruby_version%\bin;%PATH% - ruby --version - - gem update --system - gem --version - - gem install minitest --no-document + - gem install minitest bundler --no-document build_script: - net user - net localgroup From b4ddc3ab1592f024af7289850389a3aac066420d Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 16 Sep 2016 07:31:19 +0900 Subject: [PATCH 090/108] style --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index a2761f8ce..62378b53a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,6 @@ build_script: - net localgroup test_script: - ruby -Ilib exe/rake - environment: matrix: - ruby_version: "193" From 21130fe15db191d4a097c4d150f7e17e8c56ad56 Mon Sep 17 00:00:00 2001 From: Brett Sykes Date: Tue, 20 Sep 2016 11:25:07 -0400 Subject: [PATCH 091/108] show extended output on testtask fail only with verbose or trace --- lib/rake/testtask.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 4fb871e46..85dd8552b 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -116,8 +116,9 @@ def define if !ok && status.respond_to?(:signaled?) && status.signaled? raise SignalException.new(status.termsig) elsif !ok - fail "Command failed with status (#{status.exitstatus}): " + - "[ruby #{args}]" + status = "Command failed with status (#{status.exitstatus})" + details = ": [ruby #{args}]" + fail (ARGV.include?('--trace') || @verbose) ? (status + details) : status end end end From b878500058fd7ac669d9988b3ef242188a14c1ba Mon Sep 17 00:00:00 2001 From: Brett Sykes Date: Tue, 20 Sep 2016 14:27:46 -0400 Subject: [PATCH 092/108] updates based on comments from drbrain --- lib/rake/testtask.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 85dd8552b..1a83c30ec 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -118,7 +118,14 @@ def define elsif !ok status = "Command failed with status (#{status.exitstatus})" details = ": [ruby #{args}]" - fail (ARGV.include?('--trace') || @verbose) ? (status + details) : status + message = + if Rake.application.options.trace or @verbose then + status + details + else + status + end + + fail message end end end From 59e4a0945e5296b748b696d7352a9f4263b77638 Mon Sep 17 00:00:00 2001 From: ogawatti Date: Fri, 30 Sep 2016 17:20:38 +0900 Subject: [PATCH 093/108] fix to_hash bug TaskArguments#to_hash is return @hash object. The method should be return duplicated object like a "to_a". --- lib/rake/task_arguments.rb | 2 +- test/test_rake_task_arguments.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/rake/task_arguments.rb b/lib/rake/task_arguments.rb index 7d6275f44..bbadf305b 100644 --- a/lib/rake/task_arguments.rb +++ b/lib/rake/task_arguments.rb @@ -68,7 +68,7 @@ def method_missing(sym, *args) # Returns a Hash of arguments and their values def to_hash - @hash + @hash.dup end def to_s # :nodoc: diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index fd7165a3d..262637b3d 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -43,6 +43,14 @@ def test_to_s assert_equal ta.to_hash.inspect, ta.inspect end + def test_to_hash + ta = Rake::TaskArguments.new([:one], [1]) + h = ta.to_hash + h[:one] = 0 + assert_equal 1, ta.fetch(:one) + assert_equal 0, h.fetch(:one) + end + def test_enumerable_behavior ta = Rake::TaskArguments.new([:a, :b, :c], [1, 2, 3]) assert_equal [10, 20, 30], ta.map { |k, v| v * 10 }.sort From 491888997385179f82e12daeccec51539c35b4e5 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 30 Sep 2016 17:28:45 +0900 Subject: [PATCH 094/108] Workaround for Ruby 2.4 --- rake.gemspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rake.gemspec b/rake.gemspec index 21c3f9cde..cedfc520d 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -33,7 +33,7 @@ Rake has the following features: s.required_rubygems_version = Gem::Requirement.new(">= 1.3.2".freeze) s.rdoc_options = ["--main".freeze, "README.rdoc".freeze] - s.add_development_dependency(%q.freeze, ["~> 1.11"]) - s.add_development_dependency(%q.freeze, ["~> 5.8"]) - s.add_development_dependency(%q.freeze, ["~> 4.0"]) + s.add_development_dependency(%q.freeze) + s.add_development_dependency(%q.freeze) + s.add_development_dependency(%q.freeze, ["~> 5.0.0.beta2"]) end From 913d4a2c7a54a8cdfe5d44124b52ff1cc7a8a046 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 30 Sep 2016 17:31:05 +0900 Subject: [PATCH 095/108] Removed old JRuby version and use latest version --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 62088270f..4351b5673 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,7 @@ rvm: - 2.3.1 - ruby-head - jruby-1.7.20 - - jruby-9.0.5.0 - - jruby-9.1.0.0 + - jruby-9.1.5.0 - jruby-head before_install: - gem install bundler --no-document From 23c1be9bf0ce400867fb2c76263366dd02ca059b Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 30 Sep 2016 17:56:18 +0900 Subject: [PATCH 096/108] skip tests with JRuby 9k. https://travis-ci.org/ruby/rake/jobs/163951069 --- test/test_rake_application.rb | 2 ++ test/test_rake_functional.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index c60dd8e4e..62bb4c6ac 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -284,6 +284,8 @@ def test_load_rakefile_doesnt_print_rakefile_directory_from_subdir_if_silent end def test_load_rakefile_not_found + skip if jruby9? + ARGV.clear Dir.chdir @tempdir ENV["RAKE_SYSTEM"] = "not_exist" diff --git a/test/test_rake_functional.rb b/test/test_rake_functional.rb index 55e141728..7c2bd3266 100644 --- a/test/test_rake_functional.rb +++ b/test/test_rake_functional.rb @@ -122,6 +122,8 @@ def test_by_default_rakelib_files_are_included end def test_implicit_system + skip if jruby9? + rake_system_dir Dir.chdir @tempdir From b4282f6ea714ddfac3d380b032b70d01b2717bbd Mon Sep 17 00:00:00 2001 From: Brian Henderson Date: Tue, 27 Sep 2016 15:56:45 -0700 Subject: [PATCH 097/108] Fix typo. --- test/test_rake_clean.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_rake_clean.rb b/test/test_rake_clean.rb index 04367907a..aac45cae3 100644 --- a/test/test_rake_clean.rb +++ b/test/test_rake_clean.rb @@ -46,7 +46,7 @@ def create_undeletable_file rescue file_name else - skip "Permission to delete files is different on thie system" + skip "Permission to delete files is different on this system" end end From f2a38bcfd7f0b993a7e2626100e39db2d57f1999 Mon Sep 17 00:00:00 2001 From: Brian Henderson Date: Tue, 27 Sep 2016 16:00:16 -0700 Subject: [PATCH 098/108] Teach cleanup to respect the trace option. --- lib/rake/clean.rb | 1 + test/test_rake_clean.rb | 60 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/lib/rake/clean.rb b/lib/rake/clean.rb index 1e5da81cb..e3c3b3a4a 100644 --- a/lib/rake/clean.rb +++ b/lib/rake/clean.rb @@ -29,6 +29,7 @@ def cleanup_files(file_names) def cleanup(file_name, opts={}) begin + opts = {:verbose => Rake.application.options.trace}.merge(opts) rm_r file_name, opts rescue StandardError => ex puts "Failed to remove #{file_name}: #{ex}" unless file_already_gone?(file_name) diff --git a/test/test_rake_clean.rb b/test/test_rake_clean.rb index aac45cae3..36ca5305a 100644 --- a/test/test_rake_clean.rb +++ b/test/test_rake_clean.rb @@ -32,8 +32,56 @@ def test_cleanup_ignores_missing_files refute_match(/failed to remove/i, out) end + def test_cleanup_trace + file_name = create_file + + assert_output "", "rm -r #{file_name}\n" do + with_trace true do + Rake::Cleaner.cleanup(file_name) + end + end + end + + def test_cleanup_without_trace + file_name = create_file + + assert_output "", "" do + with_trace false do + Rake::Cleaner.cleanup(file_name) + end + end + end + + def test_cleanup_opt_overrides_trace_silent + file_name = create_file + + assert_output "", "" do + with_trace true do + Rake::Cleaner.cleanup(file_name, verbose: false) + end + end + end + + def test_cleanup_opt_overrides_trace_verbose + file_name = create_file + + assert_output "", "rm -r #{file_name}\n" do + with_trace false do + Rake::Cleaner.cleanup(file_name, verbose: true) + end + end + end + private + def create_file + dir_name = File.join(@tempdir, "deletedir") + file_name = File.join(dir_name, "deleteme") + FileUtils.mkdir(dir_name) + FileUtils.touch(file_name) + file_name + end + def create_undeletable_file dir_name = File.join(@tempdir, "deletedir") file_name = File.join(dir_name, "deleteme") @@ -58,4 +106,16 @@ def remove_undeletable_file Rake::Cleaner.cleanup(file_name, verbose: false) Rake::Cleaner.cleanup(dir_name, verbose: false) end + + def with_trace value + old, Rake.application.options.trace = + Rake.application.options.trace, value + + # FileUtils caches the $stderr object, which breaks capture_io et. al. + # We hack it here where it's convenient to do so. + Rake::Cleaner.instance_variable_set :@fileutils_output, nil + yield + ensure + Rake.application.options.trace = old + end end From 8641a713de079445f667f9cdb18ea7e22a78c554 Mon Sep 17 00:00:00 2001 From: ogawatti Date: Fri, 30 Sep 2016 17:20:38 +0900 Subject: [PATCH 099/108] fix to_hash bug TaskArguments#to_hash is return @hash object. The method should be return duplicated object like a "to_a". --- lib/rake/task_arguments.rb | 2 +- test/test_rake_task_arguments.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/rake/task_arguments.rb b/lib/rake/task_arguments.rb index 7d6275f44..bbadf305b 100644 --- a/lib/rake/task_arguments.rb +++ b/lib/rake/task_arguments.rb @@ -68,7 +68,7 @@ def method_missing(sym, *args) # Returns a Hash of arguments and their values def to_hash - @hash + @hash.dup end def to_s # :nodoc: diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index fd7165a3d..262637b3d 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -43,6 +43,14 @@ def test_to_s assert_equal ta.to_hash.inspect, ta.inspect end + def test_to_hash + ta = Rake::TaskArguments.new([:one], [1]) + h = ta.to_hash + h[:one] = 0 + assert_equal 1, ta.fetch(:one) + assert_equal 0, h.fetch(:one) + end + def test_enumerable_behavior ta = Rake::TaskArguments.new([:a, :b, :c], [1, 2, 3]) assert_equal [10, 20, 30], ta.map { |k, v| v * 10 }.sort From 258a7682dc44d43c81c8d64c275aaa4704631d74 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 3 Oct 2016 18:42:56 +0900 Subject: [PATCH 100/108] picked Rake-11.3.0 history --- History.rdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/History.rdoc b/History.rdoc index be971eab8..4900cf280 100644 --- a/History.rdoc +++ b/History.rdoc @@ -6,6 +6,12 @@ * Removed `rake/contrib` packages. These are extracted to `rake-contrib` gem. * Removed to deprecated warnings for `last\_comment`. +=== 11.3.0 / 2016-09-20 + +Enhancements: + +* Remove to reference `Fixnum` constant. Pull request #160 by nobu + === 11.2.2 / 2016-06-12 ==== Bug fixes From 8da383f23026428d528af9a426dbc98bbf9f92af Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 3 Oct 2016 18:43:22 +0900 Subject: [PATCH 101/108] style --- History.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index 4900cf280..a2392fa81 100644 --- a/History.rdoc +++ b/History.rdoc @@ -8,7 +8,7 @@ === 11.3.0 / 2016-09-20 -Enhancements: +==== Enhancements: * Remove to reference `Fixnum` constant. Pull request #160 by nobu From 40d1f629dbc5e4f7e98a8cdb033fdf653107d1a1 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 3 Oct 2016 18:45:18 +0900 Subject: [PATCH 102/108] History #164 --- History.rdoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/History.rdoc b/History.rdoc index a2392fa81..414f3b435 100644 --- a/History.rdoc +++ b/History.rdoc @@ -6,6 +6,10 @@ * Removed `rake/contrib` packages. These are extracted to `rake-contrib` gem. * Removed to deprecated warnings for `last\_comment`. +==== Enhancements: + +* Re-use trace option on `cleanup` task. #164 by Brian Henderson + === 11.3.0 / 2016-09-20 ==== Enhancements: From f9a1b4ab1340f62009b49a834a17dd936208d738 Mon Sep 17 00:00:00 2001 From: chocolateboy Date: Sun, 28 Aug 2016 21:33:20 +0100 Subject: [PATCH 103/108] remove obsolete OPT_TABLE entries As of #138, the `OPT_TABLE` entries for `sh` and `ruby` are no longer used internally, and a GitHub search for these entries suggests that they are not used externally: https://git.io/v6hpi --- lib/rake/file_utils.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb index 6bb41940d..aa065e8b4 100644 --- a/lib/rake/file_utils.rb +++ b/lib/rake/file_utils.rb @@ -11,9 +11,6 @@ module FileUtils RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]). sub(/.*\s.*/m, '"\&"') - OPT_TABLE["sh"] = %w(noop verbose) - OPT_TABLE["ruby"] = %w(noop verbose) - # Run the system command +cmd+. If multiple arguments are given the command # is run directly (without the shell, same semantics as Kernel::exec and # Kernel::system). From eb5612d1aafb212218b38aa202ded33d67ce9581 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 7 Oct 2016 19:37:20 +0900 Subject: [PATCH 104/108] added ruby 2.3 to appveyor --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 62378b53a..b103fe30d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,3 +20,5 @@ environment: - ruby_version: "21-x64" - ruby_version: "22" - ruby_version: "22-x64" + - ruby_version: "23" + - ruby_version: "23-x64" From 40d9bd09fdfbcff3a50b499324169f21c84e1567 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 7 Oct 2016 19:42:01 +0900 Subject: [PATCH 105/108] tweak appveyor --- appveyor.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b103fe30d..671f63f8b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,16 +1,12 @@ --- -version: "{build}" clone_depth: 10 install: - SET PATH=C:\Ruby%ruby_version%\bin;%PATH% - - ruby --version - - gem --version - - gem install minitest bundler --no-document -build_script: - - net user - - net localgroup + - bundle install +build: off test_script: - ruby -Ilib exe/rake +deploy: off environment: matrix: - ruby_version: "193" From 708ea7197b406a0271dc9e4e7b0ad29b1a804935 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 7 Oct 2016 20:52:26 +0900 Subject: [PATCH 106/108] needs bundler-1.13.x --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 671f63f8b..79847873c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,6 +2,7 @@ clone_depth: 10 install: - SET PATH=C:\Ruby%ruby_version%\bin;%PATH% + - gem install bundler --no-document - bundle install build: off test_script: From 39bc450f0d6f839e20a0015a6b10e32d636bde0a Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 11 Oct 2016 09:55:32 +0900 Subject: [PATCH 107/108] removed workaround for bundler-1.13.1 --- .travis.yml | 2 +- Rakefile | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4351b5673..d62aebe88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ rvm: - jruby-9.1.5.0 - jruby-head before_install: - - gem install bundler --no-document + - gem install bundler --no-document -v '~> 1.13.3' before_script: - unset JRUBY_OPTS script: ruby -Ilib exe/rake diff --git a/Rakefile b/Rakefile index 6179be099..e0d2ced3d 100644 --- a/Rakefile +++ b/Rakefile @@ -9,9 +9,6 @@ lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -# XXX: https://github.com/bundler/bundler/pull/4981 -require "bundler/plugin/api/source" - require "bundler/gem_tasks" require "rake/testtask" require "rdoc/task" From 4e7ad163714c304d6c13ec71ceb5d3976d20cf2b Mon Sep 17 00:00:00 2001 From: Chris Johnson Date: Thu, 20 Oct 2016 15:20:21 -0700 Subject: [PATCH 108/108] Represent a TaskArgument object such that it's not confused with a hash. --- lib/rake/task_arguments.rb | 8 ++++++-- test/test_rake_task_arguments.rb | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/rake/task_arguments.rb b/lib/rake/task_arguments.rb index bbadf305b..4b168f0e2 100644 --- a/lib/rake/task_arguments.rb +++ b/lib/rake/task_arguments.rb @@ -72,11 +72,15 @@ def to_hash end def to_s # :nodoc: - @hash.inspect + inspect end def inspect # :nodoc: - to_s + inspection = @hash.map do |k,v| + "#{k.to_s}: #{v.to_s}" + end.join(", ") + + "#<#{self.class} #{inspection}>" end # Returns true if +key+ is one of the arguments diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index 262637b3d..8fcba7424 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -39,8 +39,9 @@ def test_fetch def test_to_s ta = Rake::TaskArguments.new([:a, :b, :c], [1, 2, 3]) - assert_equal ta.to_hash.inspect, ta.to_s - assert_equal ta.to_hash.inspect, ta.inspect + expectation = "#" + assert_equal expectation, ta.to_s + assert_equal expectation, ta.inspect end def test_to_hash