From 3d6665c7d7fd902fc91e40dcf9a0993009833a68 Mon Sep 17 00:00:00 2001 From: Petr Skocik Date: Sat, 11 Apr 2015 18:20:35 +0200 Subject: [PATCH 001/142] test for chained extensions in rules --- test/test_rake_rules.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_rake_rules.rb b/test/test_rake_rules.rb index ece75e5d9..ef1fa7228 100644 --- a/test/test_rake_rules.rb +++ b/test/test_rake_rules.rb @@ -10,6 +10,7 @@ class TestRakeRules < Rake::TestCase OBJFILE = "abc.o" FOOFILE = "foo" DOTFOOFILE = ".foo" + MINFILE = 'abc.min.o' def setup super @@ -385,4 +386,15 @@ def obj.find_prereq(task_name) assert_equal ["#{OBJFILE} - abc.c"], @runs end + def test_works_with_chained_extensions_in_rules + create_file(OBJFILE) + rule('.min.o' => ['.o']) do |t| + @runs << t.name + assert_equal OBJFILE, t.source + assert_equal MINFILE, t.name + end + Task[MINFILE].invoke + assert_equal [MINFILE], @runs + end + end From 84bc6741da1a6c4b76267e3f11fdff602879fe81 Mon Sep 17 00:00:00 2001 From: Petr Skocik Date: Sat, 11 Apr 2015 18:21:03 +0200 Subject: [PATCH 002/142] support chained extensions in rules --- lib/rake/task_manager.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index d9b4d85e7..9b4080617 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -131,7 +131,7 @@ def enhance_with_matching_rule(task_name, level=0) "Rule Recursion Too Deep" if level >= 16 @rules.each do |pattern, args, extensions, block| if pattern.match(task_name) - task = attempt_rule(task_name, args, extensions, block, level) + task = attempt_rule(task_name, pattern, args, extensions, block, level) return task if task end end @@ -245,8 +245,8 @@ def trace_rule(level, message) # :nodoc: end # Attempt to create a rule given the list of prerequisites. - def attempt_rule(task_name, args, extensions, block, level) - sources = make_sources(task_name, extensions) + def attempt_rule(task_name, task_pattern, args, extensions, block, level) + sources = make_sources(task_name, task_pattern, extensions) prereqs = sources.map { |source| trace_rule level, "Attempting Rule #{task_name} => #{source}" if File.exist?(source) || Rake::Task.task_defined?(source) @@ -267,7 +267,7 @@ def attempt_rule(task_name, args, extensions, block, level) # Make a list of sources from the list of file name extensions / # translation procs. - def make_sources(task_name, extensions) + def make_sources(task_name, task_pattern, extensions) result = extensions.map { |ext| case ext when /%/ @@ -275,7 +275,8 @@ def make_sources(task_name, extensions) when %r{/} ext when /^\./ - task_name.ext(ext) + source = task_name.sub(task_pattern, ext) + source == ext ? task_name.ext(ext) : source when String ext when Proc, Method From 24cafd5a48096bb526a1180d7067b472f412fc50 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 10 Sep 2016 10:51:57 +0900 Subject: [PATCH 003/142] cherry-picked 65b643209d82e7f04f5568aa1c22d3969fef3f2a --- 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 a2f1b448e..2466e3992 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 fc0a786d6..8c93a8d4f 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 050c7d4900a691215e953b1de122d1bd60d32254 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 20 Sep 2016 16:00:35 +0900 Subject: [PATCH 004/142] History --- History.rdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/History.rdoc b/History.rdoc index 6ff5088df..c306c2108 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,9 @@ +=== 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 08576365d9acb9a76ce36a4448953be21f001b5f Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 20 Sep 2016 16:01:03 +0900 Subject: [PATCH 005/142] bump version to 11.3.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 c9660a45e..003f0176a 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,5 +1,5 @@ module Rake - VERSION = '11.2.2' + VERSION = '11.3.0' module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split '.' From 2a15e60f3437f494754097523318af8360c5ccf9 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 20 Sep 2016 16:04:35 +0900 Subject: [PATCH 006/142] up to date --- rake.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index 04bbd3327..6234bd553 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-06-12" + s.date = "2016-09-20" s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze] s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze] From 477535e2e11386ae661a0a881d331f735713d48c Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 20 Sep 2016 17:19:26 +0900 Subject: [PATCH 007/142] workaround for bundler-1.13.1 --- Rakefile | 4 ++++ appveyor.yml | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 97c22a45f..a2526132a 100644 --- a/Rakefile +++ b/Rakefile @@ -9,6 +9,10 @@ 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' diff --git a/appveyor.yml b/appveyor.yml index 2710426ad..62378b53a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,15 +4,13 @@ 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 test_script: - ruby -Ilib exe/rake - environment: matrix: - ruby_version: "193" From 083267f77dbaff199460f6fd11ef6e8ffeca7643 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 6 Dec 2016 21:39:18 +0900 Subject: [PATCH 008/142] Fixed grammers --- History.rdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/History.rdoc b/History.rdoc index 16c62c8b2..53288e44f 100644 --- a/History.rdoc +++ b/History.rdoc @@ -2,9 +2,9 @@ ==== Compatibility Changes -* Remove arguments on clear #157 by Jesse Bowes +* Removed 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`. +* Removed deprecated method named `last\_comment`. ==== Enhancements: From 8524523cf93682be9f717d5ae364dbb36ee6c3d3 Mon Sep 17 00:00:00 2001 From: Yuta Kurotaki Date: Tue, 13 Dec 2016 16:14:06 +0900 Subject: [PATCH 009/142] Fixes documentation typo in rakefile.rdoc --- doc/rakefile.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/rakefile.rdoc b/doc/rakefile.rdoc index 89a28ebee..4014306a1 100644 --- a/doc/rakefile.rdoc +++ b/doc/rakefile.rdoc @@ -410,7 +410,7 @@ display a list of tasks that have a description. If you use +desc+ to describe your major tasks, you have a semi-automatic way of generating a summary of your Rake file. - traken$ rake -T + $ rake -T (in /home/.../rake) rake clean # Remove any temporary products. rake clobber # Remove any generated file. From 9341b11836b3ad341741d286cf7e7456449cdbc2 Mon Sep 17 00:00:00 2001 From: Lukas Zapletal Date: Fri, 23 Dec 2016 13:30:34 +0100 Subject: [PATCH 010/142] When pattern is nil, enhance_with_matching_rule will not fail --- lib/rake/task_manager.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index b62edc8e3..7844f9ed9 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -126,7 +126,7 @@ def enhance_with_matching_rule(task_name, level=0) fail Rake::RuleRecursionOverflowError, "Rule Recursion Too Deep" if level >= 16 @rules.each do |pattern, args, extensions, block| - if pattern.match(task_name) + if pattern && pattern.match(task_name) task = attempt_rule(task_name, args, extensions, block, level) return task if task end From e8000957394a11436c3a1af2c569330778b1f1cb Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 29 Dec 2016 09:14:51 +0100 Subject: [PATCH 011/142] Travis: add 2.4.0 to matrix, update patch versions --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e1db29fe..5bfd89097 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,11 @@ rvm: - 1.9.3 - 2.0.0 - 2.1.10 - - 2.2.5 - - 2.3.1 + - 2.2.6 + - 2.3.3 + - 2.4.0 - ruby-head - - jruby-1.7.20 + - jruby-1.7.26 - jruby-9.1.6.0 - jruby-head before_install: From e65f3dba9ca9a496b3c380e22f9e88232924e886 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 4 Jan 2017 15:03:57 +0900 Subject: [PATCH 012/142] Remove an extra assertion As the result of https://bugs.ruby-lang.org/issues/13043, now Exception#cause should not have a loop. In the example https://github.com/jimweirich/rake/issues/272, the code doesn't seem to intend the loop itself but just re-raising the first exception instead of the next exception. Therefore I consider the last assertion superfluous. --- test/test_rake_application.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index 62bb4c6ac..cb3a86c07 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -97,7 +97,6 @@ def test_display_exception_details_cause_loop assert_empty out assert_match "cause a", err - assert_match "cause b", err end def test_display_tasks From 25f2e3bc37c90515564498fbc6511e736053075d Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 6 Jan 2017 12:54:11 +0900 Subject: [PATCH 013/142] Removed duplicated test. `test_display_exception_details_cause_loop` is same as `test_display_exception_details_cause`. Fixed #185 --- test/test_rake_application.rb | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index cb3a86c07..cd8feebbc 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -72,33 +72,6 @@ def test_display_exception_details_cause assert_match "cause b", err end - def test_display_exception_details_cause_loop - 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" - rescue => a - begin - raise "cause b" - rescue - raise a - end - end - rescue => ex - end - - out, err = capture_io do - @app.display_error_message ex - end - - assert_empty out - - assert_match "cause a", err - end - def test_display_tasks @app.options.show_tasks = :tasks @app.options.show_task_pattern = // From 260ba43fecf438b851267959c22e8e972d7776f4 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 6 Jan 2017 17:31:04 +0900 Subject: [PATCH 014/142] Added coveralls gem again --- rake.gemspec | 1 + test/helper.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/rake.gemspec b/rake.gemspec index 8479b9314..911384c46 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -36,4 +36,5 @@ Rake has the following features: s.add_development_dependency(%q.freeze) s.add_development_dependency(%q.freeze) s.add_development_dependency(%q.freeze) + s.add_development_dependency(%q.freeze) end diff --git a/test/helper.rb b/test/helper.rb index 7736da72f..532745319 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,5 +1,8 @@ $:.unshift File.expand_path("../../lib", __FILE__) +require 'coveralls' +Coveralls.wear! + gem "minitest", "~> 5" require "minitest/autorun" require "rake" From 98d21c12c9b298095713a4b263ba8b034c3e412f Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 6 Jan 2017 17:43:58 +0900 Subject: [PATCH 015/142] To remove Ruby 1.9.3 from travis --- .travis.yml | 1 - appveyor.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5bfd89097..b169da82f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: ruby sudo: false rvm: - - 1.9.3 - 2.0.0 - 2.1.10 - 2.2.6 diff --git a/appveyor.yml b/appveyor.yml index 79847873c..44b19a2de 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,7 +10,6 @@ test_script: deploy: off environment: matrix: - - ruby_version: "193" - ruby_version: "200" - ruby_version: "200-x64" - ruby_version: "21" From 34f5e2e27d2c49431b7c84d0787eaf6afcddf794 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 6 Jan 2017 17:47:20 +0900 Subject: [PATCH 016/142] Remove old version of JRuby 1.7.x --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b169da82f..3ce147993 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,6 @@ rvm: - 2.3.3 - 2.4.0 - ruby-head - - jruby-1.7.26 - jruby-9.1.6.0 - jruby-head before_install: From b0c268ec29979ac646a6ce664b54d99e01576b11 Mon Sep 17 00:00:00 2001 From: Code Ass Date: Wed, 7 Dec 2016 01:06:55 +0900 Subject: [PATCH 017/142] Add rakefile_file_chains for test --- test/support/rakefile_definitions.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/support/rakefile_definitions.rb b/test/support/rakefile_definitions.rb index e0af05a67..9a19d43fc 100644 --- a/test/support/rakefile_definitions.rb +++ b/test/support/rakefile_definitions.rb @@ -77,6 +77,24 @@ def rakefile_chains DEFAULT end + def rakefile_file_chains + rakefile <<-RAKEFILE +file "fileA" do |t| + sh "echo contentA >\#{t.name}" +end + +file "fileB" => "fileA" do |t| + sh "(cat fileA; echo transformationB) >\#{t.name}" +end + +file "fileC" => "fileB" do |t| + sh "(cat fileB; echo transformationC) >\#{t.name}" +end + +task default: "fileC" + RAKEFILE + end + def rakefile_comments rakefile <<-COMMENTS # comment for t1 From 06bea3c17e904aec82c7bb5dbffc4c349e12a33a Mon Sep 17 00:00:00 2001 From: Code Ass Date: Wed, 7 Dec 2016 01:07:28 +0900 Subject: [PATCH 018/142] Add test for dry-run file task --- test/test_rake_functional.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/test_rake_functional.rb b/test/test_rake_functional.rb index 7c2bd3266..bc0675795 100644 --- a/test/test_rake_functional.rb +++ b/test/test_rake_functional.rb @@ -295,6 +295,25 @@ def test_rules_chaining_to_file_task "'play.app' file should exist" end + def dryrun_tasks + @err.split("\n").select { |line| + line.match(/^\*\* Execute/) + }.map { |line| + line.gsub(/^\*\* Execute \(dry run\) /, "") + } + end + + def test_update_midway_through_chaining_to_file_task + rakefile_file_chains + + rake "-n" + assert_equal(%w{fileA fileB fileC default}, dryrun_tasks) + rake + FileUtils.touch("fileA") + rake "-n" + assert_equal(%w{fileB fileC default}, dryrun_tasks) + end + def test_file_creation_task rakefile_file_creation From 462e403aa796ecb3105b88f598948c7c496e8325 Mon Sep 17 00:00:00 2001 From: Code Ass Date: Thu, 29 Dec 2016 06:20:23 +0900 Subject: [PATCH 019/142] Check nested FileTask#out_of_date? --- lib/rake/file_task.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/rake/file_task.rb b/lib/rake/file_task.rb index 6656e7095..afec0c724 100644 --- a/lib/rake/file_task.rb +++ b/lib/rake/file_task.rb @@ -29,7 +29,14 @@ def timestamp # Are there any prerequisites with a later time than the given time stamp? def out_of_date?(stamp) - @prerequisites.any? { |n| application[n, @scope].timestamp > stamp } + @prerequisites.any? { |p| + ptask = application[p, @scope] + if ptask.instance_of?(Rake::FileTask) + ptask.timestamp > stamp || ptask.needed? + else + ptask.timestamp > stamp + end + } end # ---------------------------------------------------------------- From b2d52fdd55ebc447a8544adb26d4119422a5243b Mon Sep 17 00:00:00 2001 From: Code Ass Date: Thu, 29 Dec 2016 10:10:48 +0900 Subject: [PATCH 020/142] Add 'sleep 1' for stride seconds surely for timestamp --- test/test_rake_functional.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_rake_functional.rb b/test/test_rake_functional.rb index bc0675795..012f9bfbb 100644 --- a/test/test_rake_functional.rb +++ b/test/test_rake_functional.rb @@ -309,6 +309,7 @@ def test_update_midway_through_chaining_to_file_task rake "-n" assert_equal(%w{fileA fileB fileC default}, dryrun_tasks) rake + sleep 1 # for stride seconds surely for timestamp FileUtils.touch("fileA") rake "-n" assert_equal(%w{fileB fileC default}, dryrun_tasks) From 7be2c7829ea39cc698ea52ab488924bfd710e124 Mon Sep 17 00:00:00 2001 From: Code Ass Date: Thu, 29 Dec 2016 21:38:23 +0900 Subject: [PATCH 021/142] Use prereq instead of p for variable name https://github.com/ruby/rake/pull/183/files/a094e2584295005c7b1ee1419b7bf9136b9f4411#r94092645 --- lib/rake/file_task.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/rake/file_task.rb b/lib/rake/file_task.rb index afec0c724..cbb978e7f 100644 --- a/lib/rake/file_task.rb +++ b/lib/rake/file_task.rb @@ -29,12 +29,12 @@ def timestamp # Are there any prerequisites with a later time than the given time stamp? def out_of_date?(stamp) - @prerequisites.any? { |p| - ptask = application[p, @scope] - if ptask.instance_of?(Rake::FileTask) - ptask.timestamp > stamp || ptask.needed? + @prerequisites.any? { |prereq| + prereq_task = application[prereq, @scope] + if prereq_task.instance_of?(Rake::FileTask) + prereq_task.timestamp > stamp || prereq_task.needed? else - ptask.timestamp > stamp + prereq_task.timestamp > stamp end } end From 2346bc82a9a89e2e22b890349f00a6d75fd4fe60 Mon Sep 17 00:00:00 2001 From: Code Ass Date: Tue, 24 Jan 2017 10:12:50 +0900 Subject: [PATCH 022/142] Fix comment to make it less ambiguous --- test/test_rake_functional.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_rake_functional.rb b/test/test_rake_functional.rb index 012f9bfbb..3496bc12d 100644 --- a/test/test_rake_functional.rb +++ b/test/test_rake_functional.rb @@ -309,7 +309,7 @@ def test_update_midway_through_chaining_to_file_task rake "-n" assert_equal(%w{fileA fileB fileC default}, dryrun_tasks) rake - sleep 1 # for stride seconds surely for timestamp + sleep 1 # Ensure the timestamp is on a new second FileUtils.touch("fileA") rake "-n" assert_equal(%w{fileB fileC default}, dryrun_tasks) From af15762f972a3f8322a9b5904d56fe2ff3dd8352 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 9 Feb 2017 11:03:16 +0900 Subject: [PATCH 023/142] Fix typos --- History.rdoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/History.rdoc b/History.rdoc index 53288e44f..b7ef2e691 100644 --- a/History.rdoc +++ b/History.rdoc @@ -385,7 +385,7 @@ we'll repeat the changes for versions 0.9.3 through 0.9.5 here. programatically add rake task libraries. * You can specific backtrace suppression patterns (see - --supress-backtrace) + --suppress-backtrace) * Directory tasks can now take prerequisites and actions @@ -633,7 +633,7 @@ we'll repeat the changes for version 0.9.3 here. programatically add rake task libraries. * You can specific backtrace suppression patterns (see - --supress-backtrace) + --suppress-backtrace) * Directory tasks can now take prerequisites and actions @@ -843,7 +843,7 @@ a number of bug fixes. programatically add rake task libraries. * You can specific backtrace suppression patterns (see - --supress-backtrace) + --suppress-backtrace) * Directory tasks can now take prerequisites and actions @@ -1415,7 +1415,7 @@ 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 +To access the values of the parameters, the block defining the task behaviour can now accept a second parameter: task :name, :first_name, :last_name do |t, args| @@ -1518,7 +1518,7 @@ 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 +To access the values of the parameters, the block defining the task behaviour can now accept a second parameter: task :name, :first_name, :last_name do |t, args| @@ -1738,7 +1738,7 @@ are, I hope you enjoy them. * 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. + accidental pollution 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. @@ -1751,7 +1751,7 @@ are, I hope you enjoy them. ===== 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 will not accidentally interfer with tasks named in a different namespace. For example: @@ -1809,7 +1809,7 @@ 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) +* Doug Young (inspiration for the parallel task) * David Heinemeier Hansson (for --trace message enhancement and for pushing for namespace support). * Ludvig Omholt (for the openAFS fix) From 48a9c463ab534df2229f80e7bc13ad61928d3883 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Thu, 23 Feb 2017 10:44:49 -0800 Subject: [PATCH 024/142] Make LoadError from running tests more obvious --- lib/rake/rake_test_loader.rb | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/rake/rake_test_loader.rb b/lib/rake/rake_test_loader.rb index d299efe35..1fedfa74d 100644 --- a/lib/rake/rake_test_loader.rb +++ b/lib/rake/rake_test_loader.rb @@ -2,19 +2,23 @@ # Load the test files from the command line. argv = ARGV.select do |argument| - case argument - when /^-/ then - argument - when /\*/ then - FileList[argument].to_a.each do |file| - require File.expand_path file - end + begin + case argument + when /^-/ then + argument + when /\*/ then + FileList[argument].to_a.each do |file| + require File.expand_path file + end - false - else - require File.expand_path argument + false + else + require File.expand_path argument - false + false + end + rescue LoadError => e + abort "\n#{e.message}\n\n" end end From 66ec746a9e85c6ec7e7d2e682b3a5b08914a5033 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Thu, 23 Feb 2017 11:04:11 -0800 Subject: [PATCH 025/142] Test LoadError behavior --- test/test_rake_rake_test_loader.rb | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/test_rake_rake_test_loader.rb b/test/test_rake_rake_test_loader.rb index 21c494ffe..d284a3c92 100644 --- a/test/test_rake_rake_test_loader.rb +++ b/test/test_rake_rake_test_loader.rb @@ -2,6 +2,12 @@ class TestRakeRakeTestLoader < Rake::TestCase + def setup + super + + @loader = File.join @rake_lib, 'rake/rake_test_loader.rb' + end + def test_pattern orig_loaded_features = $:.dup FileUtils.touch "foo.rb" @@ -10,11 +16,26 @@ def test_pattern ARGV.replace %w[foo.rb test_*.rb -v] - load File.join(@rake_lib, "rake/rake_test_loader.rb") + load @loader assert_equal %w[-v], ARGV ensure $:.replace orig_loaded_features end + def test_load_error + expected = <<-EXPECTED + +cannot load such file -- #{File.join @tempdir, 'no_such_test_file.rb'} + + EXPECTED + + assert_output nil, expected do + ARGV.replace %w[no_such_test_file.rb] + + assert_raises SystemExit do + load @loader + end + end + end end From fdc443a7562cb45c4e085b3de8c94e28371e4a24 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Thu, 23 Feb 2017 11:18:01 -0800 Subject: [PATCH 026/142] Provide our own message JRuby uses a different error message for LoadError than CRuby --- lib/rake/rake_test_loader.rb | 2 +- test/test_rake_rake_test_loader.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rake/rake_test_loader.rb b/lib/rake/rake_test_loader.rb index 1fedfa74d..98dcced06 100644 --- a/lib/rake/rake_test_loader.rb +++ b/lib/rake/rake_test_loader.rb @@ -18,7 +18,7 @@ false end rescue LoadError => e - abort "\n#{e.message}\n\n" + abort "\nFile does not exist: #{e.path}\n\n" end end diff --git a/test/test_rake_rake_test_loader.rb b/test/test_rake_rake_test_loader.rb index d284a3c92..15e122dc2 100644 --- a/test/test_rake_rake_test_loader.rb +++ b/test/test_rake_rake_test_loader.rb @@ -26,7 +26,7 @@ def test_pattern def test_load_error expected = <<-EXPECTED -cannot load such file -- #{File.join @tempdir, 'no_such_test_file.rb'} +File does not exist: #{File.join @tempdir, 'no_such_test_file.rb'} EXPECTED From 8d3a682c2aaba3d459c02b19768750b7ffd67c1f Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Thu, 23 Feb 2017 11:46:48 -0800 Subject: [PATCH 027/142] Ignore ".rb" on JRuby in tests JRuby uses a different path for LoadError than CRuby --- test/test_rake_rake_test_loader.rb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/test/test_rake_rake_test_loader.rb b/test/test_rake_rake_test_loader.rb index 15e122dc2..855606d4d 100644 --- a/test/test_rake_rake_test_loader.rb +++ b/test/test_rake_rake_test_loader.rb @@ -24,18 +24,23 @@ def test_pattern end def test_load_error - expected = <<-EXPECTED - -File does not exist: #{File.join @tempdir, 'no_such_test_file.rb'} - - EXPECTED - - assert_output nil, expected do + out, err = capture_io do ARGV.replace %w[no_such_test_file.rb] assert_raises SystemExit do load @loader end end + + assert_empty out + + no_such_path = File.join @tempdir, 'no_such_test_file' + + expected = + /\A\n + File\ does\ not\ exist:\ #{no_such_path}(\.rb)? # JRuby is different + \n\n\Z/x + + assert_match expected, err end end From 86bdba1babc852294d9321410f7807f31131c1a7 Mon Sep 17 00:00:00 2001 From: Code Ass Date: Tue, 28 Mar 2017 12:25:25 +0900 Subject: [PATCH 028/142] Use Ruby 2.4.1 for Travis CI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3ce147993..8c259f622 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ rvm: - 2.1.10 - 2.2.6 - 2.3.3 - - 2.4.0 + - 2.4.1 - ruby-head - jruby-9.1.6.0 - jruby-head From c2ab781e33a27ae2dfd50060a117c834a969c263 Mon Sep 17 00:00:00 2001 From: Petr Skocik Date: Mon, 3 Apr 2017 14:56:23 +0200 Subject: [PATCH 029/142] fix = alignment --- test/test_rake_rules.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_rake_rules.rb b/test/test_rake_rules.rb index ef1fa7228..0f19a808f 100644 --- a/test/test_rake_rules.rb +++ b/test/test_rake_rules.rb @@ -10,7 +10,7 @@ class TestRakeRules < Rake::TestCase OBJFILE = "abc.o" FOOFILE = "foo" DOTFOOFILE = ".foo" - MINFILE = 'abc.min.o' + MINFILE = 'abc.min.o' def setup super From 9be0171a3d722402bc3574c6e02a85cf18194bea Mon Sep 17 00:00:00 2001 From: Kuniaki IGARASHI Date: Tue, 2 May 2017 11:23:58 +0900 Subject: [PATCH 030/142] Change FileUtils#sh to adopt with hash style option. --- lib/rake/file_utils.rb | 2 +- test/test_rake_file_utils.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb index aa065e8b4..3e56710e2 100644 --- a/lib/rake/file_utils.rb +++ b/lib/rake/file_utils.rb @@ -50,7 +50,7 @@ def sh(*cmd, &block) Rake.rake_output_message sh_show_command cmd if verbose unless noop - res = system(*cmd, options) + res = (Hash === cmd.last) ? system(*cmd) : 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 218c25415..00ef76e41 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -180,6 +180,15 @@ def test_sh_with_spawn_options assert_equal "echocommand.rb\n", r.read end + def test_sh_with_hash_option + skip "JRuby does not support spawn options" if jruby? + check_expansion + + verbose(false) { + sh "#{RUBY} check_expansion.rb", {chdir: "."}, { verbose: false } + } + end + def test_sh_failure shellcommand From e0198444af8f41724d34b3709cdcfbecc6fbace9 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 2 May 2017 16:52:40 +0900 Subject: [PATCH 031/142] History --- History.rdoc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/History.rdoc b/History.rdoc index b7ef2e691..d1bf4b85f 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,19 @@ +=== 12.1.0(development) + +==== Enhancements: + +* Enabled to dependency chained by extensions. Pull request #39 by Petr Skocik. + +==== Bug fixes + +* Typo fixes in rakefile.rdoc. Pull request #180 by Yuta Kurotaki. +* Fix unexpected behavior of file task with dryrun option. + Pull request #183 by @aycabta. +* Make LoadError from running tests more obvious. Pull request #195 + by Eric Hodel. +* Fix unexpected TypeError with hash stayle option. Pull request #202 + by Kuniaki IGARASHI. + === 12.0.0 ==== Compatibility Changes From 9fe2e43ccbefda6a2290242a6f88934b88d040fc Mon Sep 17 00:00:00 2001 From: Code Ahss Date: Sun, 4 Jun 2017 03:37:47 +0900 Subject: [PATCH 032/142] Update to latest versions of Ruby 2.2, 2.3 and JRuby 9k --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c259f622..b64da9a66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,11 @@ sudo: false rvm: - 2.0.0 - 2.1.10 - - 2.2.6 - - 2.3.3 + - 2.2.7 + - 2.3.4 - 2.4.1 - ruby-head - - jruby-9.1.6.0 + - jruby-9.1.9.0 - jruby-head before_install: - gem install bundler --no-document -v '~> 1.13.3' From 4839e58c5ef288d924b094d044901dbf6dd64928 Mon Sep 17 00:00:00 2001 From: Code Ass Date: Tue, 13 Jun 2017 16:26:08 +0900 Subject: [PATCH 033/142] Add ruby_version 24 and 24-x64 to appveyor.yml --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 44b19a2de..456c13d9e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,3 +18,5 @@ environment: - ruby_version: "22-x64" - ruby_version: "23" - ruby_version: "23-x64" + - ruby_version: "24" + - ruby_version: "24-x64" From 8f6206bfc84dbf719dcfdfbf034fffff2473e15a Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 20 Jun 2017 09:24:13 +0900 Subject: [PATCH 034/142] Specify frozen_string_literal: false --- doc/jamis.rb | 1 + lib/rake.rb | 1 + lib/rake/application.rb | 1 + lib/rake/backtrace.rb | 1 + lib/rake/clean.rb | 1 + lib/rake/cloneable.rb | 1 + lib/rake/cpu_counter.rb | 1 + lib/rake/default_loader.rb | 1 + lib/rake/dsl_definition.rb | 1 + lib/rake/early_time.rb | 1 + lib/rake/ext/core.rb | 1 + lib/rake/ext/string.rb | 1 + lib/rake/file_creation_task.rb | 1 + lib/rake/file_list.rb | 1 + lib/rake/file_task.rb | 1 + lib/rake/file_utils.rb | 1 + lib/rake/file_utils_ext.rb | 1 + lib/rake/invocation_chain.rb | 1 + lib/rake/invocation_exception_mixin.rb | 1 + lib/rake/late_time.rb | 1 + lib/rake/linked_list.rb | 1 + lib/rake/loaders/makefile.rb | 1 + lib/rake/multi_task.rb | 1 + lib/rake/name_space.rb | 1 + lib/rake/packagetask.rb | 1 + lib/rake/phony.rb | 1 + lib/rake/private_reader.rb | 1 + lib/rake/promise.rb | 1 + lib/rake/pseudo_status.rb | 1 + lib/rake/rake_module.rb | 1 + lib/rake/rake_test_loader.rb | 1 + lib/rake/rule_recursion_overflow_error.rb | 1 + lib/rake/scope.rb | 1 + lib/rake/task.rb | 1 + lib/rake/task_argument_error.rb | 1 + lib/rake/task_arguments.rb | 1 + lib/rake/task_manager.rb | 1 + lib/rake/tasklib.rb | 1 + lib/rake/testtask.rb | 1 + lib/rake/thread_history_display.rb | 1 + lib/rake/thread_pool.rb | 1 + lib/rake/trace_output.rb | 1 + lib/rake/version.rb | 1 + lib/rake/win32.rb | 1 + test/helper.rb | 1 + test/support/file_creation.rb | 1 + test/support/rakefile_definitions.rb | 1 + test/support/ruby_runner.rb | 1 + test/test_private_reader.rb | 1 + test/test_rake.rb | 1 + test/test_rake_application.rb | 2 +- test/test_rake_application_options.rb | 1 + test/test_rake_backtrace.rb | 1 + test/test_rake_clean.rb | 1 + test/test_rake_cpu_counter.rb | 1 + test/test_rake_definitions.rb | 1 + test/test_rake_directory_task.rb | 1 + test/test_rake_dsl.rb | 1 + test/test_rake_early_time.rb | 1 + test/test_rake_extension.rb | 1 + test/test_rake_file_creation_task.rb | 1 + test/test_rake_file_list.rb | 1 + test/test_rake_file_list_path_map.rb | 1 + test/test_rake_file_task.rb | 1 + test/test_rake_file_utils.rb | 1 + test/test_rake_functional.rb | 1 + test/test_rake_invocation_chain.rb | 1 + test/test_rake_late_time.rb | 1 + test/test_rake_linked_list.rb | 1 + test/test_rake_makefile_loader.rb | 1 + test/test_rake_multi_task.rb | 1 + test/test_rake_name_space.rb | 1 + test/test_rake_package_task.rb | 1 + test/test_rake_path_map.rb | 1 + test/test_rake_path_map_explode.rb | 1 + test/test_rake_path_map_partial.rb | 1 + test/test_rake_pseudo_status.rb | 1 + test/test_rake_rake_test_loader.rb | 1 + test/test_rake_reduce_compat.rb | 1 + test/test_rake_require.rb | 1 + test/test_rake_rules.rb | 1 + test/test_rake_scope.rb | 1 + test/test_rake_task.rb | 1 + test/test_rake_task_argument_parsing.rb | 1 + test/test_rake_task_arguments.rb | 1 + test/test_rake_task_manager.rb | 1 + test/test_rake_task_manager_argument_resolution.rb | 1 + test/test_rake_task_with_arguments.rb | 1 + test/test_rake_test_task.rb | 1 + test/test_rake_thread_pool.rb | 1 + test/test_rake_top_level_functions.rb | 1 + test/test_rake_win32.rb | 1 + test/test_thread_history_display.rb | 1 + test/test_trace_output.rb | 1 + 94 files changed, 94 insertions(+), 1 deletion(-) diff --git a/doc/jamis.rb b/doc/jamis.rb index c7bc84ac5..6917016e4 100644 --- a/doc/jamis.rb +++ b/doc/jamis.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module RDoc module Page diff --git a/lib/rake.rb b/lib/rake.rb index 07b03284b..68e6badf3 100644 --- a/lib/rake.rb +++ b/lib/rake.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false #-- # Copyright 2003-2010 by Jim Weirich (jim.weirich@gmail.com) # diff --git a/lib/rake/application.rb b/lib/rake/application.rb index e94f17290..576d0f278 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "optparse" require "rake/task_manager" diff --git a/lib/rake/backtrace.rb b/lib/rake/backtrace.rb index a89dd9f4d..b08c3e0c6 100644 --- a/lib/rake/backtrace.rb +++ b/lib/rake/backtrace.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake module Backtrace # :nodoc: all SYS_KEYS = RbConfig::CONFIG.keys.grep(/(?:[a-z]prefix|libdir)\z/) diff --git a/lib/rake/clean.rb b/lib/rake/clean.rb index f66353a0a..92e2025e7 100644 --- a/lib/rake/clean.rb +++ b/lib/rake/clean.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false # The 'rake/clean' file defines two file lists (CLEAN and CLOBBER) and # two rake tasks (:clean and :clobber). # diff --git a/lib/rake/cloneable.rb b/lib/rake/cloneable.rb index d53645f2f..37dd6d9e2 100644 --- a/lib/rake/cloneable.rb +++ b/lib/rake/cloneable.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake ## # Mixin for creating easily cloned objects. diff --git a/lib/rake/cpu_counter.rb b/lib/rake/cpu_counter.rb index 82a5eb8aa..369e1a41f 100644 --- a/lib/rake/cpu_counter.rb +++ b/lib/rake/cpu_counter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # Based on a script at: diff --git a/lib/rake/default_loader.rb b/lib/rake/default_loader.rb index 6154408f4..2d1115e20 100644 --- a/lib/rake/default_loader.rb +++ b/lib/rake/default_loader.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # Default Rakefile loader used by +import+. diff --git a/lib/rake/dsl_definition.rb b/lib/rake/dsl_definition.rb index c52bd601f..203dc0b17 100644 --- a/lib/rake/dsl_definition.rb +++ b/lib/rake/dsl_definition.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false # Rake DSL functions. require "rake/file_utils_ext" diff --git a/lib/rake/early_time.rb b/lib/rake/early_time.rb index abcb1872b..6c6919135 100644 --- a/lib/rake/early_time.rb +++ b/lib/rake/early_time.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # EarlyTime is a fake timestamp that occurs _before_ any other time value. diff --git a/lib/rake/ext/core.rb b/lib/rake/ext/core.rb index 7575df15a..82ad823bf 100644 --- a/lib/rake/ext/core.rb +++ b/lib/rake/ext/core.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false class Module # Check for an existing method in the current class before extending. If # the method already exists, then a warning is printed and the extension is diff --git a/lib/rake/ext/string.rb b/lib/rake/ext/string.rb index 37764c845..1020de5f9 100644 --- a/lib/rake/ext/string.rb +++ b/lib/rake/ext/string.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rake/ext/core" class String diff --git a/lib/rake/file_creation_task.rb b/lib/rake/file_creation_task.rb index f3c5c78a1..a3bf78b0e 100644 --- a/lib/rake/file_creation_task.rb +++ b/lib/rake/file_creation_task.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rake/file_task" require "rake/early_time" diff --git a/lib/rake/file_list.rb b/lib/rake/file_list.rb index a30c6338c..6928333ff 100644 --- a/lib/rake/file_list.rb +++ b/lib/rake/file_list.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rake/cloneable" require "rake/file_utils_ext" require "rake/ext/string" diff --git a/lib/rake/file_task.rb b/lib/rake/file_task.rb index cbb978e7f..1f64530ff 100644 --- a/lib/rake/file_task.rb +++ b/lib/rake/file_task.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rake/task.rb" require "rake/early_time" diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb index 3e56710e2..764c10d29 100644 --- a/lib/rake/file_utils.rb +++ b/lib/rake/file_utils.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rbconfig" require "fileutils" diff --git a/lib/rake/file_utils_ext.rb b/lib/rake/file_utils_ext.rb index e5930d4ab..b3ea9b9a4 100644 --- a/lib/rake/file_utils_ext.rb +++ b/lib/rake/file_utils_ext.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rake/file_utils" module Rake diff --git a/lib/rake/invocation_chain.rb b/lib/rake/invocation_chain.rb index 540628957..84a19b1f5 100644 --- a/lib/rake/invocation_chain.rb +++ b/lib/rake/invocation_chain.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # InvocationChain tracks the chain of task invocations to detect diff --git a/lib/rake/invocation_exception_mixin.rb b/lib/rake/invocation_exception_mixin.rb index 84ff3353b..c252361b2 100644 --- a/lib/rake/invocation_exception_mixin.rb +++ b/lib/rake/invocation_exception_mixin.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake module InvocationExceptionMixin # Return the invocation chain (list of Rake tasks) that were in diff --git a/lib/rake/late_time.rb b/lib/rake/late_time.rb index d1d9470ec..39d00c10b 100644 --- a/lib/rake/late_time.rb +++ b/lib/rake/late_time.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # LateTime is a fake timestamp that occurs _after_ any other time value. class LateTime diff --git a/lib/rake/linked_list.rb b/lib/rake/linked_list.rb index 54d0c1287..32aa79bfd 100644 --- a/lib/rake/linked_list.rb +++ b/lib/rake/linked_list.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # Polylithic linked list structure used to implement several data diff --git a/lib/rake/loaders/makefile.rb b/lib/rake/loaders/makefile.rb index d0436bb79..f1be393d6 100644 --- a/lib/rake/loaders/makefile.rb +++ b/lib/rake/loaders/makefile.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # Makefile loader to be used with the import file loader. Use this to diff --git a/lib/rake/multi_task.rb b/lib/rake/multi_task.rb index 7118dc411..60480b240 100644 --- a/lib/rake/multi_task.rb +++ b/lib/rake/multi_task.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # Same as a regular task, but the immediate prerequisites are done in diff --git a/lib/rake/name_space.rb b/lib/rake/name_space.rb index 0d7eb80b6..39b376fd6 100644 --- a/lib/rake/name_space.rb +++ b/lib/rake/name_space.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false ## # The NameSpace class will lookup task names in the scope defined by a # +namespace+ command. diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb index 034b8e9e8..b7c96b32b 100644 --- a/lib/rake/packagetask.rb +++ b/lib/rake/packagetask.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false # Define a package task library to aid in the definition of # redistributable package files. diff --git a/lib/rake/phony.rb b/lib/rake/phony.rb index a172f9c60..aac793a42 100644 --- a/lib/rake/phony.rb +++ b/lib/rake/phony.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false # Defines a :phony task that you can use as a dependency. This allows # file-based tasks to use non-file-based tasks as prerequisites # without forcing them to rebuild. diff --git a/lib/rake/private_reader.rb b/lib/rake/private_reader.rb index 162097857..121b105c1 100644 --- a/lib/rake/private_reader.rb +++ b/lib/rake/private_reader.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # Include PrivateReader to use +private_reader+. diff --git a/lib/rake/promise.rb b/lib/rake/promise.rb index 37221e427..c5f2b3f10 100644 --- a/lib/rake/promise.rb +++ b/lib/rake/promise.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # A Promise object represents a promise to do work (a chore) in the diff --git a/lib/rake/pseudo_status.rb b/lib/rake/pseudo_status.rb index 16e1903bd..f5f4fe991 100644 --- a/lib/rake/pseudo_status.rb +++ b/lib/rake/pseudo_status.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake ## diff --git a/lib/rake/rake_module.rb b/lib/rake/rake_module.rb index 75feb1261..bb97ec5cd 100644 --- a/lib/rake/rake_module.rb +++ b/lib/rake/rake_module.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rake/application" module Rake diff --git a/lib/rake/rake_test_loader.rb b/lib/rake/rake_test_loader.rb index 98dcced06..88b5cacdc 100644 --- a/lib/rake/rake_test_loader.rb +++ b/lib/rake/rake_test_loader.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rake" # Load the test files from the command line. diff --git a/lib/rake/rule_recursion_overflow_error.rb b/lib/rake/rule_recursion_overflow_error.rb index 39d44aac6..7a5eab0ae 100644 --- a/lib/rake/rule_recursion_overflow_error.rb +++ b/lib/rake/rule_recursion_overflow_error.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # Error indicating a recursion overflow error in task selection. diff --git a/lib/rake/scope.rb b/lib/rake/scope.rb index b432f5f29..540219c7a 100644 --- a/lib/rake/scope.rb +++ b/lib/rake/scope.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake class Scope < LinkedList # :nodoc: all diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 23faf96e5..dc7066466 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rake/invocation_exception_mixin" module Rake diff --git a/lib/rake/task_argument_error.rb b/lib/rake/task_argument_error.rb index 3e1dda64d..277b8b9c7 100644 --- a/lib/rake/task_argument_error.rb +++ b/lib/rake/task_argument_error.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # Error indicating an ill-formed task declaration. diff --git a/lib/rake/task_arguments.rb b/lib/rake/task_arguments.rb index c98057c8f..885d76909 100644 --- a/lib/rake/task_arguments.rb +++ b/lib/rake/task_arguments.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake ## diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index 971984ca5..4e59b63f0 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake # The TaskManager module is a mixin for managing tasks. diff --git a/lib/rake/tasklib.rb b/lib/rake/tasklib.rb index 7bcda1789..7a25d0839 100644 --- a/lib/rake/tasklib.rb +++ b/lib/rake/tasklib.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rake" module Rake diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index bb7f0ee8a..4986e0c9f 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rake" require "rake/tasklib" diff --git a/lib/rake/thread_history_display.rb b/lib/rake/thread_history_display.rb index 04273541e..2d04e4c98 100644 --- a/lib/rake/thread_history_display.rb +++ b/lib/rake/thread_history_display.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rake/private_reader" module Rake diff --git a/lib/rake/thread_pool.rb b/lib/rake/thread_pool.rb index 1c2f5f50f..43ac9f358 100644 --- a/lib/rake/thread_pool.rb +++ b/lib/rake/thread_pool.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "set" require "rake/promise" diff --git a/lib/rake/trace_output.rb b/lib/rake/trace_output.rb index c740b9e23..319ee4471 100644 --- a/lib/rake/trace_output.rb +++ b/lib/rake/trace_output.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake module TraceOutput # :nodoc: all diff --git a/lib/rake/version.rb b/lib/rake/version.rb index 1908ff855..f9a0169df 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module Rake VERSION = "12.0.0" diff --git a/lib/rake/win32.rb b/lib/rake/win32.rb index 1fc02a5ae..94f6935d0 100644 --- a/lib/rake/win32.rb +++ b/lib/rake/win32.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require "rbconfig" module Rake diff --git a/test/helper.rb b/test/helper.rb index 532745319..0c3afc92d 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false $:.unshift File.expand_path("../../lib", __FILE__) require 'coveralls' diff --git a/test/support/file_creation.rb b/test/support/file_creation.rb index facc57a03..7631fa663 100644 --- a/test/support/file_creation.rb +++ b/test/support/file_creation.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module FileCreation OLDFILE = "old" NEWFILE = "new" diff --git a/test/support/rakefile_definitions.rb b/test/support/rakefile_definitions.rb index 9a19d43fc..8632b8d7d 100644 --- a/test/support/rakefile_definitions.rb +++ b/test/support/rakefile_definitions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module RakefileDefinitions include FileUtils diff --git a/test/support/ruby_runner.rb b/test/support/ruby_runner.rb index 199f60dd6..60d48abfe 100644 --- a/test/support/ruby_runner.rb +++ b/test/support/ruby_runner.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false module RubyRunner include FileUtils diff --git a/test/test_private_reader.rb b/test/test_private_reader.rb index 56160f062..7fdbf17b5 100644 --- a/test/test_private_reader.rb +++ b/test/test_private_reader.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "rake/private_reader" diff --git a/test/test_rake.rb b/test/test_rake.rb index dfbb7d232..61fec24f7 100644 --- a/test/test_rake.rb +++ b/test/test_rake.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRake < Rake::TestCase diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index cd8feebbc..9dc140c3b 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -1,4 +1,4 @@ -#encoding: UTF-8 +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeApplication < Rake::TestCase diff --git a/test/test_rake_application_options.rb b/test/test_rake_application_options.rb index 149d8dcfd..466bb2beb 100644 --- a/test/test_rake_application_options.rb +++ b/test/test_rake_application_options.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) TESTING_REQUIRE = [] diff --git a/test/test_rake_backtrace.rb b/test/test_rake_backtrace.rb index ec727a292..60aed4658 100644 --- a/test/test_rake_backtrace.rb +++ b/test/test_rake_backtrace.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "open3" diff --git a/test/test_rake_clean.rb b/test/test_rake_clean.rb index 5439a415f..d4f0dae67 100644 --- a/test/test_rake_clean.rb +++ b/test/test_rake_clean.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "rake/clean" diff --git a/test/test_rake_cpu_counter.rb b/test/test_rake_cpu_counter.rb index aac16b2d7..a55b5731d 100644 --- a/test/test_rake_cpu_counter.rb +++ b/test/test_rake_cpu_counter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeCpuCounter < Rake::TestCase diff --git a/test/test_rake_definitions.rb b/test/test_rake_definitions.rb index 464cc6309..86517b1cd 100644 --- a/test/test_rake_definitions.rb +++ b/test/test_rake_definitions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "fileutils" diff --git a/test/test_rake_directory_task.rb b/test/test_rake_directory_task.rb index e42bd9c77..3121f7b6e 100644 --- a/test/test_rake_directory_task.rb +++ b/test/test_rake_directory_task.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "fileutils" require "pathname" diff --git a/test/test_rake_dsl.rb b/test/test_rake_dsl.rb index 7f82c6afa..d105c4755 100644 --- a/test/test_rake_dsl.rb +++ b/test/test_rake_dsl.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false 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 71ee3e157..39a9eadf3 100644 --- a/test/test_rake_early_time.rb +++ b/test/test_rake_early_time.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeEarlyTime < Rake::TestCase diff --git a/test/test_rake_extension.rb b/test/test_rake_extension.rb index 293ec1304..dafa291c1 100644 --- a/test/test_rake_extension.rb +++ b/test/test_rake_extension.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "stringio" diff --git a/test/test_rake_file_creation_task.rb b/test/test_rake_file_creation_task.rb index 35f843e9e..e4f1c1253 100644 --- a/test/test_rake_file_creation_task.rb +++ b/test/test_rake_file_creation_task.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "fileutils" diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index 32ca7a8e3..f220e07f6 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "pathname" diff --git a/test/test_rake_file_list_path_map.rb b/test/test_rake_file_list_path_map.rb index 28953a97a..46f59273e 100644 --- a/test/test_rake_file_list_path_map.rb +++ b/test/test_rake_file_list_path_map.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeFileListPathMap < Rake::TestCase diff --git a/test/test_rake_file_task.rb b/test/test_rake_file_task.rb index 24614dabe..74840d308 100644 --- a/test/test_rake_file_task.rb +++ b/test/test_rake_file_task.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "fileutils" require "pathname" diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index 00ef76e41..39d4dff61 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "fileutils" require "stringio" diff --git a/test/test_rake_functional.rb b/test/test_rake_functional.rb index 3496bc12d..e6e010b5f 100644 --- a/test/test_rake_functional.rb +++ b/test/test_rake_functional.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "fileutils" require "open3" diff --git a/test/test_rake_invocation_chain.rb b/test/test_rake_invocation_chain.rb index ba5f8724f..61eba3487 100644 --- a/test/test_rake_invocation_chain.rb +++ b/test/test_rake_invocation_chain.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeInvocationChain < Rake::TestCase diff --git a/test/test_rake_late_time.rb b/test/test_rake_late_time.rb index a88826da7..1641da61d 100644 --- a/test/test_rake_late_time.rb +++ b/test/test_rake_late_time.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeLateTime < Rake::TestCase diff --git a/test/test_rake_linked_list.rb b/test/test_rake_linked_list.rb index a3c4d1972..975befc73 100644 --- a/test/test_rake_linked_list.rb +++ b/test/test_rake_linked_list.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestLinkedList < Rake::TestCase diff --git a/test/test_rake_makefile_loader.rb b/test/test_rake_makefile_loader.rb index bd70fd3b6..42ce0f604 100644 --- a/test/test_rake_makefile_loader.rb +++ b/test/test_rake_makefile_loader.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "rake/loaders/makefile" diff --git a/test/test_rake_multi_task.rb b/test/test_rake_multi_task.rb index bab25b158..c614e15af 100644 --- a/test/test_rake_multi_task.rb +++ b/test/test_rake_multi_task.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "thread" diff --git a/test/test_rake_name_space.rb b/test/test_rake_name_space.rb index e043c07fa..274d71c4c 100644 --- a/test/test_rake_name_space.rb +++ b/test/test_rake_name_space.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeNameSpace < Rake::TestCase diff --git a/test/test_rake_package_task.rb b/test/test_rake_package_task.rb index 7bacb7a52..a3ce632ec 100644 --- a/test/test_rake_package_task.rb +++ b/test/test_rake_package_task.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "rake/packagetask" diff --git a/test/test_rake_path_map.rb b/test/test_rake_path_map.rb index 040692930..1f20ad27b 100644 --- a/test/test_rake_path_map.rb +++ b/test/test_rake_path_map.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false 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 554a02266..18f85a11b 100644 --- a/test/test_rake_path_map_explode.rb +++ b/test/test_rake_path_map_explode.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakePathMapExplode < Rake::TestCase diff --git a/test/test_rake_path_map_partial.rb b/test/test_rake_path_map_partial.rb index 0adc24313..c62694545 100644 --- a/test/test_rake_path_map_partial.rb +++ b/test/test_rake_path_map_partial.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakePathMapPartial < Rake::TestCase diff --git a/test/test_rake_pseudo_status.rb b/test/test_rake_pseudo_status.rb index d9fe42216..9c8c3bee3 100644 --- a/test/test_rake_pseudo_status.rb +++ b/test/test_rake_pseudo_status.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakePseudoStatus < Rake::TestCase diff --git a/test/test_rake_rake_test_loader.rb b/test/test_rake_rake_test_loader.rb index 855606d4d..4c84c1bd8 100644 --- a/test/test_rake_rake_test_loader.rb +++ b/test/test_rake_rake_test_loader.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeRakeTestLoader < Rake::TestCase diff --git a/test/test_rake_reduce_compat.rb b/test/test_rake_reduce_compat.rb index de81b474b..71aeabd62 100644 --- a/test/test_rake_reduce_compat.rb +++ b/test/test_rake_reduce_compat.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "open3" diff --git a/test/test_rake_require.rb b/test/test_rake_require.rb index c77344cc3..8b8757f64 100644 --- a/test/test_rake_require.rb +++ b/test/test_rake_require.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeRequire < Rake::TestCase diff --git a/test/test_rake_rules.rb b/test/test_rake_rules.rb index 35f0b45db..2e4f341e5 100644 --- a/test/test_rake_rules.rb +++ b/test/test_rake_rules.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "fileutils" diff --git a/test/test_rake_scope.rb b/test/test_rake_scope.rb index 169c0d9f9..54a32e07a 100644 --- a/test/test_rake_scope.rb +++ b/test/test_rake_scope.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeScope < Rake::TestCase diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 5f5a63e30..b1952db1f 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "fileutils" diff --git a/test/test_rake_task_argument_parsing.rb b/test/test_rake_task_argument_parsing.rb index 4bc0ff0ae..684de7e27 100644 --- a/test/test_rake_task_argument_parsing.rb +++ b/test/test_rake_task_argument_parsing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeTaskArgumentParsing < Rake::TestCase diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index 383d4a172..77d5deb05 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeTaskArguments < Rake::TestCase diff --git a/test/test_rake_task_manager.rb b/test/test_rake_task_manager.rb index a611bd737..d7b3ae669 100644 --- a/test/test_rake_task_manager.rb +++ b/test/test_rake_task_manager.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeTaskManager < Rake::TestCase diff --git a/test/test_rake_task_manager_argument_resolution.rb b/test/test_rake_task_manager_argument_resolution.rb index 6d292816d..ee0b77f9a 100644 --- a/test/test_rake_task_manager_argument_resolution.rb +++ b/test/test_rake_task_manager_argument_resolution.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false 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 5f71b6b1a..cf359daca 100644 --- a/test/test_rake_task_with_arguments.rb +++ b/test/test_rake_task_with_arguments.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeTaskWithArguments < Rake::TestCase diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 8e422f164..76e69982d 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "rake/testtask" diff --git a/test/test_rake_thread_pool.rb b/test/test_rake_thread_pool.rb index d365574ba..8314ac553 100644 --- a/test/test_rake_thread_pool.rb +++ b/test/test_rake_thread_pool.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "rake/thread_pool" diff --git a/test/test_rake_top_level_functions.rb b/test/test_rake_top_level_functions.rb index a3bb2fbb8..7082caad7 100644 --- a/test/test_rake_top_level_functions.rb +++ b/test/test_rake_top_level_functions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeTopLevelFunctions < Rake::TestCase diff --git a/test/test_rake_win32.rb b/test/test_rake_win32.rb index be95adb92..15f6663c9 100644 --- a/test/test_rake_win32.rb +++ b/test/test_rake_win32.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) class TestRakeWin32 < Rake::TestCase diff --git a/test/test_thread_history_display.rb b/test/test_thread_history_display.rb index f3466cef7..304471e71 100644 --- a/test/test_thread_history_display.rb +++ b/test/test_thread_history_display.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "rake/thread_history_display" diff --git a/test/test_trace_output.rb b/test/test_trace_output.rb index 18d2eee0f..a55296f7f 100644 --- a/test/test_trace_output.rb +++ b/test/test_trace_output.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false require File.expand_path("../helper", __FILE__) require "stringio" From 68ef9140c11d083d8bb7ee5da5b0543e3a7df73d Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 20 Jun 2017 09:26:16 +0900 Subject: [PATCH 035/142] Specify frozen_string_literal: true --- doc/jamis.rb | 2 +- lib/rake.rb | 2 +- lib/rake/application.rb | 2 +- lib/rake/backtrace.rb | 2 +- lib/rake/clean.rb | 2 +- lib/rake/cloneable.rb | 2 +- lib/rake/cpu_counter.rb | 2 +- lib/rake/default_loader.rb | 2 +- lib/rake/dsl_definition.rb | 2 +- lib/rake/early_time.rb | 2 +- lib/rake/ext/core.rb | 2 +- lib/rake/ext/string.rb | 2 +- lib/rake/file_creation_task.rb | 2 +- lib/rake/file_list.rb | 2 +- lib/rake/file_task.rb | 2 +- lib/rake/file_utils.rb | 2 +- lib/rake/file_utils_ext.rb | 2 +- lib/rake/invocation_chain.rb | 2 +- lib/rake/invocation_exception_mixin.rb | 2 +- lib/rake/late_time.rb | 2 +- lib/rake/linked_list.rb | 2 +- lib/rake/loaders/makefile.rb | 2 +- lib/rake/multi_task.rb | 2 +- lib/rake/name_space.rb | 2 +- lib/rake/packagetask.rb | 2 +- lib/rake/phony.rb | 2 +- lib/rake/private_reader.rb | 2 +- lib/rake/promise.rb | 2 +- lib/rake/pseudo_status.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/scope.rb | 2 +- lib/rake/task.rb | 2 +- lib/rake/task_argument_error.rb | 2 +- lib/rake/task_arguments.rb | 2 +- lib/rake/task_manager.rb | 2 +- lib/rake/tasklib.rb | 2 +- lib/rake/testtask.rb | 2 +- lib/rake/thread_history_display.rb | 2 +- lib/rake/thread_pool.rb | 2 +- lib/rake/trace_output.rb | 2 +- lib/rake/version.rb | 2 +- lib/rake/win32.rb | 2 +- test/helper.rb | 2 +- test/support/file_creation.rb | 2 +- test/support/rakefile_definitions.rb | 2 +- test/support/ruby_runner.rb | 2 +- test/test_private_reader.rb | 2 +- test/test_rake.rb | 2 +- test/test_rake_application.rb | 2 +- test/test_rake_application_options.rb | 2 +- test/test_rake_backtrace.rb | 2 +- test/test_rake_clean.rb | 2 +- test/test_rake_cpu_counter.rb | 2 +- test/test_rake_definitions.rb | 2 +- test/test_rake_directory_task.rb | 2 +- test/test_rake_dsl.rb | 2 +- test/test_rake_early_time.rb | 2 +- test/test_rake_extension.rb | 2 +- test/test_rake_file_creation_task.rb | 2 +- test/test_rake_file_list.rb | 2 +- test/test_rake_file_list_path_map.rb | 2 +- test/test_rake_file_task.rb | 2 +- test/test_rake_file_utils.rb | 2 +- test/test_rake_functional.rb | 2 +- test/test_rake_invocation_chain.rb | 2 +- test/test_rake_late_time.rb | 2 +- test/test_rake_linked_list.rb | 2 +- test/test_rake_makefile_loader.rb | 2 +- test/test_rake_multi_task.rb | 2 +- test/test_rake_name_space.rb | 2 +- test/test_rake_package_task.rb | 2 +- test/test_rake_path_map.rb | 2 +- test/test_rake_path_map_explode.rb | 2 +- test/test_rake_path_map_partial.rb | 2 +- test/test_rake_pseudo_status.rb | 2 +- test/test_rake_rake_test_loader.rb | 2 +- test/test_rake_reduce_compat.rb | 2 +- test/test_rake_require.rb | 2 +- test/test_rake_rules.rb | 2 +- test/test_rake_scope.rb | 2 +- test/test_rake_task.rb | 2 +- test/test_rake_task_argument_parsing.rb | 2 +- test/test_rake_task_arguments.rb | 2 +- test/test_rake_task_manager.rb | 2 +- test/test_rake_task_manager_argument_resolution.rb | 2 +- test/test_rake_task_with_arguments.rb | 2 +- test/test_rake_test_task.rb | 2 +- test/test_rake_thread_pool.rb | 2 +- test/test_rake_top_level_functions.rb | 2 +- test/test_rake_win32.rb | 2 +- test/test_thread_history_display.rb | 2 +- test/test_trace_output.rb | 2 +- 94 files changed, 94 insertions(+), 94 deletions(-) diff --git a/doc/jamis.rb b/doc/jamis.rb index 6917016e4..531aa7573 100644 --- a/doc/jamis.rb +++ b/doc/jamis.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module RDoc module Page diff --git a/lib/rake.rb b/lib/rake.rb index 68e6badf3..0dfd05315 100644 --- a/lib/rake.rb +++ b/lib/rake.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true #-- # Copyright 2003-2010 by Jim Weirich (jim.weirich@gmail.com) # diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 576d0f278..ae594e098 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "optparse" require "rake/task_manager" diff --git a/lib/rake/backtrace.rb b/lib/rake/backtrace.rb index b08c3e0c6..31ff05450 100644 --- a/lib/rake/backtrace.rb +++ b/lib/rake/backtrace.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake module Backtrace # :nodoc: all SYS_KEYS = RbConfig::CONFIG.keys.grep(/(?:[a-z]prefix|libdir)\z/) diff --git a/lib/rake/clean.rb b/lib/rake/clean.rb index 92e2025e7..5af44015e 100644 --- a/lib/rake/clean.rb +++ b/lib/rake/clean.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # The 'rake/clean' file defines two file lists (CLEAN and CLOBBER) and # two rake tasks (:clean and :clobber). # diff --git a/lib/rake/cloneable.rb b/lib/rake/cloneable.rb index 37dd6d9e2..eddb77e2f 100644 --- a/lib/rake/cloneable.rb +++ b/lib/rake/cloneable.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake ## # Mixin for creating easily cloned objects. diff --git a/lib/rake/cpu_counter.rb b/lib/rake/cpu_counter.rb index 369e1a41f..f3bf6d630 100644 --- a/lib/rake/cpu_counter.rb +++ b/lib/rake/cpu_counter.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # Based on a script at: diff --git a/lib/rake/default_loader.rb b/lib/rake/default_loader.rb index 2d1115e20..d3b4650d3 100644 --- a/lib/rake/default_loader.rb +++ b/lib/rake/default_loader.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # Default Rakefile loader used by +import+. diff --git a/lib/rake/dsl_definition.rb b/lib/rake/dsl_definition.rb index 203dc0b17..3962c1679 100644 --- a/lib/rake/dsl_definition.rb +++ b/lib/rake/dsl_definition.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # Rake DSL functions. require "rake/file_utils_ext" diff --git a/lib/rake/early_time.rb b/lib/rake/early_time.rb index 6c6919135..80cc6bfad 100644 --- a/lib/rake/early_time.rb +++ b/lib/rake/early_time.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # EarlyTime is a fake timestamp that occurs _before_ any other time value. diff --git a/lib/rake/ext/core.rb b/lib/rake/ext/core.rb index 82ad823bf..226f2125b 100644 --- a/lib/rake/ext/core.rb +++ b/lib/rake/ext/core.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true class Module # Check for an existing method in the current class before extending. If # the method already exists, then a warning is printed and the extension is diff --git a/lib/rake/ext/string.rb b/lib/rake/ext/string.rb index 1020de5f9..7bd5064f9 100644 --- a/lib/rake/ext/string.rb +++ b/lib/rake/ext/string.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rake/ext/core" class String diff --git a/lib/rake/file_creation_task.rb b/lib/rake/file_creation_task.rb index a3bf78b0e..2eb251bf1 100644 --- a/lib/rake/file_creation_task.rb +++ b/lib/rake/file_creation_task.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rake/file_task" require "rake/early_time" diff --git a/lib/rake/file_list.rb b/lib/rake/file_list.rb index 6928333ff..748d668f1 100644 --- a/lib/rake/file_list.rb +++ b/lib/rake/file_list.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rake/cloneable" require "rake/file_utils_ext" require "rake/ext/string" diff --git a/lib/rake/file_task.rb b/lib/rake/file_task.rb index 1f64530ff..474b7bd93 100644 --- a/lib/rake/file_task.rb +++ b/lib/rake/file_task.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rake/task.rb" require "rake/early_time" diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb index 764c10d29..3439befab 100644 --- a/lib/rake/file_utils.rb +++ b/lib/rake/file_utils.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rbconfig" require "fileutils" diff --git a/lib/rake/file_utils_ext.rb b/lib/rake/file_utils_ext.rb index b3ea9b9a4..bf558b749 100644 --- a/lib/rake/file_utils_ext.rb +++ b/lib/rake/file_utils_ext.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rake/file_utils" module Rake diff --git a/lib/rake/invocation_chain.rb b/lib/rake/invocation_chain.rb index 84a19b1f5..44a995496 100644 --- a/lib/rake/invocation_chain.rb +++ b/lib/rake/invocation_chain.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # InvocationChain tracks the chain of task invocations to detect diff --git a/lib/rake/invocation_exception_mixin.rb b/lib/rake/invocation_exception_mixin.rb index c252361b2..b0d307a48 100644 --- a/lib/rake/invocation_exception_mixin.rb +++ b/lib/rake/invocation_exception_mixin.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake module InvocationExceptionMixin # Return the invocation chain (list of Rake tasks) that were in diff --git a/lib/rake/late_time.rb b/lib/rake/late_time.rb index 39d00c10b..8fe024943 100644 --- a/lib/rake/late_time.rb +++ b/lib/rake/late_time.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # LateTime is a fake timestamp that occurs _after_ any other time value. class LateTime diff --git a/lib/rake/linked_list.rb b/lib/rake/linked_list.rb index 32aa79bfd..11fa46f0d 100644 --- a/lib/rake/linked_list.rb +++ b/lib/rake/linked_list.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # Polylithic linked list structure used to implement several data diff --git a/lib/rake/loaders/makefile.rb b/lib/rake/loaders/makefile.rb index f1be393d6..46f4beaad 100644 --- a/lib/rake/loaders/makefile.rb +++ b/lib/rake/loaders/makefile.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # Makefile loader to be used with the import file loader. Use this to diff --git a/lib/rake/multi_task.rb b/lib/rake/multi_task.rb index 60480b240..04c9f3109 100644 --- a/lib/rake/multi_task.rb +++ b/lib/rake/multi_task.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # Same as a regular task, but the immediate prerequisites are done in diff --git a/lib/rake/name_space.rb b/lib/rake/name_space.rb index 39b376fd6..32f8139fc 100644 --- a/lib/rake/name_space.rb +++ b/lib/rake/name_space.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true ## # The NameSpace class will lookup task names in the scope defined by a # +namespace+ command. diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb index b7c96b32b..f65affa6d 100644 --- a/lib/rake/packagetask.rb +++ b/lib/rake/packagetask.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # Define a package task library to aid in the definition of # redistributable package files. diff --git a/lib/rake/phony.rb b/lib/rake/phony.rb index aac793a42..8caa5de17 100644 --- a/lib/rake/phony.rb +++ b/lib/rake/phony.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # Defines a :phony task that you can use as a dependency. This allows # file-based tasks to use non-file-based tasks as prerequisites # without forcing them to rebuild. diff --git a/lib/rake/private_reader.rb b/lib/rake/private_reader.rb index 121b105c1..2815ce643 100644 --- a/lib/rake/private_reader.rb +++ b/lib/rake/private_reader.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # Include PrivateReader to use +private_reader+. diff --git a/lib/rake/promise.rb b/lib/rake/promise.rb index c5f2b3f10..ecff4321e 100644 --- a/lib/rake/promise.rb +++ b/lib/rake/promise.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # A Promise object represents a promise to do work (a chore) in the diff --git a/lib/rake/pseudo_status.rb b/lib/rake/pseudo_status.rb index f5f4fe991..8b3c98949 100644 --- a/lib/rake/pseudo_status.rb +++ b/lib/rake/pseudo_status.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake ## diff --git a/lib/rake/rake_module.rb b/lib/rake/rake_module.rb index bb97ec5cd..f5cfde58a 100644 --- a/lib/rake/rake_module.rb +++ b/lib/rake/rake_module.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rake/application" module Rake diff --git a/lib/rake/rake_test_loader.rb b/lib/rake/rake_test_loader.rb index 88b5cacdc..ce3dd8eb6 100644 --- a/lib/rake/rake_test_loader.rb +++ b/lib/rake/rake_test_loader.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rake" # Load the test files from the command line. diff --git a/lib/rake/rule_recursion_overflow_error.rb b/lib/rake/rule_recursion_overflow_error.rb index 7a5eab0ae..a51e77489 100644 --- a/lib/rake/rule_recursion_overflow_error.rb +++ b/lib/rake/rule_recursion_overflow_error.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # Error indicating a recursion overflow error in task selection. diff --git a/lib/rake/scope.rb b/lib/rake/scope.rb index 540219c7a..27c05da89 100644 --- a/lib/rake/scope.rb +++ b/lib/rake/scope.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake class Scope < LinkedList # :nodoc: all diff --git a/lib/rake/task.rb b/lib/rake/task.rb index dc7066466..077f37f4a 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rake/invocation_exception_mixin" module Rake diff --git a/lib/rake/task_argument_error.rb b/lib/rake/task_argument_error.rb index 277b8b9c7..ef20076c6 100644 --- a/lib/rake/task_argument_error.rb +++ b/lib/rake/task_argument_error.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # Error indicating an ill-formed task declaration. diff --git a/lib/rake/task_arguments.rb b/lib/rake/task_arguments.rb index 885d76909..0d3001afd 100644 --- a/lib/rake/task_arguments.rb +++ b/lib/rake/task_arguments.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake ## diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index 4e59b63f0..8bc7d42a4 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake # The TaskManager module is a mixin for managing tasks. diff --git a/lib/rake/tasklib.rb b/lib/rake/tasklib.rb index 7a25d0839..5354b4f94 100644 --- a/lib/rake/tasklib.rb +++ b/lib/rake/tasklib.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rake" module Rake diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 4986e0c9f..66e114762 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rake" require "rake/tasklib" diff --git a/lib/rake/thread_history_display.rb b/lib/rake/thread_history_display.rb index 2d04e4c98..412ea37be 100644 --- a/lib/rake/thread_history_display.rb +++ b/lib/rake/thread_history_display.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rake/private_reader" module Rake diff --git a/lib/rake/thread_pool.rb b/lib/rake/thread_pool.rb index 43ac9f358..b01a5efe0 100644 --- a/lib/rake/thread_pool.rb +++ b/lib/rake/thread_pool.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "set" require "rake/promise" diff --git a/lib/rake/trace_output.rb b/lib/rake/trace_output.rb index 319ee4471..d713a0926 100644 --- a/lib/rake/trace_output.rb +++ b/lib/rake/trace_output.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake module TraceOutput # :nodoc: all diff --git a/lib/rake/version.rb b/lib/rake/version.rb index f9a0169df..a240aa5a4 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Rake VERSION = "12.0.0" diff --git a/lib/rake/win32.rb b/lib/rake/win32.rb index 94f6935d0..6e6203181 100644 --- a/lib/rake/win32.rb +++ b/lib/rake/win32.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require "rbconfig" module Rake diff --git a/test/helper.rb b/test/helper.rb index 0c3afc92d..a6e38cb18 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true $:.unshift File.expand_path("../../lib", __FILE__) require 'coveralls' diff --git a/test/support/file_creation.rb b/test/support/file_creation.rb index 7631fa663..a1313bc0e 100644 --- a/test/support/file_creation.rb +++ b/test/support/file_creation.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module FileCreation OLDFILE = "old" NEWFILE = "new" diff --git a/test/support/rakefile_definitions.rb b/test/support/rakefile_definitions.rb index 8632b8d7d..5dacd3783 100644 --- a/test/support/rakefile_definitions.rb +++ b/test/support/rakefile_definitions.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module RakefileDefinitions include FileUtils diff --git a/test/support/ruby_runner.rb b/test/support/ruby_runner.rb index 60d48abfe..160a57090 100644 --- a/test/support/ruby_runner.rb +++ b/test/support/ruby_runner.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module RubyRunner include FileUtils diff --git a/test/test_private_reader.rb b/test/test_private_reader.rb index 7fdbf17b5..ef08c9d2c 100644 --- a/test/test_private_reader.rb +++ b/test/test_private_reader.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/private_reader" diff --git a/test/test_rake.rb b/test/test_rake.rb index 61fec24f7..2cdab492b 100644 --- a/test/test_rake.rb +++ b/test/test_rake.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRake < Rake::TestCase diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index 9dc140c3b..b52c484dc 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeApplication < Rake::TestCase diff --git a/test/test_rake_application_options.rb b/test/test_rake_application_options.rb index 466bb2beb..b34c2f634 100644 --- a/test/test_rake_application_options.rb +++ b/test/test_rake_application_options.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) TESTING_REQUIRE = [] diff --git a/test/test_rake_backtrace.rb b/test/test_rake_backtrace.rb index 60aed4658..d89817a11 100644 --- a/test/test_rake_backtrace.rb +++ b/test/test_rake_backtrace.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "open3" diff --git a/test/test_rake_clean.rb b/test/test_rake_clean.rb index d4f0dae67..612bd2546 100644 --- a/test/test_rake_clean.rb +++ b/test/test_rake_clean.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/clean" diff --git a/test/test_rake_cpu_counter.rb b/test/test_rake_cpu_counter.rb index a55b5731d..3c3af15bf 100644 --- a/test/test_rake_cpu_counter.rb +++ b/test/test_rake_cpu_counter.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeCpuCounter < Rake::TestCase diff --git a/test/test_rake_definitions.rb b/test/test_rake_definitions.rb index 86517b1cd..2dee13a34 100644 --- a/test/test_rake_definitions.rb +++ b/test/test_rake_definitions.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" diff --git a/test/test_rake_directory_task.rb b/test/test_rake_directory_task.rb index 3121f7b6e..d5fd26f27 100644 --- a/test/test_rake_directory_task.rb +++ b/test/test_rake_directory_task.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" require "pathname" diff --git a/test/test_rake_dsl.rb b/test/test_rake_dsl.rb index d105c4755..162961446 100644 --- a/test/test_rake_dsl.rb +++ b/test/test_rake_dsl.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true 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 39a9eadf3..dc0550b2a 100644 --- a/test/test_rake_early_time.rb +++ b/test/test_rake_early_time.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeEarlyTime < Rake::TestCase diff --git a/test/test_rake_extension.rb b/test/test_rake_extension.rb index dafa291c1..0627ef9b7 100644 --- a/test/test_rake_extension.rb +++ b/test/test_rake_extension.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "stringio" diff --git a/test/test_rake_file_creation_task.rb b/test/test_rake_file_creation_task.rb index e4f1c1253..246f679c7 100644 --- a/test/test_rake_file_creation_task.rb +++ b/test/test_rake_file_creation_task.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index f220e07f6..7e5d1eed0 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "pathname" diff --git a/test/test_rake_file_list_path_map.rb b/test/test_rake_file_list_path_map.rb index 46f59273e..71402cf36 100644 --- a/test/test_rake_file_list_path_map.rb +++ b/test/test_rake_file_list_path_map.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeFileListPathMap < Rake::TestCase diff --git a/test/test_rake_file_task.rb b/test/test_rake_file_task.rb index 74840d308..774cbafd4 100644 --- a/test/test_rake_file_task.rb +++ b/test/test_rake_file_task.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" require "pathname" diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index 39d4dff61..bfdaf75bd 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" require "stringio" diff --git a/test/test_rake_functional.rb b/test/test_rake_functional.rb index e6e010b5f..daf832254 100644 --- a/test/test_rake_functional.rb +++ b/test/test_rake_functional.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" require "open3" diff --git a/test/test_rake_invocation_chain.rb b/test/test_rake_invocation_chain.rb index 61eba3487..338180aaa 100644 --- a/test/test_rake_invocation_chain.rb +++ b/test/test_rake_invocation_chain.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeInvocationChain < Rake::TestCase diff --git a/test/test_rake_late_time.rb b/test/test_rake_late_time.rb index 1641da61d..d07b441a0 100644 --- a/test/test_rake_late_time.rb +++ b/test/test_rake_late_time.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeLateTime < Rake::TestCase diff --git a/test/test_rake_linked_list.rb b/test/test_rake_linked_list.rb index 975befc73..d111575b2 100644 --- a/test/test_rake_linked_list.rb +++ b/test/test_rake_linked_list.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestLinkedList < Rake::TestCase diff --git a/test/test_rake_makefile_loader.rb b/test/test_rake_makefile_loader.rb index 42ce0f604..75713cd2f 100644 --- a/test/test_rake_makefile_loader.rb +++ b/test/test_rake_makefile_loader.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/loaders/makefile" diff --git a/test/test_rake_multi_task.rb b/test/test_rake_multi_task.rb index c614e15af..8a50c2980 100644 --- a/test/test_rake_multi_task.rb +++ b/test/test_rake_multi_task.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "thread" diff --git a/test/test_rake_name_space.rb b/test/test_rake_name_space.rb index 274d71c4c..e8d4d6b20 100644 --- a/test/test_rake_name_space.rb +++ b/test/test_rake_name_space.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeNameSpace < Rake::TestCase diff --git a/test/test_rake_package_task.rb b/test/test_rake_package_task.rb index a3ce632ec..2634267ee 100644 --- a/test/test_rake_package_task.rb +++ b/test/test_rake_package_task.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/packagetask" diff --git a/test/test_rake_path_map.rb b/test/test_rake_path_map.rb index 1f20ad27b..92cf337cb 100644 --- a/test/test_rake_path_map.rb +++ b/test/test_rake_path_map.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true 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 18f85a11b..3174d6ccc 100644 --- a/test/test_rake_path_map_explode.rb +++ b/test/test_rake_path_map_explode.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakePathMapExplode < Rake::TestCase diff --git a/test/test_rake_path_map_partial.rb b/test/test_rake_path_map_partial.rb index c62694545..f65428d71 100644 --- a/test/test_rake_path_map_partial.rb +++ b/test/test_rake_path_map_partial.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakePathMapPartial < Rake::TestCase diff --git a/test/test_rake_pseudo_status.rb b/test/test_rake_pseudo_status.rb index 9c8c3bee3..5a54bc200 100644 --- a/test/test_rake_pseudo_status.rb +++ b/test/test_rake_pseudo_status.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakePseudoStatus < Rake::TestCase diff --git a/test/test_rake_rake_test_loader.rb b/test/test_rake_rake_test_loader.rb index 4c84c1bd8..fa35c44aa 100644 --- a/test/test_rake_rake_test_loader.rb +++ b/test/test_rake_rake_test_loader.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeRakeTestLoader < Rake::TestCase diff --git a/test/test_rake_reduce_compat.rb b/test/test_rake_reduce_compat.rb index 71aeabd62..f3db9a79c 100644 --- a/test/test_rake_reduce_compat.rb +++ b/test/test_rake_reduce_compat.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "open3" diff --git a/test/test_rake_require.rb b/test/test_rake_require.rb index 8b8757f64..899aba5ca 100644 --- a/test/test_rake_require.rb +++ b/test/test_rake_require.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeRequire < Rake::TestCase diff --git a/test/test_rake_rules.rb b/test/test_rake_rules.rb index 2e4f341e5..e71af3502 100644 --- a/test/test_rake_rules.rb +++ b/test/test_rake_rules.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" diff --git a/test/test_rake_scope.rb b/test/test_rake_scope.rb index 54a32e07a..50bb1810b 100644 --- a/test/test_rake_scope.rb +++ b/test/test_rake_scope.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeScope < Rake::TestCase diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index b1952db1f..b2bbb6d95 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" diff --git a/test/test_rake_task_argument_parsing.rb b/test/test_rake_task_argument_parsing.rb index 684de7e27..e34126591 100644 --- a/test/test_rake_task_argument_parsing.rb +++ b/test/test_rake_task_argument_parsing.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeTaskArgumentParsing < Rake::TestCase diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index 77d5deb05..2ae3652da 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeTaskArguments < Rake::TestCase diff --git a/test/test_rake_task_manager.rb b/test/test_rake_task_manager.rb index d7b3ae669..a9157ed81 100644 --- a/test/test_rake_task_manager.rb +++ b/test/test_rake_task_manager.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeTaskManager < Rake::TestCase diff --git a/test/test_rake_task_manager_argument_resolution.rb b/test/test_rake_task_manager_argument_resolution.rb index ee0b77f9a..c07be6f5e 100644 --- a/test/test_rake_task_manager_argument_resolution.rb +++ b/test/test_rake_task_manager_argument_resolution.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true 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 cf359daca..b7a9e03e7 100644 --- a/test/test_rake_task_with_arguments.rb +++ b/test/test_rake_task_with_arguments.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeTaskWithArguments < Rake::TestCase diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 76e69982d..396e05924 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/testtask" diff --git a/test/test_rake_thread_pool.rb b/test/test_rake_thread_pool.rb index 8314ac553..ceb8a5d1b 100644 --- a/test/test_rake_thread_pool.rb +++ b/test/test_rake_thread_pool.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/thread_pool" diff --git a/test/test_rake_top_level_functions.rb b/test/test_rake_top_level_functions.rb index 7082caad7..f3675a096 100644 --- a/test/test_rake_top_level_functions.rb +++ b/test/test_rake_top_level_functions.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeTopLevelFunctions < Rake::TestCase diff --git a/test/test_rake_win32.rb b/test/test_rake_win32.rb index 15f6663c9..292af4715 100644 --- a/test/test_rake_win32.rb +++ b/test/test_rake_win32.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeWin32 < Rake::TestCase diff --git a/test/test_thread_history_display.rb b/test/test_thread_history_display.rb index 304471e71..8adb1940a 100644 --- a/test/test_thread_history_display.rb +++ b/test/test_thread_history_display.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/thread_history_display" diff --git a/test/test_trace_output.rb b/test/test_trace_output.rb index a55296f7f..92de3058b 100644 --- a/test/test_trace_output.rb +++ b/test/test_trace_output.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "stringio" From 23f779f73afb4ef9be9f50774bfb6da03f38c0ec Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 20 Jun 2017 10:19:07 +0900 Subject: [PATCH 036/142] Fixed broken test with frozen objects --- lib/rake/ext/string.rb | 2 +- lib/rake/task.rb | 2 +- test/test_rake_application.rb | 2 +- test/test_rake_path_map_partial.rb | 2 +- test/test_trace_output.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/rake/ext/string.rb b/lib/rake/ext/string.rb index 7bd5064f9..c70236ae9 100644 --- a/lib/rake/ext/string.rb +++ b/lib/rake/ext/string.rb @@ -137,7 +137,7 @@ def pathmap_replace(patterns, &block) # This String extension comes from Rake def pathmap(spec=nil, &block) return self if spec.nil? - result = "" + result = "".dup spec.scan(/%\{[^}]*\}-?\d*[sdpfnxX%]|%-?\d+d|%.|[^%]+/) do |frag| case frag when "%f" diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 077f37f4a..256571112 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -321,7 +321,7 @@ def set_arg_names(args) # Return a string describing the internal state of a task. Useful for # debugging. def investigation - result = "------------------------------\n" + result = "------------------------------\n".dup result << "Investigating #{name}\n" result << "class: #{self.class}\n" result << "task needed: #{needed?}\n" diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index b52c484dc..141dd576f 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -37,7 +37,7 @@ def test_display_exception_details def test_display_exception_details_bad_encoding begin - raise "El Niño is coming!".force_encoding("US-ASCII") + raise "El Niño is coming!".dup.force_encoding("US-ASCII") rescue => ex end diff --git a/test/test_rake_path_map_partial.rb b/test/test_rake_path_map_partial.rb index f65428d71..9daf44ca5 100644 --- a/test/test_rake_path_map_partial.rb +++ b/test/test_rake_path_map_partial.rb @@ -3,7 +3,7 @@ class TestRakePathMapPartial < Rake::TestCase def test_pathmap_partial - @path = "1/2/file" + @path = "1/2/file".dup def @path.call(n) pathmap_partial(n) end diff --git a/test/test_trace_output.rb b/test/test_trace_output.rb index 92de3058b..34dab6162 100644 --- a/test/test_trace_output.rb +++ b/test/test_trace_output.rb @@ -9,7 +9,7 @@ class PrintSpy attr_reader :result, :calls def initialize - @result = "" + @result = "".dup @calls = 0 end From a0e822b2b1b1c85afd50035d56162028743b8ced Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Wed, 28 Jun 2017 17:31:37 -0700 Subject: [PATCH 037/142] Set default rake options explicitly Currently it is impossible to start rake from within a library. By setting the default options explicitly we won't have to call handle_options after replacing ARGV. --- lib/rake/application.rb | 26 ++++++++++++++++++++++++-- test/test_rake_application_options.rb | 26 +++++++++++++------------- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index ae594e098..4fd59bba0 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -619,8 +619,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.trace_output = $stderr + set_default_options OptionParser.new do |opts| opts.banner = "#{Rake.application.name} [-f rakefile] {options} targets..." @@ -782,5 +781,28 @@ def rakefile_location(backtrace=caller) # :nodoc: backtrace.find { |str| str =~ re } || "" end + def set_default_options + options.always_multitask = false + options.backtrace = false + options.build_all = false + options.dryrun = false + options.ignore_deprecate = false + options.ignore_system = false + options.job_stats = false + options.load_system = false + options.nosearch = false + options.rakelib = %w[rakelib] + options.show_all_tasks = false + options.show_prereqs = false + options.show_task_pattern = nil + options.show_tasks = nil + options.silent = false + options.suppress_backtrace_pattern = nil + options.thread_pool_size = Rake.suggested_thread_count + options.trace = false + options.trace_output = $stderr + options.trace_rules = false + end + end end diff --git a/test/test_rake_application_options.rb b/test/test_rake_application_options.rb index b34c2f634..eb4060973 100644 --- a/test/test_rake_application_options.rb +++ b/test/test_rake_application_options.rb @@ -30,19 +30,19 @@ def clear_argv def test_default_options opts = command_line - assert_nil opts.backtrace - assert_nil opts.dryrun - assert_nil opts.ignore_system - assert_nil opts.load_system - assert_nil opts.always_multitask - assert_nil opts.nosearch + assert_equal false, opts.backtrace + assert_equal false, opts.dryrun + assert_equal false, opts.ignore_system + assert_equal false, opts.load_system + assert_equal false, opts.always_multitask + assert_equal false, opts.nosearch assert_equal ["rakelib"], opts.rakelib - assert_nil opts.show_prereqs + assert_equal false, 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 false, opts.silent + assert_equal false, opts.trace + assert_equal Rake.suggested_thread_count, opts.thread_pool_size assert_equal ["rakelib"], opts.rakelib assert ! Rake::FileUtilsExt.verbose_flag assert ! Rake::FileUtilsExt.nowrite_flag @@ -115,7 +115,7 @@ def test_help def test_jobs flags([]) do |opts| - assert_nil opts.thread_pool_size + assert_equal Rake.suggested_thread_count, opts.thread_pool_size end flags(["--jobs", "0"], ["-j", "0"]) do |opts| assert_equal 0, opts.thread_pool_size @@ -329,12 +329,12 @@ def test_tasks flags("--tasks", "-T") do |opts| assert_equal :tasks, opts.show_tasks assert_equal(//.to_s, opts.show_task_pattern.to_s) - assert_nil opts.show_all_tasks + assert_equal false, opts.show_all_tasks end flags(["--tasks", "xyz"], ["-Txyz"]) do |opts| assert_equal :tasks, opts.show_tasks assert_equal(/xyz/.to_s, opts.show_task_pattern.to_s) - assert_nil opts.show_all_tasks + assert_equal false, opts.show_all_tasks end flags(["--tasks", "xyz", "--comments"]) do |opts| assert_equal :tasks, opts.show_tasks From 84e1fe27d5803a32ada80e84d3fc05509200cc18 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Wed, 28 Jun 2017 17:52:24 -0700 Subject: [PATCH 038/142] Allow implicit ARGV for Rake::Application#run This allows users to pass in an explicit ARGV for rake instead of changing their application's ARGV. While the previous commit allows users to create a Rake application explicitly by calling parts of Rake::Application#init directly, some users will not want to dig through the source to set up a Rake application. Swapping ARGV is confusing and error-prone, so this allows them to specify a set of Rake options directly. --- lib/rake/application.rb | 12 ++-- test/test_rake_application.rb | 83 ++++++++------------------- test/test_rake_application_options.rb | 5 +- 3 files changed, 31 insertions(+), 69 deletions(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 4fd59bba0..650b6522c 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -74,19 +74,19 @@ def initialize # If you wish to build a custom rake command, you should call # +init+ on your application. Then define any tasks. Finally, # call +top_level+ to run your top level tasks. - def run + def run(argv = ARGV) standard_exception_handling do - init + init 'rake', argv load_rakefile top_level end end # Initialize the command line parameters and app name. - def init(app_name="rake") + def init(app_name="rake", argv = ARGV) standard_exception_handling do @name = app_name - args = handle_options + args = handle_options argv collect_command_line_tasks(args) end end @@ -618,7 +618,7 @@ def select_trace_output(options, trace_option, value) # :nodoc: # Read and handle the command line options. Returns the command line # arguments that we didn't understand, which should (in theory) be just # task names and env vars. - def handle_options # :nodoc: + def handle_options(argv) # :nodoc: set_default_options OptionParser.new do |opts| @@ -633,7 +633,7 @@ def handle_options # :nodoc: standard_rake_options.each { |args| opts.on(*args) } opts.environment("RAKEOPT") - end.parse(ARGV) + end.parse(argv) end # Similar to the regular Ruby +require+ command, but will check diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index 141dd576f..0212c9b22 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -10,13 +10,6 @@ def setup @app.options.rakelib = [] end - def setup_command_line(*options) - ARGV.clear - options.each do |option| - ARGV << option - end - end - def test_display_exception_details obj = Object.new obj.instance_eval("def #{__method__}; raise 'test'; end", "ruby") @@ -187,7 +180,7 @@ def test_load_rakefile rakefile_unittest @app.instance_eval do - handle_options + handle_options [] options.silent = true load_rakefile end @@ -215,7 +208,7 @@ def test_load_rakefile_from_subdir Dir.chdir "subdir" @app.instance_eval do - handle_options + handle_options [] options.silent = true load_rakefile end @@ -246,7 +239,7 @@ def test_load_rakefile_doesnt_print_rakefile_directory_from_subdir_if_silent _, err = capture_io do @app.instance_eval do - handle_options + handle_options [] options.silent = true raw_load_rakefile end @@ -258,12 +251,11 @@ def test_load_rakefile_doesnt_print_rakefile_directory_from_subdir_if_silent def test_load_rakefile_not_found skip if jruby9? - ARGV.clear Dir.chdir @tempdir ENV["RAKE_SYSTEM"] = "not_exist" @app.instance_eval do - handle_options + handle_options [] options.silent = true end @@ -280,7 +272,7 @@ def test_load_from_system_rakefile rake_system_dir @app.instance_eval do - handle_options + handle_options [] options.silent = true options.load_system = true options.rakelib = [] @@ -302,7 +294,7 @@ def @app.standard_system_dir ENV["RAKE_SYSTEM"] = nil @app.instance_eval do - handle_options + handle_options [] options.silent = true options.load_system = true options.rakelib = [] @@ -362,28 +354,22 @@ def test_building_imported_files_on_demand def test_handle_options_should_not_strip_options_from_argv assert !@app.options.trace - valid_option = "--trace" - setup_command_line(valid_option) + argv = %w[--trace] + @app.handle_options argv - @app.handle_options - - assert ARGV.include?(valid_option) + assert_includes argv, '--trace' assert @app.options.trace end def test_handle_options_trace_default_is_stderr - setup_command_line("--trace") - - @app.handle_options + @app.handle_options %w[--trace] assert_equal STDERR, @app.options.trace_output assert @app.options.trace end def test_handle_options_trace_overrides_to_stdout - setup_command_line("--trace=stdout") - - @app.handle_options + @app.handle_options %w[--trace=stdout] assert_equal STDOUT, @app.options.trace_output assert @app.options.trace @@ -392,18 +378,16 @@ def test_handle_options_trace_overrides_to_stdout def test_handle_options_trace_does_not_eat_following_task_names assert !@app.options.trace - setup_command_line("--trace", "sometask") + argv = %w[--trace sometask] + @app.handle_options argv - @app.handle_options - assert ARGV.include?("sometask") + assert argv.include?("sometask") assert @app.options.trace end def test_good_run ran = false - ARGV << '--rakelib=""' - @app.options.silent = true @app.instance_eval do @@ -413,7 +397,7 @@ def test_good_run rakefile_default out, err = capture_io do - @app.run + @app.run %w[--rakelib=""] end assert ran @@ -423,10 +407,9 @@ def test_good_run def test_display_task_run ran = false - setup_command_line("-f", "-s", "--tasks", '--rakelib=""') @app.last_description = "COMMENT" @app.define_task(Rake::Task, "default") - out, = capture_io { @app.run } + out, = capture_io { @app.run %w[-f -s --tasks --rakelib=""] } assert @app.options.show_tasks assert ! ran assert_match(/rake default/, out) @@ -435,13 +418,12 @@ def test_display_task_run def test_display_prereqs ran = false - setup_command_line("-f", "-s", "--prereqs", '--rakelib=""') @app.last_description = "COMMENT" t = @app.define_task(Rake::Task, "default") t.enhance([:a, :b]) @app.define_task(Rake::Task, "a") @app.define_task(Rake::Task, "b") - out, = capture_io { @app.run } + out, = capture_io { @app.run %w[-f -s --prereqs --rakelib=""] } assert @app.options.show_prereqs assert ! ran assert_match(/rake a$/, out) @@ -451,37 +433,28 @@ def test_display_prereqs 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 %w[-f -s --rakelib=""]} } assert_match(/see full trace/i, err) - ensure - ARGV.clear end def test_bad_run_with_trace @app.intern(Rake::Task, "default").enhance { fail } - setup_command_line("-f", "-s", "-t") _, err = capture_io { - assert_raises(SystemExit) { @app.run } + assert_raises(SystemExit) { @app.run %w[-f -s -t] } } refute_match(/see full trace/i, err) - ensure - ARGV.clear end def test_bad_run_with_backtrace @app.intern(Rake::Task, "default").enhance { fail } - setup_command_line("-f", "-s", "--backtrace") _, err = capture_io { assert_raises(SystemExit) { - @app.run + @app.run %w[-f -s --backtrace] } } refute_match(/see full trace/, err) - ensure - ARGV.clear end CustomError = Class.new(RuntimeError) @@ -490,10 +463,9 @@ def test_bad_run_includes_exception_name @app.intern(Rake::Task, "default").enhance { raise CustomError, "intentional" } - setup_command_line("-f", "-s") _, err = capture_io { assert_raises(SystemExit) { - @app.run + @app.run %w[-f -s] } } assert_match(/CustomError: intentional/, err) @@ -503,10 +475,9 @@ def test_rake_error_excludes_exception_name @app.intern(Rake::Task, "default").enhance { fail "intentional" } - setup_command_line("-f", "-s") _, err = capture_io { assert_raises(SystemExit) { - @app.run + @app.run %w[-f -s] } } refute_match(/RuntimeError/, err) @@ -527,28 +498,22 @@ def test_printing_original_exception_cause raise custom_error, "Secondary Error" end } - setup_command_line("-f", "-s") _ ,err = capture_io { assert_raises(SystemExit) { - @app.run + @app.run %w[-f -s] } } if cause_supported? assert_match(/Original Error/, err) end assert_match(/Secondary Error/, err) - ensure - ARGV.clear end def test_run_with_bad_options @app.intern(Rake::Task, "default").enhance { fail } - setup_command_line("-f", "-s", "--xyzzy") assert_raises(SystemExit) { - capture_io { @app.run } + capture_io { @app.run %w[-f -s --xyzzy] } } - ensure - ARGV.clear end def test_standard_exception_handling_invalid_option diff --git a/test/test_rake_application_options.rb b/test/test_rake_application_options.rb index eb4060973..a8a71a981 100644 --- a/test/test_rake_application_options.rb +++ b/test/test_rake_application_options.rb @@ -445,8 +445,6 @@ def test_rake_explicit_task_library def flags(*sets) sets.each do |set| - ARGV.clear - @exit = catch(:system_exit) { command_line(*set) } yield(@app.options) if block_given? @@ -454,13 +452,12 @@ def flags(*sets) end def command_line(*options) - options.each do |opt| ARGV << opt end @app = Rake::Application.new def @app.exit(*args) throw :system_exit, :exit end @app.instance_eval do - args = handle_options + args = handle_options options collect_command_line_tasks(args) end @tasks = @app.top_level_tasks From ee7e30be5abbdd4e0190bcdf06abf6521e72cb91 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Wed, 28 Jun 2017 17:58:12 -0700 Subject: [PATCH 039/142] Remove test ARGV manipulation These are no longer necessary --- test/test_rake_application_options.rb | 6 ------ test/test_rake_task_argument_parsing.rb | 6 ++---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/test/test_rake_application_options.rb b/test/test_rake_application_options.rb index a8a71a981..d774678b6 100644 --- a/test/test_rake_application_options.rb +++ b/test/test_rake_application_options.rb @@ -9,7 +9,6 @@ def setup super @testkey = ENV["TESTKEY"] - clear_argv Rake::FileUtilsExt.verbose_flag = false Rake::FileUtilsExt.nowrite_flag = false TESTING_REQUIRE.clear @@ -17,17 +16,12 @@ def setup def teardown ENV["TESTKEY"] = @testkey - clear_argv Rake::FileUtilsExt.verbose_flag = false Rake::FileUtilsExt.nowrite_flag = false super end - def clear_argv - ARGV.pop until ARGV.empty? - end - def test_default_options opts = command_line assert_equal false, opts.backtrace diff --git a/test/test_rake_task_argument_parsing.rb b/test/test_rake_task_argument_parsing.rb index e34126591..fc494a463 100644 --- a/test/test_rake_task_argument_parsing.rb +++ b/test/test_rake_task_argument_parsing.rb @@ -96,16 +96,14 @@ def @app.unix?() raise end end def test_no_rakeopt - ARGV << "--trace" app = Rake::Application.new - app.init + app.init %w[--trace] assert !app.options.silent end def test_rakeopt_with_blank_options - ARGV << "--trace" app = Rake::Application.new - app.init + app.init %w[--trace] assert !app.options.silent end From ae4f78662accf3145654a005e9f0c0a38b1bd287 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Wed, 28 Jun 2017 18:14:48 -0700 Subject: [PATCH 040/142] Add Rake::with_application This allows users to use Rake as a library more easily. This allows loading multiple rakefiles from separate sources into separate Rake applications without task name collisions. --- lib/rake/rake_module.rb | 30 ++++++++++++++++++++++++++++++ test/test_rake_application.rb | 30 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/lib/rake/rake_module.rb b/lib/rake/rake_module.rb index f5cfde58a..1ee9d7d63 100644 --- a/lib/rake/rake_module.rb +++ b/lib/rake/rake_module.rb @@ -34,6 +34,36 @@ def add_rakelib(*files) application.options.rakelib ||= [] application.options.rakelib.concat(files) end + + # Make +block_application+ the default rake application inside a block so + # you can load rakefiles into a different application. + # + # This is useful when you want to run rake tasks inside a library without + # running rake in a sub-shell. + # + # Example: + # + # Dir.chdir 'other/directory' + # + # other_rake = Rake.with_application do |rake| + # rake.set_default_options + # + # rake.load_rakefile + # end + # + # puts other_rake.tasks + + def with_application(block_application = Rake::Application.new) + orig_application = Rake.application + + Rake.application = block_application + + yield block_application + + block_application + ensure + Rake.application = orig_application + end end end diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index 0212c9b22..c7d45652c 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -10,6 +10,36 @@ def setup @app.options.rakelib = [] end + def test_class_with_application + orig_app = Rake.application + + return_app = Rake.with_application do |yield_app| + refute_equal orig_app, yield_app, 'new application must be yielded' + + assert_equal yield_app, Rake.application, + 'new application must be default in block' + end + + refute_equal orig_app, return_app, 'new application not returned' + assert_equal orig_app, Rake.application, 'original application not default' + end + + def test_class_with_application_user_defined + orig_app = Rake.application + + user_app = Rake::Application.new + + return_app = Rake.with_application user_app do |yield_app| + assert_equal user_app, yield_app, 'user application must be yielded' + + assert_equal user_app, Rake.application, + 'user application must be default in block' + end + + assert_equal user_app, return_app, 'user application not returned' + assert_equal orig_app, Rake.application, 'original application not default' + end + def test_display_exception_details obj = Object.new obj.instance_eval("def #{__method__}; raise 'test'; end", "ruby") From 4f9c15644910c4c82c318f18753480adf4caa284 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Wed, 28 Jun 2017 18:36:29 -0700 Subject: [PATCH 041/142] Always set_default_options This allows Rake.with_application to work without users having to know to set the default options manually. --- lib/rake/application.rb | 2 ++ lib/rake/rake_module.rb | 2 -- test/test_rake_application.rb | 9 +++++++++ test/test_rake_task.rb | 12 +++++++++--- test/test_rake_win32.rb | 6 +++++- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 650b6522c..8c896888f 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -62,6 +62,8 @@ def initialize add_loader("rake", DefaultLoader.new) @tty_output = STDOUT.tty? @terminal_columns = ENV["RAKE_COLUMNS"].to_i + + set_default_options end # Run the Rake application. The run method performs the following diff --git a/lib/rake/rake_module.rb b/lib/rake/rake_module.rb index 1ee9d7d63..03c295624 100644 --- a/lib/rake/rake_module.rb +++ b/lib/rake/rake_module.rb @@ -46,8 +46,6 @@ def add_rakelib(*files) # Dir.chdir 'other/directory' # # other_rake = Rake.with_application do |rake| - # rake.set_default_options - # # rake.load_rakefile # end # diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index c7d45652c..456f7d878 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -49,6 +49,8 @@ def test_display_exception_details end out, err = capture_io do + @app.set_default_options # reset trace output IO + @app.display_error_message ex end @@ -65,6 +67,8 @@ def test_display_exception_details_bad_encoding end out, err = capture_io do + @app.set_default_options # reset trace output IO + @app.display_error_message ex end @@ -86,6 +90,8 @@ def test_display_exception_details_cause end out, err = capture_io do + @app.set_default_options # reset trace output IO + @app.display_error_message ex end @@ -472,6 +478,7 @@ def test_bad_run def test_bad_run_with_trace @app.intern(Rake::Task, "default").enhance { fail } _, err = capture_io { + @app.set_default_options assert_raises(SystemExit) { @app.run %w[-f -s -t] } } refute_match(/see full trace/i, err) @@ -563,6 +570,8 @@ def test_standard_exception_handling_invalid_option def test_standard_exception_handling_other out, err = capture_io do + @app.set_default_options # reset trace output IO + e = assert_raises SystemExit do @app.standard_exception_handling do raise "blah" diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index b2bbb6d95..8bfdedb4e 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -62,10 +62,14 @@ def test_invoke_with_circular_dependencies end def test_dry_run_prevents_actions - Rake.application.options.dryrun = true runlist = [] t1 = task(:t1) { |t| runlist << t.name; 3321 } - _, err = capture_io { t1.invoke } + _, err = capture_io { + Rake.application.set_default_options # reset trace output IO + Rake.application.options.dryrun = true + + t1.invoke + } assert_match(/execute .*t1/i, err) assert_match(/dry run/i, err) refute_match(/invoke/i, err) @@ -75,9 +79,11 @@ def test_dry_run_prevents_actions end def test_tasks_can_be_traced - Rake.application.options.trace = true t1 = task(:t1) _, err = capture_io { + Rake.application.set_default_options # reset trace output IO + Rake.application.options.trace = true + t1.invoke } assert_match(/invoke t1/i, err) diff --git a/test/test_rake_win32.rb b/test/test_rake_win32.rb index 292af4715..6c341f486 100644 --- a/test/test_rake_win32.rb +++ b/test/test_rake_win32.rb @@ -65,7 +65,11 @@ def test_win32_backtrace_with_different_case rake.options.trace = true rake.instance_variable_set(:@rakefile, "Rakefile") - _, err = capture_io { rake.display_error_message(ex) } + _, err = capture_io { + rake.set_default_options # reset trace output IO + + rake.display_error_message(ex) + } assert_match(/rakefile/, err) end From ab19d387041f0d54aa0269bd8c11f2a605becb9d Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 1 Jul 2017 16:45:13 +0900 Subject: [PATCH 042/142] History --- History.rdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/History.rdoc b/History.rdoc index d1bf4b85f..d52c7e2a9 100644 --- a/History.rdoc +++ b/History.rdoc @@ -3,6 +3,7 @@ ==== Enhancements: * Enabled to dependency chained by extensions. Pull request #39 by Petr Skocik. +* Make all of string literals to frozen objects on Ruby 2.4 or later. ==== Bug fixes From 2a5f102e096aacebb0a4d81c697ff934de4a0590 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 1 Jul 2017 16:46:16 +0900 Subject: [PATCH 043/142] Added declaration of frozen string literals --- rake.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/rake.gemspec b/rake.gemspec index 911384c46..4d04b9c3e 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -1,3 +1,4 @@ +# frozen_string_literal: true $LOAD_PATH.unshift File.expand_path('../lib', __FILE__) require 'rake/version' From 537daaca8ac9c4298098c28dc43e4e115f01a42f Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 1 Jul 2017 17:30:53 +0900 Subject: [PATCH 044/142] Added broken test for https://github.com/ruby/rake/pull/182 --- test/test_rake_rules.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_rake_rules.rb b/test/test_rake_rules.rb index e71af3502..739e35470 100644 --- a/test/test_rake_rules.rb +++ b/test/test_rake_rules.rb @@ -343,6 +343,17 @@ def test_regex_rule_with_args Task[OBJFILE].invoke("arg") end + # for https://github.com/ruby/rake/pull/182 + def test_single_dependent_with_nil_args + create_file(SRCFILE) + rule nil => ".cpp" do |t| p t.name end + rule(/\.o$/ => ".c") do |t| + @runs << t.name + end + Task[OBJFILE].invoke + assert_equal [OBJFILE], @runs + end + def test_string_rule_with_args_and_lambda_prereq delete_file(OBJFILE) create_file(SRCFILE) From 316c76d9737a7dbaa441e34fa193e045622c336e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 1 Jul 2017 17:34:49 +0900 Subject: [PATCH 045/142] Added documentation for warning option --- lib/rake/testtask.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 66e114762..537627567 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -51,6 +51,7 @@ class TestTask < TaskLib # Request that the tests be run with the warning flag set. # E.g. warning=true implies "ruby -w" used to run the tests. + # (default is true) attr_accessor :warning # Glob pattern to match test files. (default is 'test/test*.rb') From 04f5778752bed2f330277aa19985cb589a6425fe Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 17 Aug 2017 13:18:40 +0200 Subject: [PATCH 046/142] gemspec: Exclude various YAML configuration files --- rake.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index 4d04b9c3e..4d1a223d2 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -24,7 +24,8 @@ Rake has the following features: s.homepage = "https://github.com/ruby/rake".freeze s.licenses = ["MIT".freeze] - s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - + %w[.rubocop.yml .travis.yml appveyor.yml] s.bindir = "exe" s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) } s.require_paths = ["lib".freeze] From 18704dd6c85064030368dfbc386ffeb01b644729 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 17 Aug 2017 22:18:31 +0200 Subject: [PATCH 047/142] Travis: jruby-9.1.12.0 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b64da9a66..c68768e11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ rvm: - 2.3.4 - 2.4.1 - ruby-head - - jruby-9.1.9.0 + - jruby-9.1.12.0 - jruby-head before_install: - gem install bundler --no-document -v '~> 1.13.3' From aedc33ca9c17297f448a4729c065427a650d487e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 21 Aug 2017 11:42:13 +0900 Subject: [PATCH 048/142] added rubocop to development dependency --- rake.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/rake.gemspec b/rake.gemspec index 4d1a223d2..9f9f356eb 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -39,4 +39,5 @@ Rake has the following features: s.add_development_dependency(%q.freeze) s.add_development_dependency(%q.freeze) s.add_development_dependency(%q.freeze) + s.add_development_dependency(%q.freeze) end From de98d29359a47d8d0e753cc3bbcad67148b0f08a Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 21 Aug 2017 11:42:33 +0900 Subject: [PATCH 049/142] Renamed obsoleted parameter AlignWith to EnforcedStyleAlignWith --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index acdf2e117..19f0bb798 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -54,4 +54,4 @@ Style/BracesAroundHashParameters: Lint/EndAlignment: Enabled: true - AlignWith: variable + EnforcedStyleAlignWith: variable From fb2320156611729467f986f6529b24e0fb692af7 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 21 Aug 2017 11:44:10 +0900 Subject: [PATCH 050/142] Fixed deprecated warnings --- .rubocop.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 19f0bb798..25589b98c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ AllCops: - doc/**/*.rb - rake.gemspec -Style/LineLength: +Metrics/LineLength: Enabled: true Max: 120 @@ -16,31 +16,31 @@ Style/StringLiterals: Enabled: true EnforcedStyle: double_quotes -Style/IndentationWidth: +Layout/IndentationWidth: Enabled: true -Style/Tab: +Layout/Tab: Enabled: true -Style/EmptyLines: +Layout/EmptyLines: Enabled: true -Style/TrailingBlankLines: +Layout/TrailingBlankLines: Enabled: true -Style/TrailingWhitespace: +Layout/TrailingWhitespace: Enabled: true -Style/SpaceBeforeBlockBraces: +Layout/SpaceBeforeBlockBraces: Enabled: true -Style/SpaceInsideBlockBraces: +Layout/SpaceInsideBlockBraces: Enabled: true -Style/SpaceInsideHashLiteralBraces: +Layout/SpaceInsideHashLiteralBraces: Enabled: true -Style/CaseIndentation: +Layout/CaseIndentation: Enabled: true Style/MultilineIfThen: From d7baa00984168d4b1707573dee643115917f646f Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 21 Aug 2017 11:44:23 +0900 Subject: [PATCH 051/142] Ordered --- .rubocop.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 25589b98c..29aa862a5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -16,6 +16,15 @@ Style/StringLiterals: Enabled: true EnforcedStyle: double_quotes +Style/MultilineIfThen: + Enabled: true + +Style/MethodDefParentheses: + Enabled: true + +Style/BracesAroundHashParameters: + Enabled: true + Layout/IndentationWidth: Enabled: true @@ -43,15 +52,6 @@ Layout/SpaceInsideHashLiteralBraces: Layout/CaseIndentation: Enabled: true -Style/MultilineIfThen: - Enabled: true - -Style/MethodDefParentheses: - Enabled: true - -Style/BracesAroundHashParameters: - Enabled: true - Lint/EndAlignment: Enabled: true EnforcedStyleAlignWith: variable From 879e08f34bdbb6f4236f8f2fe1f205b0199601d1 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 21 Aug 2017 11:44:43 +0900 Subject: [PATCH 052/142] rubocop -a --- test/helper.rb | 2 +- test/test_rake_file_utils.rb | 2 +- test/test_rake_rake_test_loader.rb | 4 ++-- test/test_rake_rules.rb | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/helper.rb b/test/helper.rb index a6e38cb18..17447ab2e 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true $:.unshift File.expand_path("../../lib", __FILE__) -require 'coveralls' +require "coveralls" Coveralls.wear! gem "minitest", "~> 5" diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index bfdaf75bd..90526b1d9 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -186,7 +186,7 @@ def test_sh_with_hash_option check_expansion verbose(false) { - sh "#{RUBY} check_expansion.rb", {chdir: "."}, { verbose: false } + sh "#{RUBY} check_expansion.rb", { chdir: "." }, verbose: false } end diff --git a/test/test_rake_rake_test_loader.rb b/test/test_rake_rake_test_loader.rb index fa35c44aa..fabee4721 100644 --- a/test/test_rake_rake_test_loader.rb +++ b/test/test_rake_rake_test_loader.rb @@ -6,7 +6,7 @@ class TestRakeRakeTestLoader < Rake::TestCase def setup super - @loader = File.join @rake_lib, 'rake/rake_test_loader.rb' + @loader = File.join @rake_lib, "rake/rake_test_loader.rb" end def test_pattern @@ -35,7 +35,7 @@ def test_load_error assert_empty out - no_such_path = File.join @tempdir, 'no_such_test_file' + no_such_path = File.join @tempdir, "no_such_test_file" expected = /\A\n diff --git a/test/test_rake_rules.rb b/test/test_rake_rules.rb index 739e35470..52934c258 100644 --- a/test/test_rake_rules.rb +++ b/test/test_rake_rules.rb @@ -11,7 +11,7 @@ class TestRakeRules < Rake::TestCase OBJFILE = "abc.o" FOOFILE = "foo" DOTFOOFILE = ".foo" - MINFILE = 'abc.min.o' + MINFILE = "abc.min.o" def setup super @@ -400,7 +400,7 @@ def obj.find_prereq(task_name) def test_works_with_chained_extensions_in_rules create_file(OBJFILE) - rule('.min.o' => ['.o']) do |t| + rule(".min.o" => [".o"]) do |t| @runs << t.name assert_equal OBJFILE, t.source assert_equal MINFILE, t.name From 0d007f754116df9cc31ea8129ae980470cb349f2 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Fri, 8 Sep 2017 13:08:40 +0200 Subject: [PATCH 053/142] Travis: jruby-9.1.13.0 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c68768e11..3a955aa68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ rvm: - 2.3.4 - 2.4.1 - ruby-head - - jruby-9.1.12.0 + - jruby-9.1.13.0 - jruby-head before_install: - gem install bundler --no-document -v '~> 1.13.3' From d54013d4d2e255605867739d4826c44a3eea35a6 Mon Sep 17 00:00:00 2001 From: Christina Thompson Date: Fri, 8 Sep 2017 18:00:12 -0400 Subject: [PATCH 054/142] Added did you mean to rake Signed-off-by: Yuki Nishijima --- lib/rake/task_manager.rb | 16 +++++++++++++++- test/test_rake_task.rb | 13 ++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index f928309ed..e2531c8ef 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -56,7 +56,21 @@ def [](task_name, scopes=nil) self.lookup(task_name, scopes) or enhance_with_matching_rule(task_name) or synthesize_file_task(task_name) or - fail "Don't know how to build task '#{task_name}' (see --tasks)" + fail generate_message_for_undefined_task(task_name) + end + + def generate_message_for_undefined_task(task_name) + message = "Don't know how to build task '#{task_name}' (see --tasks)" + + suggestion_message = \ + if defined?(::DidYouMean::SpellChecker) && defined?(::DidYouMean::Formatter) + suggestions = ::DidYouMean::SpellChecker.new(dictionary: @tasks.keys).correct(task_name.to_s) + ::DidYouMean::Formatter.new(suggestions).to_s + else + "" + end + + message + suggestion_message end def synthesize_file_task(task_name) # :nodoc: diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index b2bbb6d95..bbf3b5444 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -453,4 +453,15 @@ def test_source_is_first_prerequisite t = task t: ["preqA", "preqB"] assert_equal "preqA", t.source end -end + + def test_suggests_valid_rake_task_names + task :test + error = assert_raises(RuntimeError) { Task[:testt] } + + assert_match /Don\'t know how to build task \'testt\'/, error.message + + if defined?(::DidYouMean::SpellChecker) && defined?(::DidYouMean::Formatter) + assert_match /Did you mean\? test/, error.message + end + end +end \ No newline at end of file From 82467f13079329f3c90697441d70037d2a76d168 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 11 Sep 2017 11:09:46 +0900 Subject: [PATCH 055/142] rubocop -a --- test/test_rake_task.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index bbf3b5444..b532d7903 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -464,4 +464,4 @@ def test_suggests_valid_rake_task_names assert_match /Did you mean\? test/, error.message end end -end \ No newline at end of file +end From 972c9ce327bc7546648cb4ac5c1055bbfe401fdb Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 11 Sep 2017 11:11:58 +0900 Subject: [PATCH 056/142] History --- History.rdoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/History.rdoc b/History.rdoc index d52c7e2a9..cab37a378 100644 --- a/History.rdoc +++ b/History.rdoc @@ -2,6 +2,8 @@ ==== Enhancements: +* Added did_you_mean feature for invalid rake task. + Pull request #221 by @xtina-starr * Enabled to dependency chained by extensions. Pull request #39 by Petr Skocik. * Make all of string literals to frozen objects on Ruby 2.4 or later. From f543024ad92d3f5c428a81ba553f3b287b7b80cb Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 11 Sep 2017 11:19:53 +0900 Subject: [PATCH 057/142] bump release version to 12.1.0 --- History.rdoc | 2 +- lib/rake/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/History.rdoc b/History.rdoc index cab37a378..49d3b3a63 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,4 +1,4 @@ -=== 12.1.0(development) +=== 12.1.0 ==== Enhancements: diff --git a/lib/rake/version.rb b/lib/rake/version.rb index a240aa5a4..7a309b9dc 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "12.0.0" + VERSION = "12.1.0" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "." From 3d6df97a6fbc44572e08b39e5bc4aed87a3a6278 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 11 Sep 2017 17:15:12 +0900 Subject: [PATCH 058/142] Fixed release date #222. --- rake.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index 9f9f356eb..f3e77ca2f 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-12-06" + s.date = "2017-09-11" s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze] s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze] From d183f4d6d124d6f164db3584608692bb7d8845f2 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Mon, 11 Sep 2017 21:48:32 +0900 Subject: [PATCH 059/142] Fix typo --- History.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index 49d3b3a63..079e65dcb 100644 --- a/History.rdoc +++ b/History.rdoc @@ -14,7 +14,7 @@ Pull request #183 by @aycabta. * Make LoadError from running tests more obvious. Pull request #195 by Eric Hodel. -* Fix unexpected TypeError with hash stayle option. Pull request #202 +* Fix unexpected TypeError with hash style option. Pull request #202 by Kuniaki IGARASHI. === 12.0.0 From 735609168e29aa3825687bac4fb57fd4599e726e Mon Sep 17 00:00:00 2001 From: Keiji Yoshimi Date: Mon, 25 Sep 2017 22:53:11 +0900 Subject: [PATCH 060/142] fixed warnings ``` test/test_rake_task.rb:467: warning: ambiguous first argument; put parentheses or a space even after `/' operator test/test_rake_task.rb:470: warning: ambiguous first argument; put parentheses or a space even after `/' operator ``` --- test/test_rake_task.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index da1d0d82a..5b9605964 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -464,10 +464,10 @@ def test_suggests_valid_rake_task_names task :test error = assert_raises(RuntimeError) { Task[:testt] } - assert_match /Don\'t know how to build task \'testt\'/, error.message + assert_match(/Don\'t know how to build task \'testt\'/, error.message) if defined?(::DidYouMean::SpellChecker) && defined?(::DidYouMean::Formatter) - assert_match /Did you mean\? test/, error.message + assert_match(/Did you mean\? test/, error.message) end end end From 02fbc5cd93697736be32cdd7c883a4cd83a0357b Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Sep 2017 13:37:32 +0900 Subject: [PATCH 061/142] Removed _JAVA_OPTIONS for JRuby task --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3a955aa68..24aa8aa61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ before_install: - gem install bundler --no-document -v '~> 1.13.3' before_script: - unset JRUBY_OPTS + - unset _JAVA_OPTIONS script: ruby -Ilib exe/rake notifications: email: From 089363455d32153d5f76b57ea060d99e5a19ab68 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Sep 2017 13:37:48 +0900 Subject: [PATCH 062/142] Removed needless bundler installation --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 24aa8aa61..81ab4e34c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,6 @@ rvm: - ruby-head - jruby-9.1.13.0 - jruby-head -before_install: - - gem install bundler --no-document -v '~> 1.13.3' before_script: - unset JRUBY_OPTS - unset _JAVA_OPTIONS From 48c78945778beaa711d23a61f99593d19286d318 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Sep 2017 13:39:10 +0900 Subject: [PATCH 063/142] Removed needless notification --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81ab4e34c..5ee1b39be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,3 @@ before_script: - unset JRUBY_OPTS - unset _JAVA_OPTIONS script: ruby -Ilib exe/rake -notifications: - email: - - hsbt@ruby-lang.org - - drbrain@segment7.net From 976f97363b6109eb625e3608c6f424f33c9d640a Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Sep 2017 13:39:26 +0900 Subject: [PATCH 064/142] Update latest versions --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5ee1b39be..071c3ef20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ sudo: false rvm: - 2.0.0 - 2.1.10 - - 2.2.7 - - 2.3.4 - - 2.4.1 + - 2.2.8 + - 2.3.5 + - 2.4.2 - ruby-head - jruby-9.1.13.0 - jruby-head From 85fa80dc639f68de2b921a605bc4a35a937099b6 Mon Sep 17 00:00:00 2001 From: Sylvain Joyeux Date: Thu, 5 Oct 2017 15:01:43 -0300 Subject: [PATCH 065/142] fix quadratic performance in FileTask#out_of_date? FileTask#out_of_date? has been changed in 462e403a to call #needed? which calls #out_of_date? recursively. In some cases, where the graph of dependencies is fairly dense, this leads to quadratic performance when it was linear before. Use #all_prerequisite_tasks to avoid the problem. This also saves a File.exist? test as #timestamp already takes it into account.fix quadratic performance in FileTask#out_of_date? FileTask#out_of_date? has been changed in 462e403a to call #needed? which calls #out_of_date? recursively. In some cases, where the graph of dependencies is fairly dense, this leads to quadratic performance when it was linear before. Use #all_prerequisite_tasks to avoid the problem. This also saves a File.exist? test as #timestamp already takes it into account. I made a benchmark that measures the difference in duration for out_of_date? on 12.0, 12.1 and 12.1 with this commit applied. The benchmark used to validate the performance creates 5 layers of FileTask, where all tasks of the parent layer are connected to all tasks of the child. A root task is added at the top and #out_of_date? is called on it. The benchmark varies the number of tasks per layer. **12.0** | Tasks per layers | Duration (s) | Standard deviation | |------------------|--------------|--------------------| | 1 | 1.32e-05 | 0.96e-05 | | 2 | 8.69e-05 | 1.11e-06 | | 5 | 1.84e-05 | 2.43e-06 | | 8 | 2.89e-05 | 1.05e-05 | | 10 | 3.35e-05 | 4.12e-06 | | 15 | 4.97e-05 | 6.74e-06 | | 20 | 6.19e-05 | 6.23e-06 | **12.1** | Tasks per layers | Duration (s) | Standard deviation | |------------------|--------------|--------------------| | 1 | 7.00e-05 | 5.62e-05 | | 2 | 3.98e-04 | 7.38e-05 | | 5 | 2.32e-02 | 1.02e-03 | | 8 | 0.22 | 0.006 | | 10 | 0.65 | 0.006 | | 15 | 4.78 | 0.048 | | 20 | 20 | 0.49 | **PR 224** | Tasks per layers | Duration (s) | Standard deviation | |------------------|--------------|--------------------| | 1 | 4.47e-05 | 2.68e-05 | | 2 | 7.56e-05 | 2.92e-05 | | 5 | 2.42e-03 | 4.16e-05 | | 8 | 0.51e-03 | 7.21e-05 | | 10 | 0.77e-03 | 0.13e-03 | | 15 | 14.2e-03 | 0.11e-03 | | 20 | 24.2e-03 | 0.16e-03 | Benchmarking code: ~~~ ruby require 'rake' LAYER_MAX_SIZE = 20 LAYER_COUNT = 5 def measure(size) app = Rake::Application.new layers = (0...LAYER_COUNT).map do |layer_i| (0...size).map do |i| app.define_task(Rake::FileTask, "#{layer_i}_#{i}") end end layers.each_cons(2) do |parent, child| child_names = child.map(&:name) parent.each { |t| t.enhance(child_names) } end root = app.define_task(Rake::FileTask, "root") root.enhance(layers[0].map(&:name)) tic = Time.now root.send(:out_of_date?, tic) Time.now - tic end FileUtils.touch "root" sleep 0.1 LAYER_COUNT.times do |layer_i| LAYER_MAX_SIZE.times do |i| FileUtils.touch "#{LAYER_COUNT - layer_i - 1}_#{i}" end sleep 0.1 end COUNT = 100 [1, 2, 5, 8, 10, 15, 20].each do |size| mean = 0 sum_squared_deviations = 0 COUNT.times do |count| duration = measure(size) old_mean = mean mean = old_mean + (duration - old_mean) / (count + 1) sum_squared_deviations = sum_squared_deviations + (duration - old_mean) * (duration - mean) end puts "#{size} #{mean} #{Math.sqrt(sum_squared_deviations / (COUNT - 1))}" end ~~~ --- lib/rake/file_task.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rake/file_task.rb b/lib/rake/file_task.rb index 474b7bd93..364d8e395 100644 --- a/lib/rake/file_task.rb +++ b/lib/rake/file_task.rb @@ -30,10 +30,10 @@ def timestamp # Are there any prerequisites with a later time than the given time stamp? def out_of_date?(stamp) - @prerequisites.any? { |prereq| + all_prerequisite_tasks.any? { |prereq| prereq_task = application[prereq, @scope] if prereq_task.instance_of?(Rake::FileTask) - prereq_task.timestamp > stamp || prereq_task.needed? + prereq_task.timestamp > stamp || @application.options.build_all else prereq_task.timestamp > stamp end From bfab5f8bbeb69d078a71a81ff6ea25919fdaf5fe Mon Sep 17 00:00:00 2001 From: Adrian Setyadi Date: Sun, 15 Oct 2017 07:31:39 +0700 Subject: [PATCH 066/142] Account for a file that match 2 or more patterns. --- lib/rake/file_list.rb | 4 ++-- test/test_rake_file_list.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rake/file_list.rb b/lib/rake/file_list.rb index 748d668f1..e27de8db5 100644 --- a/lib/rake/file_list.rb +++ b/lib/rake/file_list.rb @@ -318,14 +318,14 @@ def egrep(pattern, *options) # Return a new file list that only contains file names from the current # file list that exist on the file system. def existing - select { |fn| File.exist?(fn) } + select { |fn| File.exist?(fn) }.uniq end # Modify the current file list so that it contains only file name that # exist on the file system. def existing! resolve - @items = @items.select { |fn| File.exist?(fn) } + @items = @items.select { |fn| File.exist?(fn) }.uniq self end diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index 7e5d1eed0..3e2622acd 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -415,13 +415,13 @@ def test_egrep_with_error end def test_existing - fl = FileList["abc.c", "notthere.c"] + fl = FileList["*c.c", "notthere.c", "a*.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["*c.c", "notthere.c", "a*.c"] result = fl.existing! assert_equal ["abc.c"], fl assert_equal fl.object_id, result.object_id From 99f48f23d1ddf913a56844f978b69f9a16e954bd Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 18 Oct 2017 12:35:16 +0900 Subject: [PATCH 067/142] rubocop -a --- lib/rake/application.rb | 2 +- test/test_rake_application.rb | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 8c896888f..89565a670 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -78,7 +78,7 @@ def initialize # call +top_level+ to run your top level tasks. def run(argv = ARGV) standard_exception_handling do - init 'rake', argv + init "rake", argv load_rakefile top_level end diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index 456f7d878..cc063c0d2 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -14,14 +14,14 @@ def test_class_with_application orig_app = Rake.application return_app = Rake.with_application do |yield_app| - refute_equal orig_app, yield_app, 'new application must be yielded' + refute_equal orig_app, yield_app, "new application must be yielded" assert_equal yield_app, Rake.application, - 'new application must be default in block' + "new application must be default in block" end - refute_equal orig_app, return_app, 'new application not returned' - assert_equal orig_app, Rake.application, 'original application not default' + refute_equal orig_app, return_app, "new application not returned" + assert_equal orig_app, Rake.application, "original application not default" end def test_class_with_application_user_defined @@ -30,14 +30,14 @@ def test_class_with_application_user_defined user_app = Rake::Application.new return_app = Rake.with_application user_app do |yield_app| - assert_equal user_app, yield_app, 'user application must be yielded' + assert_equal user_app, yield_app, "user application must be yielded" assert_equal user_app, Rake.application, - 'user application must be default in block' + "user application must be default in block" end - assert_equal user_app, return_app, 'user application not returned' - assert_equal orig_app, Rake.application, 'original application not default' + assert_equal user_app, return_app, "user application not returned" + assert_equal orig_app, Rake.application, "original application not default" end def test_display_exception_details @@ -393,7 +393,7 @@ def test_handle_options_should_not_strip_options_from_argv argv = %w[--trace] @app.handle_options argv - assert_includes argv, '--trace' + assert_includes argv, "--trace" assert @app.options.trace end @@ -470,7 +470,7 @@ def test_display_prereqs def test_bad_run @app.intern(Rake::Task, "default").enhance { fail } _, err = capture_io { - assert_raises(SystemExit) { @app.run %w[-f -s --rakelib=""]} + assert_raises(SystemExit) { @app.run %w[-f -s --rakelib=""] } } assert_match(/see full trace/i, err) end From f7774e8209ba8ddec8837814f61dd9244fa52f0e Mon Sep 17 00:00:00 2001 From: Simon Coffey Date: Mon, 16 Oct 2017 16:52:32 +0100 Subject: [PATCH 068/142] Clarify output when printing nested exception traces Since v10.2.0, if an exception has a nested cause exception, the cause is also displayed in the trace output.[1] For heavily-nested exceptions, this output can be quite lengthy - for example, Rails migrations nest DB errors twice over, resulting in an error message and backtrace repeated three times. To break up this output and make it clearer what each individual backtrace relates to, this adds whitespace and a "Caused by:" label to each nested exception being displayed. To prevent "Caused by:" labels occurring on their own, I've moved the exception loop shortcut return into the `#display_cause_details` method. This doesn't alter the behaviour of the shortcut, as only the first exception will be unconditionally printed (which was already the case, as the first exception can't be already seen). [1] https://github.com/ruby/rake/commit/fbb22e7f570fc573ad1bff9d5905df1ab1cbd475 [2] https://github.com/ruby/rake/commit/57c932cea12ef3201fcaeaf80ba6f4f545390269 --- lib/rake/application.rb | 17 +++++++++++++---- test/test_rake_application.rb | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 89565a670..88a38fd8c 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -207,13 +207,22 @@ def display_error_message(ex) # :nodoc: end def display_exception_details(ex) # :nodoc: - seen = Thread.current[:rake_display_exception_details_seen] ||= [] - return if seen.include? ex - seen << ex + display_exception_details_seen << ex display_exception_message_details(ex) display_exception_backtrace(ex) - display_exception_details(ex.cause) if has_cause?(ex) + display_cause_details(ex.cause) if has_cause?(ex) + end + + def display_cause_details(ex) # :nodoc: + return if display_exception_details_seen.include? ex + + trace "\nCaused by:" + display_exception_details(ex) + end + + def display_exception_details_seen # :nodoc: + Thread.current[:rake_display_exception_details_seen] ||= [] end def has_cause?(ex) # :nodoc: diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index cc063c0d2..d17445c7e 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -97,6 +97,7 @@ def test_display_exception_details_cause assert_empty out + assert_match "Caused by:", err assert_match "cause a", err assert_match "cause b", err end From 7eab58e9f6fa4e430e7ed8d3e7d28df4a9db591c Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 25 Oct 2017 09:56:41 +0900 Subject: [PATCH 069/142] Handle LoadError for coveralls. It's optional dependency for testing. --- test/helper.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/helper.rb b/test/helper.rb index 17447ab2e..924f20faf 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,8 +1,12 @@ # frozen_string_literal: true $:.unshift File.expand_path("../../lib", __FILE__) -require "coveralls" -Coveralls.wear! +begin + gem "coveralls" + require "coveralls" + Coveralls.wear! +rescue Gem::LoadError +end gem "minitest", "~> 5" require "minitest/autorun" From 353c893b6346423f214d3e37354be5380892cd08 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 25 Oct 2017 10:04:05 +0900 Subject: [PATCH 070/142] History --- History.rdoc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/History.rdoc b/History.rdoc index 079e65dcb..97cfe750e 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,19 @@ +=== 12.2.0 + +==== Enhancements: + +* Make rake easier to use as a library + Pull request #211 by @drbrain +* Fix quadratic performance in FileTask#out_of_date? + Pull request #224 by @doudou +* Clarify output when printing nested exception traces + Pull request #232 by @urbanautomaton + +==== Bug fixes + +* Account for a file that match 2 or more patterns. + Pull request #231 by @styd + === 12.1.0 ==== Enhancements: From e7ea2d15890c4b204f5fc558f5a7c65384abf586 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 25 Oct 2017 10:05:16 +0900 Subject: [PATCH 071/142] Bump version to rake-12.2.0 --- lib/rake/version.rb | 2 +- rake.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rake/version.rb b/lib/rake/version.rb index 7a309b9dc..2a29ab173 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "12.1.0" + VERSION = "12.2.0" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "." diff --git a/rake.gemspec b/rake.gemspec index f3e77ca2f..85a45147e 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 = "2017-09-11" + s.date = "2017-10-25" s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze] s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze] From 92146b229325a49a497cba6da075dbbeb0b303d1 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 25 Oct 2017 11:02:10 +0900 Subject: [PATCH 072/142] Fixed to break capistrano3. --- lib/rake/application.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 88a38fd8c..8927d951b 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -88,7 +88,12 @@ def run(argv = ARGV) def init(app_name="rake", argv = ARGV) standard_exception_handling do @name = app_name - args = handle_options argv + begin + args = handle_options argv + rescue ArgumentError + # Backword compatibility for capistrano + args = handle_options + end collect_command_line_tasks(args) end end From 1f885501cebad343f820c2a50dc0c0165b68067c Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 25 Oct 2017 11:03:45 +0900 Subject: [PATCH 073/142] Bump version to rake-12.2.1 --- History.rdoc | 6 ++++++ lib/rake/version.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index 97cfe750e..d6c3d39e9 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,9 @@ +=== 12.2.1 + +==== Bug fixes + +* Fixed to break Capistrano::Application on capistrano3. + === 12.2.0 ==== Enhancements: diff --git a/lib/rake/version.rb b/lib/rake/version.rb index 2a29ab173..fc36a7663 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "12.2.0" + VERSION = "12.2.1" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "." From 41359487ab66f18c85998c858b93f5713b5fd07e Mon Sep 17 00:00:00 2001 From: Rick Hull Date: Mon, 6 Nov 2017 20:26:18 +0000 Subject: [PATCH 074/142] update required_ruby_version to 2.0.0 - as suggested by @hsbt in issue #230 on github - problems with 1.9.3 have been reported, which is long EOL'd --- rake.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index 85a45147e..fa9a5c635 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -30,7 +30,7 @@ Rake has the following features: s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) } s.require_paths = ["lib".freeze] - s.required_ruby_version = Gem::Requirement.new(">= 1.9.3".freeze) + s.required_ruby_version = Gem::Requirement.new(">= 2.0.0".freeze) s.rubygems_version = "2.6.1".freeze s.required_rubygems_version = Gem::Requirement.new(">= 1.3.2".freeze) s.rdoc_options = ["--main".freeze, "README.rdoc".freeze] From eb2e34792e2d8fb51cdf0d8daed894572e8edc37 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 15 Nov 2017 10:23:42 -0600 Subject: [PATCH 075/142] Support test-bundled-gems task on ruby core repository --- test/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helper.rb b/test/helper.rb index 924f20faf..949b63520 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -26,7 +26,7 @@ class TaskManager include Rake::TaskManager end - RUBY = Gem.ruby + RUBY = ENV['BUNDLE_RUBY'] || Gem.ruby def setup ARGV.clear From 6258ad54fcac8916394cc49ee306d1fd7aa05ca8 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 15 Nov 2017 11:03:49 -0600 Subject: [PATCH 076/142] Bump version to rake-12.3.0 --- History.rdoc | 11 +++++++++++ lib/rake/version.rb | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index d6c3d39e9..1c7335b81 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,14 @@ +=== 12.3.0 + +==== Compatibility Changes + +* Bump `required_ruby_verion` to Ruby 2.0.0. Rake was already + removed to support for Ruby 1.9.x. + +=== Enhancements: + +* Support `test-bundled-gems` task on ruby core. + === 12.2.1 ==== Bug fixes diff --git a/lib/rake/version.rb b/lib/rake/version.rb index fc36a7663..873083bb2 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "12.2.1" + VERSION = "12.3.0" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "." From 0c4aab882547bdd14b3dfde93e0bb02ad26ff088 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 15 Nov 2017 11:06:01 -0600 Subject: [PATCH 077/142] bump release date --- rake.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index fa9a5c635..06777dd68 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 = "2017-10-25" + s.date = "2017-11-15" s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze] s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze] From b031eff63207a5c5b6d031b052157e4b10a7837a Mon Sep 17 00:00:00 2001 From: Uwe Kubosch Date: Mon, 27 Nov 2017 13:14:17 +0100 Subject: [PATCH 078/142] [skip-ci] Fixed typo --- History.rdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/History.rdoc b/History.rdoc index 1c7335b81..71838bd67 100644 --- a/History.rdoc +++ b/History.rdoc @@ -2,8 +2,8 @@ ==== Compatibility Changes -* Bump `required_ruby_verion` to Ruby 2.0.0. Rake was already - removed to support for Ruby 1.9.x. +* Bump `required_ruby_version` to Ruby 2.0.0. Rake has already + removed support for Ruby 1.9.x. === Enhancements: From c2f3a1414d069b8d961839f1944bd58fcede2c81 Mon Sep 17 00:00:00 2001 From: aycabta Date: Fri, 8 Dec 2017 12:07:19 +0900 Subject: [PATCH 079/142] Use JRuby 9.1.15.0 on .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 071c3ef20..54051f5bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ rvm: - 2.3.5 - 2.4.2 - ruby-head - - jruby-9.1.13.0 + - jruby-9.1.15.0 - jruby-head before_script: - unset JRUBY_OPTS From be4a70f5e0264e20a21ca41441442f0883933f50 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Fri, 15 Dec 2017 23:55:58 +0100 Subject: [PATCH 080/142] Add missing information on FTP publishing to README --- README.rdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rdoc b/README.rdoc index 690c11d66..0f108cc67 100644 --- a/README.rdoc +++ b/README.rdoc @@ -25,8 +25,8 @@ Rake has the following features: * A library of prepackaged tasks to make building rakefiles easier. For example, 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.) + tasks for building RDoc, Gems, and publishing to FTP were included in rake but they're now + available in RDoc, RubyGems, and rake-contrib respectively.) * Supports parallel execution of tasks. From d774bd496f1614ee191f8918e37fa627f8318162 Mon Sep 17 00:00:00 2001 From: aycabta Date: Tue, 26 Dec 2017 18:36:08 +0900 Subject: [PATCH 081/142] Use 2.5.0 and more latest Ruby versions --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 54051f5bb..5c51e7037 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,10 @@ sudo: false rvm: - 2.0.0 - 2.1.10 - - 2.2.8 - - 2.3.5 - - 2.4.2 + - 2.2.9 + - 2.3.6 + - 2.4.3 + - 2.5.0 - ruby-head - jruby-9.1.15.0 - jruby-head From 3804b945bfb45dc7e4ee081617dfc25bffcc56cc Mon Sep 17 00:00:00 2001 From: aycabta Date: Thu, 28 Dec 2017 01:47:06 +0900 Subject: [PATCH 082/142] Force installation Bundler AppVeyor says gem install bundler --no-document bundler's executable "bundle" conflicts with C:/Ruby200/bin/bundle Overwrite the executable? [yN] and it timed out. This commit adds -f option for it. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 456c13d9e..7ef2abe30 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,7 +2,7 @@ clone_depth: 10 install: - SET PATH=C:\Ruby%ruby_version%\bin;%PATH% - - gem install bundler --no-document + - gem install bundler --no-document -f - bundle install build: off test_script: From 5ac709bc719393b2e786a6a987d9bb742028387f Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 7 Jan 2018 11:41:20 +0900 Subject: [PATCH 083/142] Support non-bundler environment --- Rakefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index e0d2ced3d..efb3decc1 100644 --- a/Rakefile +++ b/Rakefile @@ -9,16 +9,19 @@ 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" +begin + require "bundler/gem_tasks" +rescue LoadError +end +require "rake/testtask" Rake::TestTask.new(:test) do |t| t.libs << "test" t.verbose = true t.test_files = FileList["test/**/test_*.rb"] end +require "rdoc/task" RDoc::Task.new do |doc| doc.main = "README.rdoc" doc.title = "Rake -- Ruby Make" From 18f8138e97bce9c5633e974d7ce1a7f15d67d5f7 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 7 Jan 2018 11:44:18 +0900 Subject: [PATCH 084/142] prefer to use %x literal instead of back-tick --- Rakefile | 2 +- rake.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index efb3decc1..e03dc6feb 100644 --- a/Rakefile +++ b/Rakefile @@ -30,7 +30,7 @@ RDoc::Task.new do |doc| end task ghpages: :rdoc do - `git checkout gh-pages` + %x[git checkout gh-pages] require "fileutils" FileUtils.rm_rf "/tmp/html" FileUtils.mv "html", "/tmp" diff --git a/rake.gemspec b/rake.gemspec index 06777dd68..62fd76e7d 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -24,7 +24,7 @@ Rake has the following features: s.homepage = "https://github.com/ruby/rake".freeze s.licenses = ["MIT".freeze] - s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - + s.files = %x[git ls-files -z].split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - %w[.rubocop.yml .travis.yml appveyor.yml] s.bindir = "exe" s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) } From f35ce833db6976fcad0f9315689098cdb8e6d833 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sun, 7 Jan 2018 11:57:05 +0900 Subject: [PATCH 085/142] rubocop -a --- test/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helper.rb b/test/helper.rb index 949b63520..29f81c1f6 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -26,7 +26,7 @@ class TaskManager include Rake::TaskManager end - RUBY = ENV['BUNDLE_RUBY'] || Gem.ruby + RUBY = ENV["BUNDLE_RUBY"] || Gem.ruby def setup ARGV.clear From c430a2861c95e8476b3d79f0c957459ef06680bf Mon Sep 17 00:00:00 2001 From: Espartaco Palma Date: Thu, 25 Jan 2018 00:18:39 -0800 Subject: [PATCH 086/142] [skip ci] Fix minimal ruby version on README According to rake.gemspec, rake required at least ruby 2.0.0 --- README.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index 0f108cc67..5449303a5 100644 --- a/README.rdoc +++ b/README.rdoc @@ -130,7 +130,7 @@ Rake is available under an MIT-style license. = Other stuff Author:: Jim Weirich -Requires:: Ruby 1.9.3 or later +Requires:: Ruby 2.0.0 or later License:: Copyright Jim Weirich. Released under an MIT-style license. See the MIT-LICENSE file included in the distribution. From da34100b700d508c2184fd943e22140740b3be01 Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Thu, 25 Jan 2018 12:00:23 -0500 Subject: [PATCH 087/142] Re-raise a LoadError that didn't come from require in the test loader --- lib/rake/rake_test_loader.rb | 1 + test/test_rake_rake_test_loader.rb | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/rake/rake_test_loader.rb b/lib/rake/rake_test_loader.rb index ce3dd8eb6..f0f7772ba 100644 --- a/lib/rake/rake_test_loader.rb +++ b/lib/rake/rake_test_loader.rb @@ -19,6 +19,7 @@ false end rescue LoadError => e + raise unless e.path abort "\nFile does not exist: #{e.path}\n\n" end end diff --git a/test/test_rake_rake_test_loader.rb b/test/test_rake_rake_test_loader.rb index fabee4721..bf44235c0 100644 --- a/test/test_rake_rake_test_loader.rb +++ b/test/test_rake_rake_test_loader.rb @@ -24,7 +24,7 @@ def test_pattern $:.replace orig_loaded_features end - def test_load_error + def test_load_error_from_require out, err = capture_io do ARGV.replace %w[no_such_test_file.rb] @@ -44,4 +44,18 @@ def test_load_error assert_match expected, err end + + def test_load_error_raised_explicitly + File.write("error_test.rb", "raise LoadError, 'explicitly raised'") + out, err = capture_io do + ARGV.replace %w[error_test.rb] + + exc = assert_raises(LoadError) do + load @loader + end + assert_equal "explicitly raised", exc.message + end + assert_empty out + assert_empty err + end end From 109dd0ed2b729aba45eebd9eeb41e760557d7510 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 5 Feb 2018 11:50:43 +0900 Subject: [PATCH 088/142] rubocop -a --- test/test_rake_task_with_arguments.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_rake_task_with_arguments.rb b/test/test_rake_task_with_arguments.rb index b7a9e03e7..61cf8e049 100644 --- a/test/test_rake_task_with_arguments.rb +++ b/test/test_rake_task_with_arguments.rb @@ -84,7 +84,7 @@ def test_actions_of_various_arity_are_ok_with_args def test_actions_adore_keywords # A brutish trick to avoid parsing. Remove it once support for 1.9 and 2.0 is dropped # https://ci.appveyor.com/project/ruby/rake/build/1.0.301 - skip 'Keywords aren\'t a feature in this version' if RUBY_VERSION =~ /^1|^2\.0/ + skip "Keywords aren't a feature in this version" if RUBY_VERSION =~ /^1|^2\.0/ # https://github.com/ruby/rake/pull/174#issuecomment-263460761 skip if jruby9? eval <<-RUBY, binding, __FILE__, __LINE__+1 From 7caa6afce8c2159fe24f60a4411fecabda896723 Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Thu, 8 Feb 2018 14:50:16 -0300 Subject: [PATCH 089/142] Don't run tasks if it depends on already invoked but failed task. Fixes #189 --- lib/rake/multi_task.rb | 38 +------------------------------- lib/rake/task.rb | 42 ++++++++++++++++++++++++++---------- test/test_rake_multi_task.rb | 21 ++++++++++++++++++ 3 files changed, 53 insertions(+), 48 deletions(-) diff --git a/lib/rake/multi_task.rb b/lib/rake/multi_task.rb index 04c9f3109..3ae363cbe 100644 --- a/lib/rake/multi_task.rb +++ b/lib/rake/multi_task.rb @@ -5,46 +5,10 @@ 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) end end - end diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 256571112..c7e0a1d9e 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -103,6 +103,7 @@ def initialize(task_name, app) @scope = app.current_scope @arg_names = nil @locations = [] + @invocation_exception = nil end # Enhance a task with prerequisites or actions. Returns self. @@ -183,20 +184,39 @@ def invoke(*args) # Same as invoke, but explicitly pass a call chain to detect # circular dependencies. - def invoke_with_call_chain(task_args, invocation_chain) # :nodoc: - new_chain = InvocationChain.append(self, invocation_chain) + # + # 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 - if application.options.trace - application.trace "** Invoke #{name} #{format_trace_flags}" + begin + if application.options.trace + application.trace "** Invoke #{name} #{format_trace_flags}" + end + + 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 + + @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 ex end - return if @already_invoked - @already_invoked = true - invoke_prerequisites(task_args, new_chain) - execute(task_args) if needed? end - rescue Exception => ex - add_chain_to(ex, new_chain) - raise ex end protected :invoke_with_call_chain diff --git a/test/test_rake_multi_task.rb b/test/test_rake_multi_task.rb index 8a50c2980..bd179f22f 100644 --- a/test/test_rake_multi_task.rb +++ b/test/test_rake_multi_task.rb @@ -83,4 +83,25 @@ def test_cross_thread_prerequisite_failures Rake::Task[:b].invoke end end + + def test_task_not_executed_if_dependant_task_failed_concurrently + multitask :default => [:one, :two] + + task :one do + raise + end + + task_two_was_executed = false + task :two => :one do + task_two_was_executed = true + end + + begin + Rake::Task[:default].invoke + rescue RuntimeError + ensure + sleep 0.5 + assert !task_two_was_executed + end + end end From 0c4b0ae2687bd7314dd1743d9771e800a8aac37e Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Wed, 14 Feb 2018 08:42:58 +1100 Subject: [PATCH 090/142] Remove date field from rake.gemspec Hi there :wave: I noticed that in [this commit](https://github.com/ruby/rake/commit/6258ad54fcac8916394cc49ee306d1fd7aa05ca8) you bumped the version but did not change the `date` field in the `rake.gemspec`. This means that on rubygems.org, Rake 12.2.1 and Rake 12.3.0 were seemingly released on the same day, but the commits show a different history. (The last released date was [this commit](https://github.com/ruby/rake/commit/e7ea2d15890c4b204f5fc558f5a7c65384abf586) but it has since been bumped on master with [this commit](https://github.com/ruby/rake/commit/0c4aab882547bdd14b3dfde93e0bb02ad26ff088). May I suggest removing the `date` field from the `gemspec`? This way, RubyGems.org will automatically assign the current date to the package's release _and_ it means that you as a maintainer will have to do one less thing every time you release a new version. We do not have a `date` field in the [`i18n` gem's `gemspec`](https://github.com/svenfuchs/i18n/blob/master/i18n.gemspec) and it works just fine. What do you think? --- rake.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index 62fd76e7d..ddc9f2a61 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -5,7 +5,6 @@ require 'rake/version' Gem::Specification.new do |s| s.name = "rake".freeze s.version = Rake::VERSION - s.date = "2017-11-15" s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze] s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze] From 52a48894db8896ef4ba00045211eb56622b6f724 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 22 Feb 2018 15:10:56 +0900 Subject: [PATCH 091/142] To use gem install insteaad of bundle install --- appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7ef2abe30..4912f88b6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,8 +2,7 @@ clone_depth: 10 install: - SET PATH=C:\Ruby%ruby_version%\bin;%PATH% - - gem install bundler --no-document -f - - bundle install + - gem install minitest build: off test_script: - ruby -Ilib exe/rake From b86a13b9aecf5fb6b6a886df843cf82fcf034022 Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Wed, 21 Feb 2018 13:57:54 -0300 Subject: [PATCH 092/142] Removes duplicated inclusion of Rake::DSL Rake::DSL is already included in Rake::TestCase --- test/test_rake_file_creation_task.rb | 1 - test/test_rake_multi_task.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/test/test_rake_file_creation_task.rb b/test/test_rake_file_creation_task.rb index 246f679c7..e99884a55 100644 --- a/test/test_rake_file_creation_task.rb +++ b/test/test_rake_file_creation_task.rb @@ -4,7 +4,6 @@ class TestRakeFileCreationTask < Rake::TestCase include Rake - include Rake::DSL DUMMY_DIR = "dummy_dir" diff --git a/test/test_rake_multi_task.rb b/test/test_rake_multi_task.rb index 8a50c2980..c849b94d1 100644 --- a/test/test_rake_multi_task.rb +++ b/test/test_rake_multi_task.rb @@ -4,7 +4,6 @@ class TestRakeMultiTask < Rake::TestCase include Rake - include Rake::DSL def setup super From c3bd0cde82bd2accd6a9e8be75e2ec0bd09a70c9 Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Thu, 22 Feb 2018 15:17:44 -0300 Subject: [PATCH 093/142] make AppVeyor test with ruby 2.5 also --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 4912f88b6..fa978bb4a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,3 +19,5 @@ environment: - ruby_version: "23-x64" - ruby_version: "24" - ruby_version: "24-x64" + - ruby_version: "25" + - ruby_version: "25-x64" From 15f916938e3b43491647b6e353b7598f768290d2 Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Fri, 23 Feb 2018 15:02:11 -0300 Subject: [PATCH 094/142] Make space trimming consistent for all task arguments. Fixes #260 --- lib/rake/application.rb | 2 +- test/test_rake_task_argument_parsing.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 8927d951b..c86cb1fa2 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -172,7 +172,7 @@ def parse_task_string(string) # :nodoc: args = [] begin - /((?:[^\\,]|\\.)*?)\s*(?:,\s*(.*))?$/ =~ remaining_args + /\s*((?:[^\\,]|\\.)*?)\s*(?:,\s*(.*))?$/ =~ remaining_args remaining_args = $2 args << $1.gsub(/\\(.)/, '\1') diff --git a/test/test_rake_task_argument_parsing.rb b/test/test_rake_task_argument_parsing.rb index fc494a463..fbe0273e7 100644 --- a/test/test_rake_task_argument_parsing.rb +++ b/test/test_rake_task_argument_parsing.rb @@ -32,8 +32,8 @@ def test_two_arguments assert_equal ["one", "two"], args end - def test_can_handle_spaces_between_args - name, args = @app.parse_task_string("name[one, two,\tthree , \tfour]") + def test_can_handle_spaces_between_all_args + name, args = @app.parse_task_string("name[ one , two ,\tthree , \tfour ]") assert_equal "name", name assert_equal ["one", "two", "three", "four"], args end From 31bf731c6606afaec377bb815bcc9e0e0d7d37f1 Mon Sep 17 00:00:00 2001 From: aycabta Date: Thu, 1 Mar 2018 20:19:31 +0900 Subject: [PATCH 095/142] Use JRuby 9.1.16.0 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5c51e7037..e5dcb34db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ rvm: - 2.4.3 - 2.5.0 - ruby-head - - jruby-9.1.15.0 + - jruby-9.1.16.0 - jruby-head before_script: - unset JRUBY_OPTS From 717591004d86bfb4e7943cdd1143bcc227cdf5f7 Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Wed, 7 Mar 2018 11:39:51 -0300 Subject: [PATCH 096/142] Keep original test case testing spaces in some arguments --- test/test_rake_task_argument_parsing.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_rake_task_argument_parsing.rb b/test/test_rake_task_argument_parsing.rb index fbe0273e7..e65712b37 100644 --- a/test/test_rake_task_argument_parsing.rb +++ b/test/test_rake_task_argument_parsing.rb @@ -32,6 +32,12 @@ def test_two_arguments assert_equal ["one", "two"], args end + def test_can_handle_spaces_between_args + name, args = @app.parse_task_string("name[one, two,\tthree , \tfour]") + assert_equal "name", name + assert_equal ["one", "two", "three", "four"], args + end + def test_can_handle_spaces_between_all_args name, args = @app.parse_task_string("name[ one , two ,\tthree , \tfour ]") assert_equal "name", name From edb7743d6d79549b3dc67aea1575ab6dc5fdb698 Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Thu, 8 Mar 2018 09:48:28 -0300 Subject: [PATCH 097/142] Prefer #refute over negated #assert --- test/test_rake_multi_task.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_rake_multi_task.rb b/test/test_rake_multi_task.rb index bd179f22f..3b767ac0d 100644 --- a/test/test_rake_multi_task.rb +++ b/test/test_rake_multi_task.rb @@ -101,7 +101,7 @@ def test_task_not_executed_if_dependant_task_failed_concurrently rescue RuntimeError ensure sleep 0.5 - assert !task_two_was_executed + refute task_two_was_executed end end end From 9d2c8af56540b5a87360e4261ac32a0d085d9447 Mon Sep 17 00:00:00 2001 From: "FUJI Goro (gfx)" Date: Tue, 20 Mar 2018 16:51:09 +0900 Subject: [PATCH 098/142] support did_you_mean >= v1.2.0 which has a breaking change on formatters --- lib/rake/task_manager.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index e2531c8ef..c1e60b95e 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -61,16 +61,20 @@ def [](task_name, scopes=nil) def generate_message_for_undefined_task(task_name) message = "Don't know how to build task '#{task_name}' (see --tasks)" + message + generate_did_you_mean_suggestions(task_name) + end - suggestion_message = \ - if defined?(::DidYouMean::SpellChecker) && defined?(::DidYouMean::Formatter) - suggestions = ::DidYouMean::SpellChecker.new(dictionary: @tasks.keys).correct(task_name.to_s) - ::DidYouMean::Formatter.new(suggestions).to_s - else - "" - end + def generate_did_you_mean_suggestions(task_name) + return "" unless defined?(::DidYouMean::SpellChecker) - message + suggestion_message + suggestions = ::DidYouMean::SpellChecker.new(dictionary: @tasks.keys).correct(task_name.to_s) + if ::DidYouMean.respond_to?(:formatter)# did_you_mean v1.2.0 or later + ::DidYouMean.formatter.message_for(suggestions) + elsif defined?(::DidYouMean::Formatter) # before did_you_mean v1.2.0 + ::DidYouMean::Formatter.new(suggestions).to_s + else + "" + end end def synthesize_file_task(task_name) # :nodoc: From 9aac0a40408a6fc654e7953189a982ea73128b85 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 20 Mar 2018 17:48:15 +0900 Subject: [PATCH 099/142] rubocop -a --- .rubocop.yml | 2 +- test/test_rake_multi_task.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 29aa862a5..9a14d206e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -52,6 +52,6 @@ Layout/SpaceInsideHashLiteralBraces: Layout/CaseIndentation: Enabled: true -Lint/EndAlignment: +Layout/EndAlignment: Enabled: true EnforcedStyleAlignWith: variable diff --git a/test/test_rake_multi_task.rb b/test/test_rake_multi_task.rb index e6aef3110..31d88e5c3 100644 --- a/test/test_rake_multi_task.rb +++ b/test/test_rake_multi_task.rb @@ -84,14 +84,14 @@ def test_cross_thread_prerequisite_failures end def test_task_not_executed_if_dependant_task_failed_concurrently - multitask :default => [:one, :two] + multitask default: [:one, :two] task :one do raise end task_two_was_executed = false - task :two => :one do + task two: :one do task_two_was_executed = true end From 35c18fe5293fe6c64d5bd94361debde45757c24a Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 22 Mar 2018 11:10:29 +0900 Subject: [PATCH 100/142] Fixed rdoc style --- History.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index 71838bd67..e803bfaab 100644 --- a/History.rdoc +++ b/History.rdoc @@ -5,7 +5,7 @@ * Bump `required_ruby_version` to Ruby 2.0.0. Rake has already removed support for Ruby 1.9.x. -=== Enhancements: +==== Enhancements: * Support `test-bundled-gems` task on ruby core. From c963dc0e96b4454665fa5be2ead04181426fd220 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Thu, 22 Mar 2018 13:44:58 +0900 Subject: [PATCH 101/142] bump version to 12.3.1 --- History.rdoc | 18 ++++++++++++++++++ lib/rake/version.rb | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index e803bfaab..2ae9ba762 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,21 @@ +=== 12.3.1 + +==== Bug fixes + +* Support did_you_mean >= v1.2.0 which has a breaking change on formatters. + Pull request #262 by FUJI Goro. + +==== Enhancements: + +* Don't run task if it depends on already invoked but failed task. + Pull request #252 by Gonzalo Rodriguez. +* Make space trimming consistent for all task arguments. + Pull request #259 by Gonzalo Rodriguez. +* Removes duplicated inclusion of Rake::DSL in tests. + Pull request #254 by Gonzalo Rodriguez. +* Re-raise a LoadError that didn't come from require in the test loader. + Pull request #250 by Dylan Thacker-Smith. + === 12.3.0 ==== Compatibility Changes diff --git a/lib/rake/version.rb b/lib/rake/version.rb index 873083bb2..2d66a8f74 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "12.3.0" + VERSION = "12.3.1" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "." From acae4a2b696d9410c428da735ae6d3364530fd76 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Thu, 24 May 2018 16:09:38 -0700 Subject: [PATCH 102/142] Fix JRuby detection on JRuby 9.2 in cpu_counter.rb Java::Java is no longer defined by default, it's not defined until it is accessed: $ jruby -e 'p defined?(Java::Java)' nil $ jruby -e 'p Java::Java' Java::Java In earlier JRuby versions, defined?(Java::Java) returned "constant". --- lib/rake/cpu_counter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/cpu_counter.rb b/lib/rake/cpu_counter.rb index f3bf6d630..5f6ba6ba6 100644 --- a/lib/rake/cpu_counter.rb +++ b/lib/rake/cpu_counter.rb @@ -32,7 +32,7 @@ def count require 'rbconfig' def count - if defined?(Java::Java) + if defined?(JRUBY_VERSION) && (Java::Java rescue nil) count_via_java_runtime else case RbConfig::CONFIG['host_os'] From c376a932f93ac0f2dcac66002df71478a315ba42 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 25 May 2018 07:52:52 -0700 Subject: [PATCH 103/142] Use simpler RUBY_PLATFORM check for java in cpu_counter.rb --- lib/rake/cpu_counter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/cpu_counter.rb b/lib/rake/cpu_counter.rb index 5f6ba6ba6..564a62859 100644 --- a/lib/rake/cpu_counter.rb +++ b/lib/rake/cpu_counter.rb @@ -32,7 +32,7 @@ def count require 'rbconfig' def count - if defined?(JRUBY_VERSION) && (Java::Java rescue nil) + if RUBY_PLATFORM == 'java' count_via_java_runtime else case RbConfig::CONFIG['host_os'] From bdc6406a56432a16d65aca9bf6ce82defd9718d2 Mon Sep 17 00:00:00 2001 From: take-cheeze Date: Wed, 20 Jun 2018 20:44:24 +0900 Subject: [PATCH 104/142] Add alias `prereqs`. --- lib/rake/task.rb | 1 + test/test_rake_task.rb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index c7e0a1d9e..c56118f01 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -15,6 +15,7 @@ module Rake class Task # List of prerequisites for a task. attr_reader :prerequisites + alias prereqs prerequisites # List of actions attached to a task. attr_reader :actions diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 5b9605964..380f59b4f 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -470,4 +470,9 @@ def test_suggests_valid_rake_task_names assert_match(/Did you mean\? test/, error.message) end end + + def test_prereqs + t = task(a: %w[b c d e]) + assert_equal %w[b c d e], t.prereqs + end end From 110cc421bb2b751fb8da24bb050040758bef9db0 Mon Sep 17 00:00:00 2001 From: zhustec Date: Tue, 9 Oct 2018 22:01:38 +0800 Subject: [PATCH 105/142] remove trailing extension name in require * remove trailing extension name * remove space after `!` operator --- lib/rake/file_task.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rake/file_task.rb b/lib/rake/file_task.rb index 364d8e395..db790e39f 100644 --- a/lib/rake/file_task.rb +++ b/lib/rake/file_task.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "rake/task.rb" +require "rake/task" require "rake/early_time" module Rake @@ -14,7 +14,7 @@ class FileTask < Task # Is this file task needed? Yes if it doesn't exist, or if its time stamp # is out of date. def needed? - ! File.exist?(name) || out_of_date?(timestamp) || @application.options.build_all + !File.exist?(name) || out_of_date?(timestamp) || @application.options.build_all end # Time stamp for file task. From f34e2d57f01938eb1b9334b4a9354eab9e585b35 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Tue, 9 Oct 2018 22:15:39 +0800 Subject: [PATCH 106/142] Fix a typo in lib/rake/application.rb --- lib/rake/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index c86cb1fa2..4cd8420cf 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -91,7 +91,7 @@ def init(app_name="rake", argv = ARGV) begin args = handle_options argv rescue ArgumentError - # Backword compatibility for capistrano + # Backward compatibility for capistrano args = handle_options end collect_command_line_tasks(args) From a54a506b3f82335a258e91708ee66e9c80edc63d Mon Sep 17 00:00:00 2001 From: zhustec Date: Tue, 9 Oct 2018 22:25:56 +0800 Subject: [PATCH 107/142] Remove more space after `!` operator --- lib/rake/application.rb | 2 +- lib/rake/file_creation_task.rb | 2 +- lib/rake/file_list.rb | 2 +- lib/rake/file_utils.rb | 4 ++-- lib/rake/promise.rb | 4 ++-- lib/rake/scope.rb | 2 +- lib/rake/task.rb | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index c86cb1fa2..2cad6122b 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -687,7 +687,7 @@ def print_rakefile_directory(location) # :nodoc: def raw_load_rakefile # :nodoc: rakefile, location = find_rakefile_location - if (! options.ignore_system) && + if (!options.ignore_system) && (options.load_system || rakefile.nil?) && system_dir && File.directory?(system_dir) print_rakefile_directory(location) diff --git a/lib/rake/file_creation_task.rb b/lib/rake/file_creation_task.rb index 2eb251bf1..5a4c68492 100644 --- a/lib/rake/file_creation_task.rb +++ b/lib/rake/file_creation_task.rb @@ -12,7 +12,7 @@ module Rake class FileCreationTask < FileTask # Is this file task needed? Yes if it doesn't exist. def needed? - ! File.exist?(name) + !File.exist?(name) end # Time stamp for file creation task. This time stamp is earlier diff --git a/lib/rake/file_list.rb b/lib/rake/file_list.rb index e27de8db5..15ea4b36d 100644 --- a/lib/rake/file_list.rb +++ b/lib/rake/file_list.rb @@ -385,7 +385,7 @@ def excluded_from_list?(fn) /~$/ ] DEFAULT_IGNORE_PROCS = [ - proc { |fn| fn =~ /(^|[\/\\])core$/ && ! File.directory?(fn) } + proc { |fn| fn =~ /(^|[\/\\])core$/ && !File.directory?(fn) } ] def import(array) # :nodoc: diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb index 3439befab..dc434c8d9 100644 --- a/lib/rake/file_utils.rb +++ b/lib/rake/file_utils.rb @@ -35,7 +35,7 @@ module FileUtils # # # check exit status after command runs # sh %{grep pattern file} do |ok, res| - # if ! ok + # if !ok # puts "pattern not found (status = #{res.exitstatus})" # end # end @@ -111,7 +111,7 @@ def ruby(*args, &block) # Attempt to do a normal file link, but fall back to a copy if the link # fails. def safe_ln(*args) - if ! LN_SUPPORTED[0] + if !LN_SUPPORTED[0] cp(*args) else begin diff --git a/lib/rake/promise.rb b/lib/rake/promise.rb index ecff4321e..f45af4f3a 100644 --- a/lib/rake/promise.rb +++ b/lib/rake/promise.rb @@ -71,12 +71,12 @@ def chore # Do we have a result for the promise def result? - ! @result.equal?(NOT_SET) + !@result.equal?(NOT_SET) end # Did the promise throw an error def error? - ! @error.equal?(NOT_SET) + !@error.equal?(NOT_SET) end # Are we done with the promise diff --git a/lib/rake/scope.rb b/lib/rake/scope.rb index 27c05da89..fc1eb6c3a 100644 --- a/lib/rake/scope.rb +++ b/lib/rake/scope.rb @@ -16,7 +16,7 @@ def path_with_task_name(task_name) # this trim beyond the toplevel scope. def trim(n) result = self - while n > 0 && ! result.empty? + while n > 0 && !result.empty? result = result.tail n -= 1 end diff --git a/lib/rake/task.rb b/lib/rake/task.rb index c56118f01..257a7df0c 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -288,7 +288,7 @@ def timestamp def add_description(description) return unless description comment = description.strip - add_comment(comment) if comment && ! comment.empty? + add_comment(comment) if comment && !comment.empty? end def comment=(comment) # :nodoc: From f35c5651542dfd81c7e41e8aaf56feba77fce1a3 Mon Sep 17 00:00:00 2001 From: aycabta Date: Wed, 31 Oct 2018 23:53:13 +0900 Subject: [PATCH 108/142] Use Ruby 2.2.10, 2.3.8, 2.4.5, and 2.5.3 --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e5dcb34db..3662217f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,10 @@ sudo: false rvm: - 2.0.0 - 2.1.10 - - 2.2.9 - - 2.3.6 - - 2.4.3 - - 2.5.0 + - 2.2.10 + - 2.3.8 + - 2.4.5 + - 2.5.3 - ruby-head - jruby-9.1.16.0 - jruby-head From 1c6f3ac3f64caa734a81350a550a98d3c667f237 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Fri, 2 Nov 2018 10:12:16 +1100 Subject: [PATCH 109/142] add binstubs for bundler, rake, rodc and rubocop --- bin/bundle | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++ bin/rake | 29 +++++++++++++++ bin/rdoc | 29 +++++++++++++++ bin/rubocop | 29 +++++++++++++++ 4 files changed, 192 insertions(+) create mode 100755 bin/bundle create mode 100755 bin/rake create mode 100755 bin/rdoc create mode 100755 bin/rubocop diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 000000000..524dfd3f2 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,105 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "rubygems" + +m = Module.new do + module_function + + def invoked_as_script? + File.expand_path($0) == File.expand_path(__FILE__) + end + + def env_var_version + ENV["BUNDLER_VERSION"] + end + + def cli_arg_version + return unless invoked_as_script? # don't want to hijack other binstubs + return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` + bundler_version = nil + update_index = nil + ARGV.each_with_index do |a, i| + if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN + bundler_version = a + end + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ + bundler_version = $1 || ">= 0.a" + update_index = i + end + bundler_version + end + + def gemfile + gemfile = ENV["BUNDLE_GEMFILE"] + return gemfile if gemfile && !gemfile.empty? + + File.expand_path("../../Gemfile", __FILE__) + end + + def lockfile + lockfile = + case File.basename(gemfile) + when "gems.rb" then gemfile.sub(/\.rb$/, gemfile) + else "#{gemfile}.lock" + end + File.expand_path(lockfile) + end + + def lockfile_version + return unless File.file?(lockfile) + lockfile_contents = File.read(lockfile) + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + Regexp.last_match(1) + end + + def bundler_version + @bundler_version ||= begin + env_var_version || cli_arg_version || + lockfile_version || "#{Gem::Requirement.default}.a" + end + end + + def load_bundler! + ENV["BUNDLE_GEMFILE"] ||= gemfile + + # must dup string for RG < 1.8 compatibility + activate_bundler(bundler_version.dup) + end + + def activate_bundler(bundler_version) + if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0") + bundler_version = "< 2" + end + gem_error = activation_error_handling do + gem "bundler", bundler_version + end + return if gem_error.nil? + require_error = activation_error_handling do + require "bundler/version" + end + return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`" + exit 42 + end + + def activation_error_handling + yield + nil + rescue StandardError, LoadError => e + e + end +end + +m.load_bundler! + +if m.invoked_as_script? + load Gem.bin_path("bundler", "bundle") +end diff --git a/bin/rake b/bin/rake new file mode 100755 index 000000000..9275675e8 --- /dev/null +++ b/bin/rake @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rake' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rake", "rake") diff --git a/bin/rdoc b/bin/rdoc new file mode 100755 index 000000000..a952e7988 --- /dev/null +++ b/bin/rdoc @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rdoc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rdoc", "rdoc") diff --git a/bin/rubocop b/bin/rubocop new file mode 100755 index 000000000..d0c488293 --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rubocop' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rubocop", "rubocop") From ab2278068a677ba846cbec9ee4bfb5a0a4ecd0f8 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Fri, 2 Nov 2018 10:42:43 +1100 Subject: [PATCH 110/142] fix errors in rubocop --- lib/rake/packagetask.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb index f65affa6d..72fef4d5e 100644 --- a/lib/rake/packagetask.rb +++ b/lib/rake/packagetask.rb @@ -132,9 +132,7 @@ def define task package: ["#{package_dir}/#{file}"] file "#{package_dir}/#{file}" => [package_dir_path] + package_files do - chdir(package_dir) do - sh @tar_command, "#{flag}cvf", file, package_name - end + chdir(package_dir) { sh @tar_command, "#{flag}cvf", file, package_name } end end end @@ -143,9 +141,7 @@ def define task package: ["#{package_dir}/#{zip_file}"] file "#{package_dir}/#{zip_file}" => [package_dir_path] + package_files do - chdir(package_dir) do - sh @zip_command, "-r", zip_file, package_name - end + chdir(package_dir) { sh @zip_command, "-r", zip_file, package_name } end end From 7375bf619ae3d4cd813ce8d8ddc33ef68efbf64b Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Fri, 2 Nov 2018 12:04:38 +1100 Subject: [PATCH 111/142] add rubocop section to CONTRIBUTING.rdoc --- CONTRIBUTING.rdoc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CONTRIBUTING.rdoc b/CONTRIBUTING.rdoc index d68e8c525..a1a454c9c 100644 --- a/CONTRIBUTING.rdoc +++ b/CONTRIBUTING.rdoc @@ -18,6 +18,13 @@ If you wish to run the unit and functional tests that come with Rake: rake # If you have run rake's tests += Rubocop + +Rake uses Rubocop to enforce a consistent style on new changes being +proposed. You can check your code with Rubocop using: + + ./bin/rubocop + = Issues and Bug Reports Feel free to submit commits or feature requests. If you send a patch, From b6521cf4907af7e9f04013708411ab91d337da87 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Fri, 2 Nov 2018 15:16:01 +1100 Subject: [PATCH 112/142] Rework the error message that tells to list the tasks with `rake --tasks` --- lib/rake/task_manager.rb | 2 +- test/test_rake_task.rb | 2 +- test/test_rake_task_manager.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index c1e60b95e..d503a3044 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -60,7 +60,7 @@ def [](task_name, scopes=nil) end def generate_message_for_undefined_task(task_name) - message = "Don't know how to build task '#{task_name}' (see --tasks)" + message = "Don't know how to build task '#{task_name}' (See the list of available tasks with `rake --tasks`)" message + generate_did_you_mean_suggestions(task_name) end diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 380f59b4f..ab24cbba5 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -172,7 +172,7 @@ def test_find task :tfind assert_equal "tfind", Task[:tfind].name ex = assert_raises(RuntimeError) { Task[:leaves] } - assert_equal "Don't know how to build task 'leaves' (see --tasks)", ex.message + assert_equal "Don't know how to build task 'leaves' (See the list of available tasks with `rake --tasks`)", ex.message end def test_defined diff --git a/test/test_rake_task_manager.rb b/test/test_rake_task_manager.rb index a9157ed81..94347b6b6 100644 --- a/test/test_rake_task_manager.rb +++ b/test/test_rake_task_manager.rb @@ -25,7 +25,7 @@ def test_index @tm["bad"] end - assert_equal "Don't know how to build task 'bad' (see --tasks)", e.message + assert_equal "Don't know how to build task 'bad' (See the list of available tasks with `rake --tasks`)", e.message end def test_name_lookup From a0afa882eb964c7728f3e4c2aa9b21728137ec43 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Mon, 5 Nov 2018 20:26:31 +1100 Subject: [PATCH 113/142] fix links to rake resources not showing on Github --- README.rdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rdoc b/README.rdoc index 5449303a5..ab136b85d 100644 --- a/README.rdoc +++ b/README.rdoc @@ -75,10 +75,10 @@ Type "rake --help" for all available options. === Rake Information -* {Rake command-line}[rdoc-ref:doc/command_line_usage.rdoc] -* {Writing Rakefiles}[rdoc-ref:doc/rakefile.rdoc] -* The original {Rake announcement}[rdoc-ref:doc/rational.rdoc] -* Rake {glossary}[rdoc-ref:doc/glossary.rdoc] +* {Rake command-line}[link:doc/command_line_usage.rdoc] +* {Writing Rakefiles}[link:doc/rakefile.rdoc] +* The original {Rake announcement}[link:doc/rational.rdoc] +* Rake {glossary}[link:doc/glossary.rdoc] === Presentations and Articles about Rake From 44879600d045d03737099e87e3e555a43bba861d Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Mon, 5 Nov 2018 21:14:05 +1100 Subject: [PATCH 114/142] run coveralls only when COVERALLS env var is present This is to prevent multiple travis-ci jobs running coveralls and results in the coveralls posting multiple reports per PR --- .travis.yml | 6 ++++++ test/helper.rb | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3662217f4..9677c0988 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,12 @@ rvm: - ruby-head - jruby-9.1.16.0 - jruby-head + +matrix: + include: + - rvm: 2.5.3 + env: COVERALLS=yes + before_script: - unset JRUBY_OPTS - unset _JAVA_OPTIONS diff --git a/test/helper.rb b/test/helper.rb index 29f81c1f6..7d0989a38 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -2,9 +2,11 @@ $:.unshift File.expand_path("../../lib", __FILE__) begin - gem "coveralls" - require "coveralls" - Coveralls.wear! + if ENV['COVERALLS'] + gem "coveralls" + require "coveralls" + Coveralls.wear! + end rescue Gem::LoadError end From f989fec41766ed37f6d408da8a84f905547f382d Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Mon, 5 Nov 2018 21:19:39 +1100 Subject: [PATCH 115/142] update latest jruby version in travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3662217f4..ad19ac370 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ rvm: - 2.4.5 - 2.5.3 - ruby-head - - jruby-9.1.16.0 + - jruby-9.2.0.0 - jruby-head before_script: - unset JRUBY_OPTS From 137e3f7a43f0429098b8878a00db449fa85fea97 Mon Sep 17 00:00:00 2001 From: Jon San Miguel Date: Thu, 27 Sep 2018 19:15:36 -0700 Subject: [PATCH 116/142] Improve multitask performance --- lib/rake/task.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index c56118f01..7b7057ce5 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -248,7 +248,8 @@ def invoke_prerequisites_concurrently(task_args, invocation_chain)# :nodoc: r.invoke_with_call_chain(prereq_args, invocation_chain) end end - futures.each(&:value) + # Iterate in reverse to improve performance related to thread waiting and switching + futures.reverse_each(&:value) end # Format the trace flags for display. From 5c797778371b978c4202ac9bc72b6f9c393f6fdc Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Sat, 17 Nov 2018 13:22:08 +1100 Subject: [PATCH 117/142] update jruby to the latest version in travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ad19ac370..ea0f0aea1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ rvm: - 2.4.5 - 2.5.3 - ruby-head - - jruby-9.2.0.0 + - jruby-9.2.4.0 - jruby-head before_script: - unset JRUBY_OPTS From e4ebe510406aaad98e433b5b7510fcd7ad41cf72 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Sun, 25 Nov 2018 00:45:54 +1100 Subject: [PATCH 118/142] set Application#set_default_options to be ignored by rdoc --- lib/rake/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 850b021c8..70efd8e3e 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -797,7 +797,7 @@ def rakefile_location(backtrace=caller) # :nodoc: backtrace.find { |str| str =~ re } || "" end - def set_default_options + def set_default_options # :nodoc: options.always_multitask = false options.backtrace = false options.build_all = false From 760834b3a2dd2c0e1018f2aa595233098a71c126 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Sun, 25 Nov 2018 00:46:22 +1100 Subject: [PATCH 119/142] add missing params to `task` call-seq examples to match consistency --- lib/rake/dsl_definition.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rake/dsl_definition.rb b/lib/rake/dsl_definition.rb index 3962c1679..c80464020 100644 --- a/lib/rake/dsl_definition.rb +++ b/lib/rake/dsl_definition.rb @@ -26,9 +26,9 @@ module DSL private # :call-seq: - # task task_name - # task task_name: dependencies - # task task_name, arguments => dependencies + # task(task_name) + # task(task_name: dependencies) + # task(task_name, arguments => dependencies) # # Declare a basic task. The +task_name+ is always the first argument. If # the task name contains a ":" it is defined in that namespace. From f9d736c4641defcc6340de9ed9ad896f13bb8f18 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Sun, 25 Nov 2018 00:47:04 +1100 Subject: [PATCH 120/142] ignore all test classes in rdoc --- test/test_private_reader.rb | 4 ++-- test/test_rake.rb | 2 +- test/test_rake_application.rb | 2 +- test/test_rake_application_options.rb | 2 +- test/test_rake_backtrace.rb | 4 ++-- test/test_rake_clean.rb | 2 +- test/test_rake_cpu_counter.rb | 4 ++-- test/test_rake_definitions.rb | 2 +- test/test_rake_directory_task.rb | 2 +- test/test_rake_dsl.rb | 2 +- test/test_rake_early_time.rb | 2 +- test/test_rake_extension.rb | 6 +++--- test/test_rake_file_creation_task.rb | 2 +- test/test_rake_file_list.rb | 4 ++-- test/test_rake_file_list_path_map.rb | 2 +- test/test_rake_file_task.rb | 2 +- test/test_rake_file_utils.rb | 4 ++-- test/test_rake_functional.rb | 2 +- test/test_rake_invocation_chain.rb | 2 +- test/test_rake_late_time.rb | 2 +- test/test_rake_linked_list.rb | 2 +- test/test_rake_makefile_loader.rb | 2 +- test/test_rake_multi_task.rb | 2 +- test/test_rake_name_space.rb | 4 ++-- test/test_rake_package_task.rb | 2 +- test/test_rake_path_map.rb | 2 +- test/test_rake_path_map_explode.rb | 2 +- test/test_rake_path_map_partial.rb | 2 +- test/test_rake_pseudo_status.rb | 2 +- test/test_rake_rake_test_loader.rb | 2 +- test/test_rake_reduce_compat.rb | 2 +- test/test_rake_require.rb | 2 +- test/test_rake_rules.rb | 2 +- test/test_rake_scope.rb | 2 +- test/test_rake_task.rb | 2 +- test/test_rake_task_argument_parsing.rb | 2 +- test/test_rake_task_arguments.rb | 2 +- test/test_rake_task_manager.rb | 2 +- test/test_rake_task_manager_argument_resolution.rb | 2 +- test/test_rake_task_with_arguments.rb | 2 +- test/test_rake_test_task.rb | 2 +- test/test_rake_thread_pool.rb | 2 +- test/test_rake_top_level_functions.rb | 2 +- test/test_rake_win32.rb | 4 ++-- test/test_thread_history_display.rb | 2 +- test/test_trace_output.rb | 4 ++-- 46 files changed, 56 insertions(+), 56 deletions(-) diff --git a/test/test_private_reader.rb b/test/test_private_reader.rb index ef08c9d2c..ee22e1b40 100644 --- a/test/test_private_reader.rb +++ b/test/test_private_reader.rb @@ -2,9 +2,9 @@ require File.expand_path("../helper", __FILE__) require "rake/private_reader" -class TestPrivateAttrs < Rake::TestCase +class TestPrivateAttrs < Rake::TestCase # :nodoc: - class Sample + class Sample # :nodoc: include Rake::PrivateReader private_reader :reader, :a diff --git a/test/test_rake.rb b/test/test_rake.rb index 2cdab492b..a6d08fd35 100644 --- a/test/test_rake.rb +++ b/test/test_rake.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRake < Rake::TestCase +class TestRake < Rake::TestCase # :nodoc: def test_each_dir_parent assert_equal ["a"], alldirs("a") assert_equal ["a/b", "a"], alldirs("a/b") diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index d17445c7e..27645ea12 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeApplication < Rake::TestCase +class TestRakeApplication < Rake::TestCase # :nodoc: def setup super diff --git a/test/test_rake_application_options.rb b/test/test_rake_application_options.rb index d774678b6..0ca06e264 100644 --- a/test/test_rake_application_options.rb +++ b/test/test_rake_application_options.rb @@ -3,7 +3,7 @@ TESTING_REQUIRE = [] -class TestRakeApplicationOptions < Rake::TestCase +class TestRakeApplicationOptions < Rake::TestCase # :nodoc: def setup super diff --git a/test/test_rake_backtrace.rb b/test/test_rake_backtrace.rb index d89817a11..27e3cecb7 100644 --- a/test/test_rake_backtrace.rb +++ b/test/test_rake_backtrace.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "open3" -class TestBacktraceSuppression < Rake::TestCase +class TestBacktraceSuppression < Rake::TestCase # :nodoc: def test_bin_rake_suppressed paths = ["something/bin/rake:12"] @@ -36,7 +36,7 @@ def test_near_system_dir_isnt_suppressed end end -class TestRakeBacktrace < Rake::TestCase +class TestRakeBacktrace < Rake::TestCase # :nodoc: include RubyRunner def setup diff --git a/test/test_rake_clean.rb b/test/test_rake_clean.rb index 612bd2546..b0b1ad602 100644 --- a/test/test_rake_clean.rb +++ b/test/test_rake_clean.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "rake/clean" -class TestRakeClean < Rake::TestCase +class TestRakeClean < Rake::TestCase # :nodoc: def test_clean load "rake/clean.rb", true diff --git a/test/test_rake_cpu_counter.rb b/test/test_rake_cpu_counter.rb index 3c3af15bf..5d04e7c97 100644 --- a/test/test_rake_cpu_counter.rb +++ b/test/test_rake_cpu_counter.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeCpuCounter < Rake::TestCase +class TestRakeCpuCounter < Rake::TestCase # :nodoc: def setup super @@ -28,7 +28,7 @@ def @cpu_counter.count; raise; end assert_equal(4, @cpu_counter.count_with_default) end - class TestClassMethod < Rake::TestCase + class TestClassMethod < Rake::TestCase # :nodoc: def setup super diff --git a/test/test_rake_definitions.rb b/test/test_rake_definitions.rb index 2dee13a34..52e468e3b 100644 --- a/test/test_rake_definitions.rb +++ b/test/test_rake_definitions.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "fileutils" -class TestRakeDefinitions < Rake::TestCase +class TestRakeDefinitions < Rake::TestCase # :nodoc: include Rake EXISTINGFILE = "existing" diff --git a/test/test_rake_directory_task.rb b/test/test_rake_directory_task.rb index d5fd26f27..5635afd13 100644 --- a/test/test_rake_directory_task.rb +++ b/test/test_rake_directory_task.rb @@ -3,7 +3,7 @@ require "fileutils" require "pathname" -class TestRakeDirectoryTask < Rake::TestCase +class TestRakeDirectoryTask < Rake::TestCase # :nodoc: include Rake def test_directory diff --git a/test/test_rake_dsl.rb b/test/test_rake_dsl.rb index 162961446..6d0e7344d 100644 --- a/test/test_rake_dsl.rb +++ b/test/test_rake_dsl.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeDsl < Rake::TestCase +class TestRakeDsl < Rake::TestCase # :nodoc: def setup super diff --git a/test/test_rake_early_time.rb b/test/test_rake_early_time.rb index dc0550b2a..95040f67a 100644 --- a/test/test_rake_early_time.rb +++ b/test/test_rake_early_time.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeEarlyTime < Rake::TestCase +class TestRakeEarlyTime < Rake::TestCase # :nodoc: def test_create early = Rake::EarlyTime.instance assert early <= Time.now diff --git a/test/test_rake_extension.rb b/test/test_rake_extension.rb index 0627ef9b7..aeb8ce148 100644 --- a/test/test_rake_extension.rb +++ b/test/test_rake_extension.rb @@ -2,9 +2,9 @@ require File.expand_path("../helper", __FILE__) require "stringio" -class TestRakeExtension < Rake::TestCase +class TestRakeExtension < Rake::TestCase # :nodoc: - module Redirect + module Redirect # :nodoc: def error_redirect old_err = $stderr result = StringIO.new @@ -16,7 +16,7 @@ def error_redirect end end - class Sample + class Sample # :nodoc: extend Redirect def duplicate_method diff --git a/test/test_rake_file_creation_task.rb b/test/test_rake_file_creation_task.rb index e99884a55..05af13bb1 100644 --- a/test/test_rake_file_creation_task.rb +++ b/test/test_rake_file_creation_task.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "fileutils" -class TestRakeFileCreationTask < Rake::TestCase +class TestRakeFileCreationTask < Rake::TestCase # :nodoc: include Rake DUMMY_DIR = "dummy_dir" diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index 3e2622acd..97ab99828 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -2,8 +2,8 @@ require File.expand_path("../helper", __FILE__) require "pathname" -class TestRakeFileList < Rake::TestCase - FileList = Rake::FileList +class TestRakeFileList < Rake::TestCase # :nodoc: + FileList = Rake::FileList # :nodoc: def setup super diff --git a/test/test_rake_file_list_path_map.rb b/test/test_rake_file_list_path_map.rb index 71402cf36..2c51a2d72 100644 --- a/test/test_rake_file_list_path_map.rb +++ b/test/test_rake_file_list_path_map.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeFileListPathMap < Rake::TestCase +class TestRakeFileListPathMap < Rake::TestCase # :nodoc: def test_file_list_supports_pathmap assert_equal ["a", "b"], FileList["dir/a.rb", "dir/b.rb"].pathmap("%n") end diff --git a/test/test_rake_file_task.rb b/test/test_rake_file_task.rb index 774cbafd4..61303d88a 100644 --- a/test/test_rake_file_task.rb +++ b/test/test_rake_file_task.rb @@ -3,7 +3,7 @@ require "fileutils" require "pathname" -class TestRakeFileTask < Rake::TestCase +class TestRakeFileTask < Rake::TestCase # :nodoc: include Rake def setup diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index 90526b1d9..7e9674fdc 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -3,7 +3,7 @@ require "fileutils" require "stringio" -class TestRakeFileUtils < Rake::TestCase +class TestRakeFileUtils < Rake::TestCase # :nodoc: def setup super @rake_test_sh = ENV["RAKE_TEST_SH"] @@ -47,7 +47,7 @@ def test_ln assert_equal "TEST_LN\n", File.read("b") end - class BadLink + class BadLink # :nodoc: include Rake::FileUtilsExt attr_reader :cp_args diff --git a/test/test_rake_functional.rb b/test/test_rake_functional.rb index daf832254..afc31d28f 100644 --- a/test/test_rake_functional.rb +++ b/test/test_rake_functional.rb @@ -3,7 +3,7 @@ require "fileutils" require "open3" -class TestRakeFunctional < Rake::TestCase +class TestRakeFunctional < Rake::TestCase # :nodoc: include RubyRunner def setup diff --git a/test/test_rake_invocation_chain.rb b/test/test_rake_invocation_chain.rb index 338180aaa..bf918f758 100644 --- a/test/test_rake_invocation_chain.rb +++ b/test/test_rake_invocation_chain.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeInvocationChain < Rake::TestCase +class TestRakeInvocationChain < Rake::TestCase # :nodoc: include Rake def setup diff --git a/test/test_rake_late_time.rb b/test/test_rake_late_time.rb index d07b441a0..776b02d22 100644 --- a/test/test_rake_late_time.rb +++ b/test/test_rake_late_time.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeLateTime < Rake::TestCase +class TestRakeLateTime < Rake::TestCase # :nodoc: def test_late_time_comparisons late = Rake::LATE assert_equal late, late diff --git a/test/test_rake_linked_list.rb b/test/test_rake_linked_list.rb index d111575b2..656b50ac2 100644 --- a/test/test_rake_linked_list.rb +++ b/test/test_rake_linked_list.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestLinkedList < Rake::TestCase +class TestLinkedList < Rake::TestCase # :nodoc: include Rake def test_empty_list diff --git a/test/test_rake_makefile_loader.rb b/test/test_rake_makefile_loader.rb index 75713cd2f..4f5270e0a 100644 --- a/test/test_rake_makefile_loader.rb +++ b/test/test_rake_makefile_loader.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "rake/loaders/makefile" -class TestRakeMakefileLoader < Rake::TestCase +class TestRakeMakefileLoader < Rake::TestCase # :nodoc: include Rake def test_parse diff --git a/test/test_rake_multi_task.rb b/test/test_rake_multi_task.rb index 31d88e5c3..641e65f4b 100644 --- a/test/test_rake_multi_task.rb +++ b/test/test_rake_multi_task.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "thread" -class TestRakeMultiTask < Rake::TestCase +class TestRakeMultiTask < Rake::TestCase # :nodoc: include Rake def setup diff --git a/test/test_rake_name_space.rb b/test/test_rake_name_space.rb index e8d4d6b20..a1a814cfd 100644 --- a/test/test_rake_name_space.rb +++ b/test/test_rake_name_space.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeNameSpace < Rake::TestCase +class TestRakeNameSpace < Rake::TestCase # :nodoc: - class TM + class TM # :nodoc: include Rake::TaskManager end diff --git a/test/test_rake_package_task.rb b/test/test_rake_package_task.rb index 2634267ee..d3886f8ca 100644 --- a/test/test_rake_package_task.rb +++ b/test/test_rake_package_task.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "rake/packagetask" -class TestRakePackageTask < Rake::TestCase +class TestRakePackageTask < Rake::TestCase # :nodoc: def test_initialize touch "install.rb" diff --git a/test/test_rake_path_map.rb b/test/test_rake_path_map.rb index 92cf337cb..1551247ec 100644 --- a/test/test_rake_path_map.rb +++ b/test/test_rake_path_map.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakePathMap < Rake::TestCase +class TestRakePathMap < Rake::TestCase # :nodoc: def test_returns_self_with_no_args assert_equal "abc.rb", "abc.rb".pathmap diff --git a/test/test_rake_path_map_explode.rb b/test/test_rake_path_map_explode.rb index 3174d6ccc..877a8e0c9 100644 --- a/test/test_rake_path_map_explode.rb +++ b/test/test_rake_path_map_explode.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakePathMapExplode < Rake::TestCase +class TestRakePathMapExplode < Rake::TestCase # :nodoc: def setup super diff --git a/test/test_rake_path_map_partial.rb b/test/test_rake_path_map_partial.rb index 9daf44ca5..e73ec56b6 100644 --- a/test/test_rake_path_map_partial.rb +++ b/test/test_rake_path_map_partial.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakePathMapPartial < Rake::TestCase +class TestRakePathMapPartial < Rake::TestCase # :nodoc: def test_pathmap_partial @path = "1/2/file".dup def @path.call(n) diff --git a/test/test_rake_pseudo_status.rb b/test/test_rake_pseudo_status.rb index 5a54bc200..008621f49 100644 --- a/test/test_rake_pseudo_status.rb +++ b/test/test_rake_pseudo_status.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakePseudoStatus < Rake::TestCase +class TestRakePseudoStatus < Rake::TestCase # :nodoc: def test_with_zero_exit_status s = Rake::PseudoStatus.new assert_equal 0, s.exitstatus diff --git a/test/test_rake_rake_test_loader.rb b/test/test_rake_rake_test_loader.rb index bf44235c0..4423a9b1c 100644 --- a/test/test_rake_rake_test_loader.rb +++ b/test/test_rake_rake_test_loader.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeRakeTestLoader < Rake::TestCase +class TestRakeRakeTestLoader < Rake::TestCase # :nodoc: def setup super diff --git a/test/test_rake_reduce_compat.rb b/test/test_rake_reduce_compat.rb index f3db9a79c..17986dcde 100644 --- a/test/test_rake_reduce_compat.rb +++ b/test/test_rake_reduce_compat.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "open3" -class TestRakeReduceCompat < Rake::TestCase +class TestRakeReduceCompat < Rake::TestCase # :nodoc: include RubyRunner def invoke_normal(task_name) diff --git a/test/test_rake_require.rb b/test/test_rake_require.rb index 899aba5ca..6309277da 100644 --- a/test/test_rake_require.rb +++ b/test/test_rake_require.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeRequire < Rake::TestCase +class TestRakeRequire < Rake::TestCase # :nodoc: def setup super $LOAD_PATH.unshift "." if jruby17? diff --git a/test/test_rake_rules.rb b/test/test_rake_rules.rb index 52934c258..bfb8e775f 100644 --- a/test/test_rake_rules.rb +++ b/test/test_rake_rules.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "fileutils" -class TestRakeRules < Rake::TestCase +class TestRakeRules < Rake::TestCase # :nodoc: include Rake SRCFILE = "abc.c" diff --git a/test/test_rake_scope.rb b/test/test_rake_scope.rb index 50bb1810b..24ac03408 100644 --- a/test/test_rake_scope.rb +++ b/test/test_rake_scope.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeScope < Rake::TestCase +class TestRakeScope < Rake::TestCase # :nodoc: include Rake def test_path_against_empty_scope diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index ab24cbba5..ee3e9d35c 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "fileutils" -class TestRakeTask < Rake::TestCase +class TestRakeTask < Rake::TestCase # :nodoc: include Rake def setup diff --git a/test/test_rake_task_argument_parsing.rb b/test/test_rake_task_argument_parsing.rb index e65712b37..ed12ea0b4 100644 --- a/test/test_rake_task_argument_parsing.rb +++ b/test/test_rake_task_argument_parsing.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeTaskArgumentParsing < Rake::TestCase +class TestRakeTaskArgumentParsing < Rake::TestCase # :nodoc: def setup super diff --git a/test/test_rake_task_arguments.rb b/test/test_rake_task_arguments.rb index 2ae3652da..245a71661 100644 --- a/test/test_rake_task_arguments.rb +++ b/test/test_rake_task_arguments.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeTaskArguments < Rake::TestCase +class TestRakeTaskArguments < Rake::TestCase # :nodoc: def teardown ENV.delete("rev") ENV.delete("VER") diff --git a/test/test_rake_task_manager.rb b/test/test_rake_task_manager.rb index 94347b6b6..7d8c40902 100644 --- a/test/test_rake_task_manager.rb +++ b/test/test_rake_task_manager.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeTaskManager < Rake::TestCase +class TestRakeTaskManager < Rake::TestCase # :nodoc: def setup super diff --git a/test/test_rake_task_manager_argument_resolution.rb b/test/test_rake_task_manager_argument_resolution.rb index c07be6f5e..585932c5c 100644 --- a/test/test_rake_task_manager_argument_resolution.rb +++ b/test/test_rake_task_manager_argument_resolution.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeTaskManagerArgumentResolution < Rake::TestCase +class TestRakeTaskManagerArgumentResolution < Rake::TestCase # :nodoc: def test_good_arg_patterns assert_equal [:t, [], []], task(:t) diff --git a/test/test_rake_task_with_arguments.rb b/test/test_rake_task_with_arguments.rb index 61cf8e049..46edcd112 100644 --- a/test/test_rake_task_with_arguments.rb +++ b/test/test_rake_task_with_arguments.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeTaskWithArguments < Rake::TestCase +class TestRakeTaskWithArguments < Rake::TestCase # :nodoc: include Rake def setup diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 396e05924..ed2313b91 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "rake/testtask" -class TestRakeTestTask < Rake::TestCase +class TestRakeTestTask < Rake::TestCase # :nodoc: include Rake def test_initialize diff --git a/test/test_rake_thread_pool.rb b/test/test_rake_thread_pool.rb index ceb8a5d1b..42f648854 100644 --- a/test/test_rake_thread_pool.rb +++ b/test/test_rake_thread_pool.rb @@ -2,7 +2,7 @@ require File.expand_path("../helper", __FILE__) require "rake/thread_pool" -class TestRakeTestThreadPool < Rake::TestCase +class TestRakeTestThreadPool < Rake::TestCase # :nodoc: include Rake def test_pool_executes_in_current_thread_for_zero_threads diff --git a/test/test_rake_top_level_functions.rb b/test/test_rake_top_level_functions.rb index f3675a096..f0dec1b76 100644 --- a/test/test_rake_top_level_functions.rb +++ b/test/test_rake_top_level_functions.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeTopLevelFunctions < Rake::TestCase +class TestRakeTopLevelFunctions < Rake::TestCase # :nodoc: def setup super diff --git a/test/test_rake_win32.rb b/test/test_rake_win32.rb index 6c341f486..ed08ef09e 100644 --- a/test/test_rake_win32.rb +++ b/test/test_rake_win32.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true require File.expand_path("../helper", __FILE__) -class TestRakeWin32 < Rake::TestCase +class TestRakeWin32 < Rake::TestCase # :nodoc: - Win32 = Rake::Win32 + Win32 = Rake::Win32 # :nodoc: def test_win32_system_dir_uses_home_if_defined ENV["HOME"] = 'C:\\HP' diff --git a/test/test_thread_history_display.rb b/test/test_thread_history_display.rb index 8adb1940a..026576446 100644 --- a/test/test_thread_history_display.rb +++ b/test/test_thread_history_display.rb @@ -3,7 +3,7 @@ require "rake/thread_history_display" -class TestThreadHistoryDisplay < Rake::TestCase +class TestThreadHistoryDisplay < Rake::TestCase # :nodoc: def setup super @time = 1_000_000 diff --git a/test/test_trace_output.rb b/test/test_trace_output.rb index 34dab6162..46403870f 100644 --- a/test/test_trace_output.rb +++ b/test/test_trace_output.rb @@ -2,10 +2,10 @@ require File.expand_path("../helper", __FILE__) require "stringio" -class TestTraceOutput < Rake::TestCase +class TestTraceOutput < Rake::TestCase # :nodoc: include Rake::TraceOutput - class PrintSpy + class PrintSpy # :nodoc: attr_reader :result, :calls def initialize From b0b450482e101721614f8d875f4bfb775d5c2089 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Sun, 25 Nov 2018 01:00:24 +1100 Subject: [PATCH 121/142] update public clone URL to use https --- CONTRIBUTING.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.rdoc b/CONTRIBUTING.rdoc index a1a454c9c..8eb7b9127 100644 --- a/CONTRIBUTING.rdoc +++ b/CONTRIBUTING.rdoc @@ -3,7 +3,7 @@ Rake is currently hosted at github. The github web page is https://github.com/ruby/rake . The public git clone URL is - git://github.com/ruby/rake.git + https://github.com/ruby/rake.git = Running the Rake Test Suite From c664ddecdb057e2aa1a15e7957b61aab5cb6c886 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Sun, 25 Nov 2018 01:07:03 +1100 Subject: [PATCH 122/142] improve running test instructions and denote commands with `$` --- CONTRIBUTING.rdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.rdoc b/CONTRIBUTING.rdoc index a1a454c9c..0eacefd7d 100644 --- a/CONTRIBUTING.rdoc +++ b/CONTRIBUTING.rdoc @@ -12,18 +12,18 @@ If you wish to run the unit and functional tests that come with Rake: * +cd+ into the top project directory of rake. * Install gem dependency using bundler: - bundle install # Install bundler, minitest and rdoc + $ bundle install # Install bundler, minitest and rdoc -* Type one of the following: +* Run the test suite - rake # If you have run rake's tests + $ rake = Rubocop Rake uses Rubocop to enforce a consistent style on new changes being proposed. You can check your code with Rubocop using: - ./bin/rubocop + $ ./bin/rubocop = Issues and Bug Reports From 81763da40dcfc497e25e00a7e957efd84a053923 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 7 Dec 2018 11:06:23 +0900 Subject: [PATCH 123/142] Fixed warnings with https://bugs.ruby-lang.org/issues/15231 --- lib/rake/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/application.rb b/lib/rake/application.rb index 70efd8e3e..9ac9b2130 100644 --- a/lib/rake/application.rb +++ b/lib/rake/application.rb @@ -392,7 +392,7 @@ def trace(*strings) # :nodoc: def sort_options(options) # :nodoc: options.sort_by { |opt| - opt.select { |o| o =~ /^-/ }.map(&:downcase).sort.reverse + opt.select { |o| o.is_a?(String) && o =~ /^-/ }.map(&:downcase).sort.reverse } end private :sort_options From ff4bb1e86096444e08b123037bf4907da3d568bf Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 7 Dec 2018 18:45:55 +0900 Subject: [PATCH 124/142] Bump version to v12.3.2 --- History.rdoc | 16 ++++++++++++++++ lib/rake/version.rb | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index 2ae9ba762..455b27dd9 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,19 @@ +=== 12.3.2 + +==== Bug fixes + +* Fixed test fails caused by 2.6 warnings. + Pull Request #297 by hsbt + +==== Enhancements: + +* Rdoc improvements. + Pull Request #293 by colby-swandale +* Improve multitask performance. + Pull Request #273 by jsm +* Add alias `prereqs`. + Pull Request #268 by take-cheeze + === 12.3.1 ==== Bug fixes diff --git a/lib/rake/version.rb b/lib/rake/version.rb index 2d66a8f74..53ba15e0e 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "12.3.1" + VERSION = "12.3.2" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "." From 3d5a5be09038c160fa6ec9c3186a5c8a24d7d8d8 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Thu, 27 Dec 2018 01:02:23 +1100 Subject: [PATCH 125/142] Add ruby 2.6.0 to .travis.yml We have to manually update RubyGems because Travis forces each ruby version to have an old version of RubyGems --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9e7100420..5ae749249 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ rvm: - 2.3.8 - 2.4.5 - 2.5.3 + - 2.6.0 - ruby-head - jruby-9.2.4.0 - jruby-head @@ -19,4 +20,6 @@ matrix: before_script: - unset JRUBY_OPTS - unset _JAVA_OPTIONS + - if ruby -e "exit RUBY_VERSION >= '2.3.0'"; then gem update --system=3.0.1; else gem update --system=2.7.8; fi + script: ruby -Ilib exe/rake From 799d84787fd4064f005a8383391b8f3a402007fc Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Sun, 30 Dec 2018 12:42:02 +1100 Subject: [PATCH 126/142] fix outstanding rubocop warnings --- .rubocop.yml | 1 + test/helper.rb | 2 +- test/test_rake_task.rb | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 9a14d206e..84d6a7c5b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,6 +4,7 @@ AllCops: Exclude: - doc/**/*.rb - rake.gemspec + - bin/* Metrics/LineLength: Enabled: true diff --git a/test/helper.rb b/test/helper.rb index 7d0989a38..8e061fa45 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -2,7 +2,7 @@ $:.unshift File.expand_path("../../lib", __FILE__) begin - if ENV['COVERALLS'] + if ENV["COVERALLS"] gem "coveralls" require "coveralls" Coveralls.wear! diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index ee3e9d35c..688e0a3e7 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -172,7 +172,8 @@ def test_find task :tfind assert_equal "tfind", Task[:tfind].name ex = assert_raises(RuntimeError) { Task[:leaves] } - assert_equal "Don't know how to build task 'leaves' (See the list of available tasks with `rake --tasks`)", ex.message + assert_equal "Don't know how to build task 'leaves'" \ + " (See the list of available tasks with `rake --tasks`)", ex.message end def test_defined From d28957d64ae88823200049f8ae3667eb631bdfcc Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Mon, 21 Jan 2019 00:40:35 +0200 Subject: [PATCH 127/142] Use the application's name in error message if a task is not found `Rake.application` can be initialized with a custom name, so use that in the error message when a task is not found in the index. The default application name is `rake`. --- lib/rake/task_manager.rb | 3 ++- test/test_rake_task_manager.rb | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index d503a3044..1991088fa 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -60,7 +60,8 @@ def [](task_name, scopes=nil) end def generate_message_for_undefined_task(task_name) - message = "Don't know how to build task '#{task_name}' (See the list of available tasks with `rake --tasks`)" + message = "Don't know how to build task '#{task_name}' "\ + "(See the list of available tasks with `#{Rake.application.name} --tasks`)" message + generate_did_you_mean_suggestions(task_name) end diff --git a/test/test_rake_task_manager.rb b/test/test_rake_task_manager.rb index 7d8c40902..88937c604 100644 --- a/test/test_rake_task_manager.rb +++ b/test/test_rake_task_manager.rb @@ -28,6 +28,16 @@ def test_index assert_equal "Don't know how to build task 'bad' (See the list of available tasks with `rake --tasks`)", e.message end + def test_undefined_task_with_custom_application + Rake.application.init("myrake", nil) + + e = assert_raises RuntimeError do + @tm["bad"] + end + + assert_equal "Don't know how to build task 'bad' (See the list of available tasks with `myrake --tasks`)", e.message + end + def test_name_lookup t = @tm.define_task(Rake::Task, :t) assert_equal t, @tm[:t] From 7b75d7a084c6408759d745db270550b8d14d02cf Mon Sep 17 00:00:00 2001 From: aycabta Date: Tue, 5 Feb 2019 19:19:25 +0900 Subject: [PATCH 128/142] Use Ruby 2.6.1 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5ae749249..eb197f74e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ rvm: - 2.3.8 - 2.4.5 - 2.5.3 - - 2.6.0 + - 2.6.1 - ruby-head - jruby-9.2.4.0 - jruby-head From aec6e976a11728ec2fc78946f308b28d9b2522a3 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Feb 2019 20:02:39 +0900 Subject: [PATCH 129/142] Set up CI with Azure Pipelines --- azure-pipelines.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..6cd30e84d --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,23 @@ +# Ruby +# Package your Ruby project. +# Add steps that install rails, analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/ruby + +trigger: +- master + +pool: + vmImage: 'Ubuntu-16.04' + +steps: +- task: UseRubyVersion@0 + inputs: + versionSpec: '>= 2.5' + +- script: | + gem install bundler + bundle install --retry=3 --jobs=4 + displayName: 'bundle install' + +- script: bundle exec rake + displayName: 'bundle exec rake' From 48a5f2e9b888dd5eb1aa9c7aa624c4191a4c2bae Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Feb 2019 20:12:04 +0900 Subject: [PATCH 130/142] Applied matrix build for the multiple platforms. --- azure-pipelines.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6cd30e84d..d109c2fca 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,21 +3,24 @@ # Add steps that install rails, analyze code, save build artifacts, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/ruby -trigger: -- master - -pool: - vmImage: 'Ubuntu-16.04' +strategy: + matrix: + linux: + imageName: 'ubuntu-16.04' + mac: + imageName: 'macos-10.13' + windows: + imageName: 'vs2017-win2016' steps: - task: UseRubyVersion@0 inputs: - versionSpec: '>= 2.5' + versionSpec: '>= 2.0' - script: | gem install bundler bundle install --retry=3 --jobs=4 displayName: 'bundle install' -- script: bundle exec rake - displayName: 'bundle exec rake' +- script: ruby -Ilib exe/rake + displayName: 'ruby -Ilib exe/rake' From 4b89261e210a7b12c33c3ef07f54f51e98a2ae70 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Feb 2019 20:24:03 +0900 Subject: [PATCH 131/142] Added missing vmImage --- azure-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d109c2fca..4130122d7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,6 +12,9 @@ strategy: windows: imageName: 'vs2017-win2016' +pool: + vmImage: $(imageName) + steps: - task: UseRubyVersion@0 inputs: From c4d03c365b8d9ad3e69cc1c3abcceb8149de7f05 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Feb 2019 20:46:04 +0900 Subject: [PATCH 132/142] Extracted ruby versions for matrix --- azure-pipelines.yml | 91 +++++++++++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 27 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4130122d7..2962b9468 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,29 +1,66 @@ -# Ruby -# Package your Ruby project. -# Add steps that install rails, analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/ruby +jobs: +- job: Linux + pool: + vmImage: 'ubuntu-16.04' + strategy: + matrix: + ruby 2.3: + ruby_version: '2.3.7' + ruby 2.4: + ruby_version: '2.4.4' + ruby 2.5: + ruby_version: '2.5.1' + steps: + - task: UseRubyVersion@0 + inputs: + versionSpec: $(ruby_version) + - script: | + gem install bundler + bundle install --retry=3 --jobs=4 + displayName: 'bundle install' + - script: ruby -Ilib exe/rake + displayName: 'ruby -Ilib exe/rake' -strategy: - matrix: - linux: - imageName: 'ubuntu-16.04' - mac: - imageName: 'macos-10.13' - windows: - imageName: 'vs2017-win2016' +- job: macOS + pool: + vmImage: 'macos-10.13' + strategy: + matrix: + ruby 2.3: + ruby_version: '2.3.7' + ruby 2.4: + ruby_version: '2.4.4' + ruby 2.5: + ruby_version: '2.5.1' + steps: + - task: UseRubyVersion@0 + inputs: + versionSpec: $(ruby_version) + - script: | + gem install bundler + bundle install --retry=3 --jobs=4 + displayName: 'bundle install' + - script: ruby -Ilib exe/rake + displayName: 'ruby -Ilib exe/rake' -pool: - vmImage: $(imageName) - -steps: -- task: UseRubyVersion@0 - inputs: - versionSpec: '>= 2.0' - -- script: | - gem install bundler - bundle install --retry=3 --jobs=4 - displayName: 'bundle install' - -- script: ruby -Ilib exe/rake - displayName: 'ruby -Ilib exe/rake' +- job: Windows + pool: + vmImage: 'vs2017-win2016' + strategy: + matrix: + ruby 2.3: + ruby_version: '2.3.7' + ruby 2.4: + ruby_version: '2.4.4' + ruby 2.5: + ruby_version: '2.5.1' + steps: + - task: UseRubyVersion@0 + inputs: + versionSpec: $(ruby_version) + - script: | + gem install bundler + bundle install --retry=3 --jobs=4 + displayName: 'bundle install' + - script: ruby -Ilib exe/rake + displayName: 'ruby -Ilib exe/rake' From b29bae23b67993e41a710ad80f7de643edfed04d Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Feb 2019 20:50:38 +0900 Subject: [PATCH 133/142] Removed non supported versions. --- azure-pipelines.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2962b9468..04ab270ee 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,12 +26,8 @@ jobs: vmImage: 'macos-10.13' strategy: matrix: - ruby 2.3: - ruby_version: '2.3.7' - ruby 2.4: - ruby_version: '2.4.4' - ruby 2.5: - ruby_version: '2.5.1' + ruby 2.6: + ruby_version: '2.6.1' steps: - task: UseRubyVersion@0 inputs: @@ -48,12 +44,10 @@ jobs: vmImage: 'vs2017-win2016' strategy: matrix: - ruby 2.3: - ruby_version: '2.3.7' ruby 2.4: - ruby_version: '2.4.4' + ruby_version: '2.4.3' ruby 2.5: - ruby_version: '2.5.1' + ruby_version: '2.5.0' steps: - task: UseRubyVersion@0 inputs: From 54861dc265434cc24ed7baa59c22322613d68a02 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Feb 2019 21:02:09 +0900 Subject: [PATCH 134/142] Rename --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 04ab270ee..98c7b8809 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: ruby 2.6: - ruby_version: '2.6.1' + ruby_version: '2.6.1p33' steps: - task: UseRubyVersion@0 inputs: From a43a3b7871a47b0b5cf96cb5515ed67edae3270b Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Feb 2019 21:06:34 +0900 Subject: [PATCH 135/142] Ignore matrix build for macOS --- azure-pipelines.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 98c7b8809..555079d41 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,14 +24,10 @@ jobs: - job: macOS pool: vmImage: 'macos-10.13' - strategy: - matrix: - ruby 2.6: - ruby_version: '2.6.1p33' steps: - task: UseRubyVersion@0 inputs: - versionSpec: $(ruby_version) + versionSpec: '>= 2.4' - script: | gem install bundler bundle install --retry=3 --jobs=4 From 77448726bb057c8ba90a8d12ab6e20ad60dac976 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Feb 2019 21:09:48 +0900 Subject: [PATCH 136/142] Do not specify ruby version of macOS --- azure-pipelines.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 555079d41..d804993f3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,9 +25,6 @@ jobs: pool: vmImage: 'macos-10.13' steps: - - task: UseRubyVersion@0 - inputs: - versionSpec: '>= 2.4' - script: | gem install bundler bundle install --retry=3 --jobs=4 From 72ffa2ea89f96df2307158fa151825dbb2c28ddf Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Tue, 26 Feb 2019 21:19:01 +0900 Subject: [PATCH 137/142] use realpath --- test/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helper.rb b/test/helper.rb index 8e061fa45..64f7db7e2 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -28,7 +28,7 @@ class TaskManager include Rake::TaskManager end - RUBY = ENV["BUNDLE_RUBY"] || Gem.ruby + RUBY = File.realpath(ENV["BUNDLE_RUBY"] || Gem.ruby) def setup ARGV.clear From 77eb6d87cb69c2cc531f72d4aa1948054e9d077f Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 4 Mar 2019 11:52:13 +0900 Subject: [PATCH 138/142] Only enabled macOS environment --- azure-pipelines.yml | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d804993f3..19cce3eeb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,26 +1,4 @@ jobs: -- job: Linux - pool: - vmImage: 'ubuntu-16.04' - strategy: - matrix: - ruby 2.3: - ruby_version: '2.3.7' - ruby 2.4: - ruby_version: '2.4.4' - ruby 2.5: - ruby_version: '2.5.1' - steps: - - task: UseRubyVersion@0 - inputs: - versionSpec: $(ruby_version) - - script: | - gem install bundler - bundle install --retry=3 --jobs=4 - displayName: 'bundle install' - - script: ruby -Ilib exe/rake - displayName: 'ruby -Ilib exe/rake' - - job: macOS pool: vmImage: 'macos-10.13' @@ -31,23 +9,3 @@ jobs: displayName: 'bundle install' - script: ruby -Ilib exe/rake displayName: 'ruby -Ilib exe/rake' - -- job: Windows - pool: - vmImage: 'vs2017-win2016' - strategy: - matrix: - ruby 2.4: - ruby_version: '2.4.3' - ruby 2.5: - ruby_version: '2.5.0' - steps: - - task: UseRubyVersion@0 - inputs: - versionSpec: $(ruby_version) - - script: | - gem install bundler - bundle install --retry=3 --jobs=4 - displayName: 'bundle install' - - script: ruby -Ilib exe/rake - displayName: 'ruby -Ilib exe/rake' From 496944a8febd51e20957e6833c7930286a0e9a25 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Sat, 30 Mar 2019 22:15:58 -0400 Subject: [PATCH 139/142] Remove deprecated travis ci option --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eb197f74e..b0bf3ebe3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: ruby -sudo: false rvm: - 2.0.0 - 2.1.10 From be62efb6cdfc2cc00d660f8fc7d6c1c9de8014e2 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 15 May 2019 09:14:08 +0900 Subject: [PATCH 140/142] Removed gitignore from gemspec files. --- rake.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index ddc9f2a61..66c567ca9 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -24,7 +24,7 @@ Rake has the following features: s.licenses = ["MIT".freeze] s.files = %x[git ls-files -z].split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - - %w[.rubocop.yml .travis.yml appveyor.yml] + %w[.rubocop.yml .gitignore .travis.yml appveyor.yml] s.bindir = "exe" s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) } s.require_paths = ["lib".freeze] From 5b8f8fc41a5d7d7d6a5d767e48464c60884d3aee Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 22 Jul 2019 10:23:43 +0900 Subject: [PATCH 141/142] Use File.open explicitly. --- lib/rake/file_list.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/file_list.rb b/lib/rake/file_list.rb index 15ea4b36d..22c339f24 100644 --- a/lib/rake/file_list.rb +++ b/lib/rake/file_list.rb @@ -294,7 +294,7 @@ def egrep(pattern, *options) matched = 0 each do |fn| begin - open(fn, "r", *options) do |inf| + File.open(fn, "r", *options) do |inf| count = 0 inf.each do |line| count += 1 From 5c87c462b64aad674ebb92b1f5b0ff2c911406cd Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 22 Jul 2019 10:26:42 +0900 Subject: [PATCH 142/142] Bump version to 12.3.3. --- History.rdoc | 11 +++++++++++ lib/rake/version.rb | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index 455b27dd9..16b6331a1 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,14 @@ +=== 12.3.3 + +==== Bug fixes + +* Use the application's name in error message if a task is not found. + Pull Request #303 by tmatilai + +==== Enhancements: + +* Use File.open explicitly. + === 12.3.2 ==== Bug fixes diff --git a/lib/rake/version.rb b/lib/rake/version.rb index 53ba15e0e..6014e9322 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "12.3.2" + VERSION = "12.3.3" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "."