From 24cafd5a48096bb526a1180d7067b472f412fc50 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 10 Sep 2016 10:51:57 +0900 Subject: [PATCH 001/136] 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 002/136] 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 003/136] 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 004/136] 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 005/136] 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 41359487ab66f18c85998c858b93f5713b5fd07e Mon Sep 17 00:00:00 2001 From: Rick Hull Date: Mon, 6 Nov 2017 20:26:18 +0000 Subject: [PATCH 006/136] 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 007/136] 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 008/136] 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 009/136] 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 010/136] [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 011/136] 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 012/136] 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 013/136] 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 014/136] 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 015/136] 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 016/136] 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 017/136] 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 018/136] [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 019/136] 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 020/136] 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 021/136] 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 022/136] 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 023/136] 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 024/136] 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 025/136] 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 026/136] 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 027/136] 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 028/136] 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 029/136] 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 030/136] 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 031/136] 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 032/136] 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 033/136] 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 034/136] 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 035/136] 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 036/136] 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 449766fb9abbfb9d8365ff824952cd1aa9067683 Mon Sep 17 00:00:00 2001 From: take-cheeze Date: Thu, 21 Jun 2018 20:12:09 +0900 Subject: [PATCH 037/136] Add order only dependency. --- lib/rake/task.rb | 18 +++++++++++++- lib/rake/task_manager.rb | 24 +++++++++++-------- ...t_rake_task_manager_argument_resolution.rb | 12 +++++----- test/test_rake_test_task.rb | 18 ++++++++++++++ 4 files changed, 55 insertions(+), 17 deletions(-) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index c7e0a1d9e..cde41c636 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -16,6 +16,9 @@ class Task # List of prerequisites for a task. attr_reader :prerequisites + # List of order only prerequisites for a task. + attr_reader :order_only_prerequisites + # List of actions attached to a task. attr_reader :actions @@ -55,7 +58,7 @@ def sources # List of prerequisite tasks def prerequisite_tasks - prerequisites.map { |pre| lookup_prerequisite(pre) } + (prerequisites + order_only_prerequisites).map { |pre| lookup_prerequisite(pre) } end def lookup_prerequisite(prerequisite_name) # :nodoc: @@ -104,6 +107,7 @@ def initialize(task_name, app) @arg_names = nil @locations = [] @invocation_exception = nil + @order_only_prerequisites = [] end # Enhance a task with prerequisites or actions. Returns self. @@ -358,6 +362,18 @@ def investigation return result end + # Format dependencies parameter to pass to task. + def self.format_deps(deps) + deps = [deps] unless deps.respond_to?(:to_ary) + deps.map { |d| Rake.from_pathname(d).to_s } + end + + # Add order only dependencies. + def |(deps) + @order_only_prerequisites |= Task.format_deps(deps) - @prerequisites + self + end + # ---------------------------------------------------------------- # Rake Module Methods # diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index c1e60b95e..88a2e6bb3 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -15,13 +15,13 @@ def initialize # :nodoc: end def create_rule(*args, &block) # :nodoc: - pattern, args, deps = resolve_args(args) + pattern, args, deps, order_only = resolve_args(args) pattern = Regexp.new(Regexp.quote(pattern) + "$") if String === pattern - @rules << [pattern, args, deps, block] + @rules << [pattern, args, deps, order_only, block] end def define_task(task_class, *args, &block) # :nodoc: - task_name, arg_names, deps = resolve_args(args) + task_name, arg_names, deps, order_only = resolve_args(args) original_scope = @scope if String === task_name and @@ -31,15 +31,15 @@ def define_task(task_class, *args, &block) # :nodoc: end task_name = task_class.scope_name(@scope, task_name) - deps = [deps] unless deps.respond_to?(:to_ary) - deps = deps.map { |d| Rake.from_pathname(d).to_s } task = intern(task_class, task_name) task.set_arg_names(arg_names) unless arg_names.empty? if Rake::TaskManager.record_task_metadata add_location(task) task.add_description(get_description(task)) end - task.enhance(deps, &block) + task.enhance(Task.format_deps(deps), &block) + task | order_only unless order_only.nil? + task ensure @scope = original_scope end @@ -108,7 +108,7 @@ def resolve_args_without_dependencies(args) else arg_names = args end - [task_name, arg_names, []] + [task_name, arg_names, [], nil] end private :resolve_args_without_dependencies @@ -121,7 +121,10 @@ def resolve_args_without_dependencies(args) # task :t, [a] => [:d] # def resolve_args_with_dependencies(args, hash) # :nodoc: - fail "Task Argument Error" if hash.size != 1 + fail "Task Argument Error" if + hash.size != 1 && + (hash.size != 2 || !hash.key?(:order_only)) + order_only = hash.delete(:order_only) key, value = hash.map { |k, v| [k, v] }.first if args.empty? task_name = key @@ -133,7 +136,7 @@ def resolve_args_with_dependencies(args, hash) # :nodoc: deps = value end deps = [deps] unless deps.respond_to?(:to_ary) - [task_name, arg_names, deps] + [task_name, arg_names, deps, order_only] end private :resolve_args_with_dependencies @@ -144,9 +147,10 @@ def resolve_args_with_dependencies(args, hash) # :nodoc: 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| + @rules.each do |pattern, args, extensions, order_only, block| if pattern && pattern.match(task_name) task = attempt_rule(task_name, pattern, args, extensions, block, level) + task | order_only unless order_only.nil? return task if task end end diff --git a/test/test_rake_task_manager_argument_resolution.rb b/test/test_rake_task_manager_argument_resolution.rb index c07be6f5e..bc4943613 100644 --- a/test/test_rake_task_manager_argument_resolution.rb +++ b/test/test_rake_task_manager_argument_resolution.rb @@ -4,13 +4,13 @@ class TestRakeTaskManagerArgumentResolution < Rake::TestCase def test_good_arg_patterns - assert_equal [:t, [], []], task(:t) - assert_equal [:t, [], [:x]], task(t: :x) - assert_equal [:t, [], [:x, :y]], task(t: [:x, :y]) + assert_equal [:t, [], [], nil], task(:t) + assert_equal [:t, [], [:x], nil], task(t: :x) + assert_equal [:t, [], [:x, :y], nil], task(t: [:x, :y]) - assert_equal [:t, [:a, :b], []], task(:t, [:a, :b]) - assert_equal [:t, [:a, :b], [:x]], task(:t, [:a, :b] => :x) - assert_equal [:t, [:a, :b], [:x, :y]], task(:t, [:a, :b] => [:x, :y]) + assert_equal [:t, [:a, :b], [], nil], task(:t, [:a, :b]) + assert_equal [:t, [:a, :b], [:x], nil], task(:t, [:a, :b] => :x) + assert_equal [:t, [:a, :b], [:x, :y], nil], task(:t, [:a, :b] => [:x, :y]) end def task(*args) diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 396e05924..6a8dd2a4a 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -169,4 +169,22 @@ def test_task_prerequisites_deps task = Rake::Task[:child] assert_includes task.prerequisites, "parent" end + + def test_task_order_only_prerequisites + t = task(a: 'b') { + :aaa + } | 'c' + b, c = task('b'), task('c') + assert_equal ['b'], t.prerequisites + assert_equal ['c'], t.order_only_prerequisites + assert_equal [b, c], t.prerequisite_tasks + end + + def test_task_order_only_prerequisites_key + t = task 'a' => 'b', order_only: ['c'] + b, c = task('b'), task('c') + assert_equal ['b'], t.prerequisites + assert_equal ['c'], t.order_only_prerequisites + assert_equal [b, c], t.prerequisite_tasks + end end From 714a18093b38661508737a6849fc7168f28829a1 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Mon, 20 Aug 2018 14:50:48 +0200 Subject: [PATCH 038/136] Fixed bug: Task raises previous exception on second invokation after beeing reenable-d. --- lib/rake/task.rb | 3 ++- test/test_rake_task.rb | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index c56118f01..5f5254c84 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -141,7 +141,8 @@ def arg_names # Reenable the task, allowing its tasks to be executed if the task # is invoked again. def reenable - @already_invoked = false + @already_invoked = false + @invocation_exception = nil end # Clear the existing prerequisites, actions, comments, and arguments of a rake task. diff --git a/test/test_rake_task.rb b/test/test_rake_task.rb index 380f59b4f..dca594329 100644 --- a/test/test_rake_task.rb +++ b/test/test_rake_task.rb @@ -117,6 +117,33 @@ def test_can_double_invoke_with_reenable assert_equal ["t1", "t1"], runlist end + def test_can_triple_invoke_after_exception_with_reenable + raise_exception = true + invoked = 0 + + t1 = task(:t1) do |t| + invoked += 1 + next if !raise_exception + + raise_exception = false + raise 'Some error' + end + + assert_raises(RuntimeError) { t1.invoke } + assert_equal 1, invoked + + t1.reenable + + # actually invoke second time + t1.invoke + assert_equal 2, invoked + + # recognize already invoked and + # don't raise pre-reenable exception + t1.invoke + assert_equal 2, invoked + end + def test_clear desc "a task" t = task("t", ["b"] => "a") {} From 282b0d31586c7b723f6ba7d5103f874adec1bdb9 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Wed, 22 Aug 2018 09:04:08 +0200 Subject: [PATCH 039/136] Applied requested changes of @yuki24: Chose clean git blame over nice looking indentaiton. --- lib/rake/task.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 5f5254c84..2255b5c43 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -141,7 +141,7 @@ def arg_names # Reenable the task, allowing its tasks to be executed if the task # is invoked again. def reenable - @already_invoked = false + @already_invoked = false @invocation_exception = nil end From 110cc421bb2b751fb8da24bb050040758bef9db0 Mon Sep 17 00:00:00 2001 From: zhustec Date: Tue, 9 Oct 2018 22:01:38 +0800 Subject: [PATCH 040/136] 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 041/136] 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 042/136] 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 043/136] 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 044/136] 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 045/136] 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 046/136] 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 047/136] 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 048/136] 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 049/136] 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 050/136] 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 051/136] 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 052/136] 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 053/136] 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 054/136] 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 055/136] 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 056/136] 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 057/136] 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 058/136] 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 059/136] 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 060/136] 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 061/136] 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 062/136] 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 063/136] 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 064/136] 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 065/136] 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 066/136] 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 067/136] 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 068/136] 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 069/136] 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 070/136] 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 071/136] 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 072/136] 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 073/136] 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 074/136] 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 382e8047208675c9fb09e2cf9e5c4e4d3fe7ac5f Mon Sep 17 00:00:00 2001 From: Jian Weihang Date: Fri, 10 May 2019 22:22:56 +0800 Subject: [PATCH 075/136] feat: add `without_parent_dir` to `PackageTask` --- lib/rake/packagetask.rb | 19 +++++++++++++++++-- test/test_rake_package_task.rb | 12 ++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb index 72fef4d5e..aeff81c29 100644 --- a/lib/rake/packagetask.rb +++ b/lib/rake/packagetask.rb @@ -79,6 +79,9 @@ class PackageTask < TaskLib # Zip command for zipped archives. The default is 'zip'. attr_accessor :zip_command + # True if parent directory should be omited (default is false) + attr_accessor :without_parent_dir + # Create a Package Task with the given name and version. Use +:noversion+ # as the version to build a package without a version or to provide a # fully-versioned package name. @@ -102,6 +105,7 @@ def init(name, version) @need_zip = false @tar_command = "tar" @zip_command = "zip" + @without_parent_dir = false end # Create the tasks defined by this task library. @@ -132,7 +136,8 @@ def define task package: ["#{package_dir}/#{file}"] file "#{package_dir}/#{file}" => [package_dir_path] + package_files do - chdir(package_dir) { sh @tar_command, "#{flag}cvf", file, package_name } + chdir(working_dir) { sh @tar_command, "#{flag}cvf", file, target_dir } + mv "#{package_dir_path}/#{target_dir}", package_dir if without_parent_dir end end end @@ -141,7 +146,8 @@ def define task package: ["#{package_dir}/#{zip_file}"] file "#{package_dir}/#{zip_file}" => [package_dir_path] + package_files do - chdir(package_dir) { sh @zip_command, "-r", zip_file, package_name } + chdir(working_dir) { sh @zip_command, "-r", zip_file, target_dir } + mv "#{package_dir_path}/#{zip_file}", package_dir if without_parent_dir end end @@ -202,6 +208,15 @@ def tar_xz_file def zip_file "#{package_name}.zip" end + + def working_dir + without_parent_dir ? package_dir_path : package_dir + end + + # target directory relative to working_dir + def target_dir + without_parent_dir ? "." : package_name + end end end diff --git a/test/test_rake_package_task.rb b/test/test_rake_package_task.rb index d3886f8ca..25a1baa95 100644 --- a/test/test_rake_package_task.rb +++ b/test/test_rake_package_task.rb @@ -78,4 +78,16 @@ def test_package_name_noversion assert_equal "a", pkg.package_name end + def test_without_parent_dir + pkg = Rake::PackageTask.new("foo", :noversion) + + assert_equal "pkg", pkg.working_dir + assert_equal "foo", pkg.target_dir + + pkg.without_parent_dir = true + + assert_equal "pkg/foo", pkg.working_dir + assert_equal ".", pkg.target_dir + end + end From be62efb6cdfc2cc00d660f8fc7d6c1c9de8014e2 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 15 May 2019 09:14:08 +0900 Subject: [PATCH 076/136] 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 077/136] 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 078/136] 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 "." From a232f0204c636dc6b42c7bffef93c1d858635a05 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 9 Aug 2019 23:58:35 +0900 Subject: [PATCH 079/136] Update ruby.yml --- .github/workflows/ruby.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/ruby.yml diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 000000000..b61895f54 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,20 @@ +name: Ruby + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + - name: Set up Ruby 2.6 + uses: actions/setup-ruby@v1 + with: + version: 2.6.x + - name: Build and test with Rake + run: | + gem install bundler + bundle install --jobs 4 --retry 3 + bundle exec rake From cfc7e48a0447cec007c9e872035e846d7fd45ff5 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 08:06:48 +0900 Subject: [PATCH 080/136] Enabled build matrix. --- .github/workflows/ruby.yml | 20 -------------------- .github/workflows/ubuntu.yml | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/ruby.yml create mode 100644 .github/workflows/ubuntu.yml diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml deleted file mode 100644 index b61895f54..000000000 --- a/.github/workflows/ruby.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Ruby - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@master - - name: Set up Ruby 2.6 - uses: actions/setup-ruby@v1 - with: - version: 2.6.x - - name: Build and test with Rake - run: | - gem install bundler - bundle install --jobs 4 --retry 3 - bundle exec rake diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 000000000..f186d5e24 --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,20 @@ +name: ubuntu + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + ruby: [ '2.6.x', '2.5.x', '2.4.x', '2.3.x' ] + steps: + - uses: actions/checkout@master + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + version: ${{ matrix.ruby }} + - name: Build and test with Rake + run: | + gem install minitest + ruby -Ilib exe/rake From 8017d98af33f9bd7e626afe79c09eb1c97c8ec22 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 08:09:56 +0900 Subject: [PATCH 081/136] Added Windows and macOS. --- .github/workflows/macos.yml | 20 ++++++++++++++++++++ .github/workflows/windows.yml | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/macos.yml create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 000000000..1cb08f474 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,20 @@ +name: ubuntu + +on: [push] + +jobs: + build: + runs-on: macos-latest + strategy: + matrix: + ruby: [ '2.6.x', '2.5.x', '2.4.x', '2.3.x' ] + steps: + - uses: actions/checkout@master + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + version: ${{ matrix.ruby }} + - name: Build and test with Rake + run: | + gem install minitest + ruby -Ilib exe/rake diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 000000000..f3930c50c --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,20 @@ +name: ubuntu + +on: [push] + +jobs: + build: + runs-on: windows-latest + strategy: + matrix: + ruby: [ '2.6.x', '2.5.x', '2.4.x', '2.3.x' ] + steps: + - uses: actions/checkout@master + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + version: ${{ matrix.ruby }} + - name: Build and test with Rake + run: | + gem install minitest + ruby -Ilib exe/rake From 42060431d50fb50c6a2c9dd38fb68c3e5890671c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 08:10:30 +0900 Subject: [PATCH 082/136] Fixed build names. --- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1cb08f474..f991a6230 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,4 +1,4 @@ -name: ubuntu +name: macos on: [push] diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f3930c50c..624394de3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,4 +1,4 @@ -name: ubuntu +name: windows on: [push] From a4dc9e07dc007937137779cf564aae657b4ed025 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 08:12:51 +0900 Subject: [PATCH 083/136] Windows env only provide Ruby 2.4+ --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 624394de3..c0a2c4b39 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -7,7 +7,7 @@ jobs: runs-on: windows-latest strategy: matrix: - ruby: [ '2.6.x', '2.5.x', '2.4.x', '2.3.x' ] + ruby: [ '2.6.x', '2.5.x', '2.4.x' ] steps: - uses: actions/checkout@master - name: Set up Ruby From 0544f30f32a4029f50c7f2a8233e8ce7b0ff71f8 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 08:14:21 +0900 Subject: [PATCH 084/136] setup-ruby is not support macOS env. --- .github/workflows/macos.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f991a6230..3d7f3d93d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -5,15 +5,8 @@ on: [push] jobs: build: runs-on: macos-latest - strategy: - matrix: - ruby: [ '2.6.x', '2.5.x', '2.4.x', '2.3.x' ] steps: - uses: actions/checkout@master - - name: Set up Ruby - uses: actions/setup-ruby@v1 - with: - version: ${{ matrix.ruby }} - name: Build and test with Rake run: | gem install minitest From db19b5651b1d184c6ed5dab48baeb449f49c2f9c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 08:17:30 +0900 Subject: [PATCH 085/136] Split install and test tasks. --- .github/workflows/macos.yml | 8 ++++---- .github/workflows/ubuntu.yml | 8 ++++---- .github/workflows/windows.yml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3d7f3d93d..b1d5cb47c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -7,7 +7,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@master - - name: Build and test with Rake - run: | - gem install minitest - ruby -Ilib exe/rake + - name: Install dependencies + run: gem install minitest + - name: Run test + run: ruby -Ilib exe/rake diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index f186d5e24..e42be3dda 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -14,7 +14,7 @@ jobs: uses: actions/setup-ruby@v1 with: version: ${{ matrix.ruby }} - - name: Build and test with Rake - run: | - gem install minitest - ruby -Ilib exe/rake + - name: Install dependencies + run: gem install minitest + - name: Run test + run: ruby -Ilib exe/rake diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c0a2c4b39..6fea96fb7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,7 +14,7 @@ jobs: uses: actions/setup-ruby@v1 with: version: ${{ matrix.ruby }} - - name: Build and test with Rake - run: | - gem install minitest - ruby -Ilib exe/rake + - name: Install dependencies + run: gem install minitest + - name: Run test + run: ruby -Ilib exe/rake From 116df91231135540719908a4a607fc8fdb9b20e8 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 08:18:48 +0900 Subject: [PATCH 086/136] Removed duplicated tasks with GitHub Actions. --- .travis.yml | 9 +-------- appveyor.yml | 23 ----------------------- azure-pipelines.yml | 11 ----------- 3 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 appveyor.yml delete mode 100644 azure-pipelines.yml diff --git a/.travis.yml b/.travis.yml index b0bf3ebe3..560a3449a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,12 @@ language: ruby rvm: - - 2.0.0 - - 2.1.10 - - 2.2.10 - - 2.3.8 - - 2.4.5 - - 2.5.3 - - 2.6.1 - ruby-head - jruby-9.2.4.0 - jruby-head matrix: include: - - rvm: 2.5.3 + - rvm: ruby-head env: COVERALLS=yes before_script: diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index fa978bb4a..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -clone_depth: 10 -install: - - SET PATH=C:\Ruby%ruby_version%\bin;%PATH% - - gem install minitest -build: off -test_script: - - ruby -Ilib exe/rake -deploy: off -environment: - matrix: - - ruby_version: "200" - - ruby_version: "200-x64" - - ruby_version: "21" - - ruby_version: "21-x64" - - ruby_version: "22" - - ruby_version: "22-x64" - - ruby_version: "23" - - ruby_version: "23-x64" - - ruby_version: "24" - - ruby_version: "24-x64" - - ruby_version: "25" - - ruby_version: "25-x64" diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 19cce3eeb..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,11 +0,0 @@ -jobs: -- job: macOS - pool: - vmImage: 'macos-10.13' - steps: - - script: | - gem install bundler - bundle install --retry=3 --jobs=4 - displayName: 'bundle install' - - script: ruby -Ilib exe/rake - displayName: 'ruby -Ilib exe/rake' From 81c9ca24c9371eb9bdf3ea118a9cdd20cb9ba601 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 09:21:53 +0900 Subject: [PATCH 087/136] Removed the badge of appveyor. --- README.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index ab136b85d..58e504e33 100644 --- a/README.rdoc +++ b/README.rdoc @@ -3,7 +3,7 @@ home :: https://github.com/ruby/rake bugs :: https://github.com/ruby/rake/issues docs :: https://ruby.github.io/rake -build status :: {travis-ci}[https://travis-ci.org/ruby/rake] {appveyor}[https://ci.appveyor.com/project/ruby/rake] +build status :: {travis-ci}[https://travis-ci.org/ruby/rake] == Description From e3c306c4a8d67e381d1abe1ac66b233066798fd0 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 13:59:05 +0900 Subject: [PATCH 088/136] Try to use rvm on GitHub Actions --- .github/workflows/ubuntu-rvm.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/ubuntu-rvm.yml diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml new file mode 100644 index 000000000..9eb37efc6 --- /dev/null +++ b/.github/workflows/ubuntu-rvm.yml @@ -0,0 +1,28 @@ +name: ubuntu-rvm + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + ruby: [ 'jruby-head', 'jruby-9.2.4.0', 'ruby-head' ] + steps: + - uses: actions/checkout@master + - name: Set up RVM + run: | + curl -sSL https://get.rvm.io | bash + - name: Set up Ruby + run: | + source $HOME/.rvm/scripts/rvm + rvm install ${{ matrix.ruby }} --binary + rvm --default use ${{ matrix.ruby }} + - name: Install dependencies + run: | + source $HOME/.rvm/scripts/rvm + gem install minitest + - name: Run test + run: | + source $HOME/.rvm/scripts/rvm + ruby -Ilib exe/rake From c2868b7728e4907d38d2a1b07ba8f7fb5100b80a Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 14:04:52 +0900 Subject: [PATCH 089/136] Enabled coveralls service on macOS env. --- .github/workflows/macos.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b1d5cb47c..f567d63d2 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,4 +10,6 @@ jobs: - name: Install dependencies run: gem install minitest - name: Run test + env: + COVERALLS: "yes" run: ruby -Ilib exe/rake From 516c95e159d9d43f86b5bf72b43d0ccd46b8f398 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 14:08:08 +0900 Subject: [PATCH 090/136] Good bye Travis. Thanks for your contribution. --- .travis.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 560a3449a..000000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: ruby -rvm: - - ruby-head - - jruby-9.2.4.0 - - jruby-head - -matrix: - include: - - rvm: ruby-head - env: COVERALLS=yes - -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 d06f086872bb6770614f58bae40f3781f76f574b Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 09:24:05 +0900 Subject: [PATCH 091/136] Use Gemfile instead of Gem::Specification#add_development_dependency. --- Gemfile | 8 ++++++++ rake.gemspec | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index b4e2a20bb..f0eb2bc9f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,11 @@ source "https://rubygems.org" gemspec + +group :development do + gem "bundler" + gem "minitest" + gem "rdoc" + gem "coveralls" + gem "rubocop" +end diff --git a/rake.gemspec b/rake.gemspec index 66c567ca9..1fb4515f1 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -33,10 +33,4 @@ Rake has the following features: 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] - - s.add_development_dependency(%q.freeze) - 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 74262fe6f0304aabd9b5fc250acbef0bd2133da7 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 09:24:37 +0900 Subject: [PATCH 092/136] Removed rdoc. --- Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile b/Gemfile index f0eb2bc9f..8bcbf50a7 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,6 @@ gemspec group :development do gem "bundler" gem "minitest" - gem "rdoc" gem "coveralls" gem "rubocop" end From 3e0c46b01e2b7d7fb6bcd9ee15c3cd291a7e79c8 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 10 Aug 2019 15:21:37 +0900 Subject: [PATCH 093/136] Removed status badge of Travis. --- README.rdoc | 1 - 1 file changed, 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index 58e504e33..5f0278d8e 100644 --- a/README.rdoc +++ b/README.rdoc @@ -3,7 +3,6 @@ home :: https://github.com/ruby/rake bugs :: https://github.com/ruby/rake/issues docs :: https://ruby.github.io/rake -build status :: {travis-ci}[https://travis-ci.org/ruby/rake] == Description From b7da5b97cacd700fd7c9538a3127809308c49bb8 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 19 Aug 2019 20:19:51 +0900 Subject: [PATCH 094/136] Use the latest version of JRuby --- .github/workflows/ubuntu-rvm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index 9eb37efc6..07138f092 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ 'jruby-head', 'jruby-9.2.4.0', 'ruby-head' ] + ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'ruby-head' ] steps: - uses: actions/checkout@master - name: Set up RVM From 2c1a7ec6666a6e8bf5e329d0a82d278008554a08 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 19 Aug 2019 20:20:31 +0900 Subject: [PATCH 095/136] Added the old versions --- .github/workflows/ubuntu-rvm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index 07138f092..09988add6 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'ruby-head' ] + ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'ruby-head', "2.0", "2.1", "2.2", "2.3" ] steps: - uses: actions/checkout@master - name: Set up RVM From 124de86913972c064b628b83be8ffc539e1f01f3 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 19 Aug 2019 20:25:49 +0900 Subject: [PATCH 096/136] Set the explicitly versions. --- .github/workflows/ubuntu-rvm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index 09988add6..0b6bbae68 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'ruby-head', "2.0", "2.1", "2.2", "2.3" ] + ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'ruby-head', "2.0.0-p648", "2.1.10", "2.2.10", "2.3.8" ] steps: - uses: actions/checkout@master - name: Set up RVM From 663acd5e5b3af905af4bd018967d7d9663696c41 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 19 Aug 2019 20:33:07 +0900 Subject: [PATCH 097/136] There is no binaries of 2.0 and 2.1 on RVM --- .github/workflows/ubuntu-rvm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index 0b6bbae68..b5dce9e0f 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'ruby-head', "2.0.0-p648", "2.1.10", "2.2.10", "2.3.8" ] + ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'ruby-head', 2.2.10", "2.3.8" ] steps: - uses: actions/checkout@master - name: Set up RVM From e7b12dfe554d81dcd906f0a53b3cbd9ddc0c5f38 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 19 Aug 2019 20:34:51 +0900 Subject: [PATCH 098/136] Added truffleruby --- .github/workflows/ubuntu-rvm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index b5dce9e0f..1d7aa2a33 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'ruby-head', 2.2.10", "2.3.8" ] + ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'truffleruby', 'ruby-head', 2.2.10", "2.3.8" ] steps: - uses: actions/checkout@master - name: Set up RVM From c728f8f40565618ce0274fcf7a0c1f2838007bbc Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 19 Aug 2019 20:40:33 +0900 Subject: [PATCH 099/136] 2.3 is provided by GitHub Actions, We need to switch 2.1. --- .github/workflows/ubuntu-rvm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index 1d7aa2a33..2bebfd10b 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'truffleruby', 'ruby-head', 2.2.10", "2.3.8" ] + ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'truffleruby', 'ruby-head', '2.2.10', '2.1.10' ] steps: - uses: actions/checkout@master - name: Set up RVM From ec19e59ac7fa41feed38a0bc95040666713c580f Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 19 Aug 2019 20:43:23 +0900 Subject: [PATCH 100/136] 2.1 is not provided by binary installation --- .github/workflows/ubuntu-rvm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index 2bebfd10b..b807d35d0 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'truffleruby', 'ruby-head', '2.2.10', '2.1.10' ] + ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'truffleruby', 'ruby-head', '2.2.10' ] steps: - uses: actions/checkout@master - name: Set up RVM From f19222ffae9168d4c4d2867f14de06df89febad2 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 20 Aug 2019 09:39:04 +0900 Subject: [PATCH 101/136] Removed truffleruby temporary. https://github.com/oracle/truffleruby/issues/1739#issuecomment-522546333 --- .github/workflows/ubuntu-rvm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index b807d35d0..5b5cf8391 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'truffleruby', 'ruby-head', '2.2.10' ] + ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'ruby-head', '2.2.10' ] steps: - uses: actions/checkout@master - name: Set up RVM From f4c27adbaff841c2fd3b7e66e827468f3e38fab5 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 26 Aug 2019 22:05:04 +0900 Subject: [PATCH 102/136] Try to use setup-ruby on macos --- .github/workflows/macos.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f567d63d2..1c52cc0c3 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -5,8 +5,15 @@ on: [push] jobs: build: runs-on: macos-latest + strategy: + matrix: + ruby: [ '2.6.x', '2.5.x', '2.4.x', '2.3.x' ] steps: - uses: actions/checkout@master + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + version: ${{ matrix.ruby }} - name: Install dependencies run: gem install minitest - name: Run test From 4d745f83ad15827e2cb92329356ccc24dcb8bbcd Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 31 Aug 2019 22:00:51 +0900 Subject: [PATCH 103/136] Drop old ruby versions which are no longer tested --- rake.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index 1fb4515f1..20591cb36 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -29,7 +29,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(">= 2.0.0".freeze) + s.required_ruby_version = Gem::Requirement.new(">= 2.2".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 a24f841926b182032fe6bd493c28d2f865cf5e5e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 31 Aug 2019 23:59:57 +0900 Subject: [PATCH 104/136] Removed stale skips --- test/test_rake_application.rb | 3 --- test/test_rake_backtrace.rb | 2 -- test/test_rake_file_list.rb | 1 - test/test_rake_task_with_arguments.rb | 3 --- 4 files changed, 9 deletions(-) diff --git a/test/test_rake_application.rb b/test/test_rake_application.rb index 27645ea12..8514da354 100644 --- a/test/test_rake_application.rb +++ b/test/test_rake_application.rb @@ -77,9 +77,6 @@ def test_display_exception_details_bad_encoding end def test_display_exception_details_cause - skip "Exception#cause not implemented" unless - Exception.method_defined? :cause - begin raise "cause a" rescue diff --git a/test/test_rake_backtrace.rb b/test/test_rake_backtrace.rb index 27e3cecb7..05a2dfda1 100644 --- a/test/test_rake_backtrace.rb +++ b/test/test_rake_backtrace.rb @@ -13,7 +13,6 @@ def test_bin_rake_suppressed def test_system_dir_suppressed path = RbConfig::CONFIG["rubylibprefix"] - skip if path.nil? path = File.expand_path path paths = [path + ":12"] @@ -25,7 +24,6 @@ def test_system_dir_suppressed def test_near_system_dir_isnt_suppressed path = RbConfig::CONFIG["rubylibprefix"] - skip if path.nil? path = File.expand_path path paths = [" " + path + ":12"] diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index 97ab99828..853ebc8d9 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -212,7 +212,6 @@ def test_exclude_with_string_return_on_create end def test_exclude_curly_bracket_pattern - skip "brace pattern matches not supported" unless defined? File::FNM_EXTGLOB fl = FileList["*"].exclude("{abc,xyz}.c") assert_equal %w[abc.h abc.x cfiles existing x.c xyzzy.txt], fl end diff --git a/test/test_rake_task_with_arguments.rb b/test/test_rake_task_with_arguments.rb index 46edcd112..36dfa2646 100644 --- a/test/test_rake_task_with_arguments.rb +++ b/test/test_rake_task_with_arguments.rb @@ -82,9 +82,6 @@ def test_actions_of_various_arity_are_ok_with_args end 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/ # https://github.com/ruby/rake/pull/174#issuecomment-263460761 skip if jruby9? eval <<-RUBY, binding, __FILE__, __LINE__+1 From 6c0626da3a7af0cba1bdead219e96e5689dc1540 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 31 Aug 2019 23:48:47 +0900 Subject: [PATCH 105/136] Reduce repeated code --- lib/rake/file_utils.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb index dc434c8d9..00c9c9dca 100644 --- a/lib/rake/file_utils.rb +++ b/lib/rake/file_utils.rb @@ -111,16 +111,14 @@ 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] - cp(*args) - else + if LN_SUPPORTED[0] begin - ln(*args) + return ln(*args) rescue StandardError, NotImplementedError LN_SUPPORTED[0] = false - cp(*args) end end + cp(*args) end # Split a file path into individual directory names. From baa23cc8a8cc624bc8f46c8a55d2f0caade568ea Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 31 Aug 2019 22:24:24 +0900 Subject: [PATCH 106/136] Update keyword arguments merger --- lib/rake/clean.rb | 4 ++-- lib/rake/file_utils.rb | 13 ++++++------- lib/rake/file_utils_ext.rb | 23 ++++++----------------- lib/rake/task.rb | 6 +++++- test/test_rake_file_utils.rb | 16 ++++++++++++++++ 5 files changed, 35 insertions(+), 27 deletions(-) diff --git a/lib/rake/clean.rb b/lib/rake/clean.rb index 5af44015e..b52e832a9 100644 --- a/lib/rake/clean.rb +++ b/lib/rake/clean.rb @@ -28,10 +28,10 @@ def cleanup_files(file_names) end end - def cleanup(file_name, opts={}) + def cleanup(file_name, **opts) begin opts = { verbose: Rake.application.options.trace }.merge(opts) - rm_r file_name, opts + rm_r file_name, **opts rescue StandardError => ex puts "Failed to remove #{file_name}: #{ex}" unless file_already_gone?(file_name) end diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb index 00c9c9dca..e979eedb2 100644 --- a/lib/rake/file_utils.rb +++ b/lib/rake/file_utils.rb @@ -97,12 +97,11 @@ def set_verbose_option(options) # :nodoc: # Example: # ruby %{-pe '$_.upcase!' 1 - sh(*([RUBY] + args + [options]), &block) + sh(RUBY, *args, **options, &block) else - sh("#{RUBY} #{args.first}", options, &block) + sh("#{RUBY} #{args.first}", **options, &block) end end @@ -110,15 +109,15 @@ 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) + def safe_ln(*args, **options) if LN_SUPPORTED[0] begin - return ln(*args) + return options.empty? ? ln(*args) : ln(*args, **options) rescue StandardError, NotImplementedError LN_SUPPORTED[0] = false end end - cp(*args) + options.empty? ? cp(*args) : cp(*args, **options) end # Split a file path into individual directory names. diff --git a/lib/rake/file_utils_ext.rb b/lib/rake/file_utils_ext.rb index bf558b749..e91ad595f 100644 --- a/lib/rake/file_utils_ext.rb +++ b/lib/rake/file_utils_ext.rb @@ -23,19 +23,18 @@ class << self opts = FileUtils.options_of name default_options = [] if opts.include?("verbose") - default_options << ":verbose => FileUtilsExt.verbose_flag" + default_options << "verbose: FileUtilsExt.verbose_flag" end if opts.include?("noop") - default_options << ":noop => FileUtilsExt.nowrite_flag" + default_options << "noop: FileUtilsExt.nowrite_flag" end next if default_options.empty? module_eval(<<-EOS, __FILE__, __LINE__ + 1) - def #{name}( *args, &block ) - super( - *rake_merge_option(args, - #{default_options.join(', ')} - ), &block) + def #{name}(*args, **options, &block) + super(*args, + #{default_options.join(', ')}, + **options, &block) end EOS end @@ -113,16 +112,6 @@ def when_writing(msg=nil) end end - # Merge the given options with the default values. - def rake_merge_option(args, defaults) - if Hash === args.last - defaults.update(args.last) - args.pop - end - args.push defaults - args - end - # Send the message to the default rake output (which is $stderr). def rake_output_message(message) $stderr.puts(message) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 7629732f6..80824f37b 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -274,7 +274,11 @@ def execute(args=nil) end application.trace "** Execute #{name}" if application.options.trace application.enhance_with_matching_rule(name) if @actions.empty? - @actions.each { |act| act.call(self, args) } + if opts = Hash.try_convert(args) and !opts.empty? + @actions.each { |act| act.call(self, args, **opts)} + else + @actions.each { |act| act.call(self, args)} + end end # Is this task needed? diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index 7e9674fdc..ebedd56b2 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -39,6 +39,22 @@ def test_rm_filelist refute File.exist?("b") end + def test_rm_nowrite + create_file("a") + nowrite(true) { + rm_rf "a" + } + assert File.exist?("a") + nowrite(false) { + rm_rf "a", noop: true + } + assert File.exist?("a") + nowrite(true) { + rm_rf "a", noop: false + } + refute File.exist?("a") + end + def test_ln open("a", "w") { |f| f.puts "TEST_LN" } From ab835523b29543092e31a81d7d620b7d90b1678c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 9 Sep 2019 15:54:11 +0900 Subject: [PATCH 107/136] bump version to 13.0.0.pre.1 --- History.rdoc | 15 +++++++++++++++ lib/rake/version.rb | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index 16b6331a1..afdfde5ac 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,18 @@ +=== 13.0.0.pre.1 + +==== Enhancements + +* Follows recent changes on keyword arguments in ruby 2.7. + Pull Request #326 by nobu +* Make `PackageTask` be able to omit parent directory while packing files + Pull Request #310 by tonytonyjan +* Add order only dependency + Pull Request #269 by take-cheeze + +==== Compatibility changes + +* Drop old ruby versions(< 2.2) + === 12.3.3 ==== Bug fixes diff --git a/lib/rake/version.rb b/lib/rake/version.rb index 6014e9322..b0d7dfa64 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "12.3.3" + VERSION = "13.0.0.pre.1" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "." From c84887d4607c672fda66b62ba4b1c970ac0ce94f Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 10 Sep 2019 19:13:28 +0900 Subject: [PATCH 108/136] Use RUBY insted of BUNDLE_RUBY for test-bundled-gems of ruby/ruby. --- test/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helper.rb b/test/helper.rb index 64f7db7e2..32456fde4 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -28,7 +28,7 @@ class TaskManager include Rake::TaskManager end - RUBY = File.realpath(ENV["BUNDLE_RUBY"] || Gem.ruby) + RUBY = File.realpath(ENV["RUBY"] || Gem.ruby) def setup ARGV.clear From d8aba43cfe7c42b16856c85dcc6ee3e2b9aff01c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 24 Sep 2019 21:27:05 +0900 Subject: [PATCH 109/136] Prepare to release rake 13 --- History.rdoc | 2 +- lib/rake/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/History.rdoc b/History.rdoc index afdfde5ac..3d0b53d1d 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,4 +1,4 @@ -=== 13.0.0.pre.1 +=== 13.0.0 ==== Enhancements diff --git a/lib/rake/version.rb b/lib/rake/version.rb index b0d7dfa64..7f47740c1 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "13.0.0.pre.1" + VERSION = "13.0.0" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "." From 00aacdcf70309a17de2580fb380ed29f2d0fb6f7 Mon Sep 17 00:00:00 2001 From: Matthew Bellantoni Date: Fri, 27 Sep 2019 16:18:12 -0400 Subject: [PATCH 110/136] Fix an incorrectly resolved arg pattern --- lib/rake/task_manager.rb | 4 ++-- test/test_rake_task_manager_argument_resolution.rb | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index 1d3cb1cfa..6da31f97f 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -133,8 +133,8 @@ def resolve_args_with_dependencies(args, hash) # :nodoc: deps = value || [] else task_name = args.shift - arg_names = key - deps = value + arg_names = key || args.shift|| [] + deps = value || [] end deps = [deps] unless deps.respond_to?(:to_ary) [task_name, arg_names, deps, order_only] diff --git a/test/test_rake_task_manager_argument_resolution.rb b/test/test_rake_task_manager_argument_resolution.rb index 6539343ac..21e28a951 100644 --- a/test/test_rake_task_manager_argument_resolution.rb +++ b/test/test_rake_task_manager_argument_resolution.rb @@ -8,9 +8,16 @@ def test_good_arg_patterns assert_equal [:t, [], [:x], nil], task(t: :x) assert_equal [:t, [], [:x, :y], nil], task(t: [:x, :y]) + assert_equal [:t, [], [], [:m]], task(:t, order_only: [:m]) + assert_equal [:t, [], [:x, :y], [:m, :n]], task(t: [:x, :y], order_only: [:m, :n]) + assert_equal [:t, [:a, :b], [], nil], task(:t, [:a, :b]) assert_equal [:t, [:a, :b], [:x], nil], task(:t, [:a, :b] => :x) assert_equal [:t, [:a, :b], [:x, :y], nil], task(:t, [:a, :b] => [:x, :y]) + + assert_equal [:t, [:a, :b], [], [:m]], task(:t, [:a, :b], order_only: [:m]) + assert_equal [:t, [:a, :b], [:x], [:m]], task(:t, [:a, :b] => :x, order_only: [:m]) + assert_equal [:t, [:a, :b], [:x, :y], [:m, :n]], task(:t, [:a, :b] => [:x, :y], order_only: [:m, :n]) end def task(*args) From 46a8f7cbd4072431eb16e8e0858d556797ce677e Mon Sep 17 00:00:00 2001 From: Matthew Bellantoni Date: Fri, 27 Sep 2019 16:23:58 -0400 Subject: [PATCH 111/136] Update comments to reflect the current state --- lib/rake/task_manager.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index 6da31f97f..97e3b9459 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -83,8 +83,8 @@ def synthesize_file_task(task_name) # :nodoc: define_task(Rake::FileTask, task_name) end - # Resolve the arguments for a task/rule. Returns a triplet of - # [task_name, arg_name_list, prerequisites]. + # Resolve the arguments for a task/rule. Returns a tuple of + # [task_name, arg_name_list, prerequisites, order_only_prerequisites]. def resolve_args(args) if args.last.is_a?(Hash) deps = args.pop @@ -118,8 +118,11 @@ def resolve_args_without_dependencies(args) # # The patterns recognized by this argument resolving function are: # + # task :t, order_only: [:e] # task :t => [:d] + # task :t => [:d], order_only: [:e] # task :t, [a] => [:d] + # task :t, [a] => [:d], order_only: [:e] # def resolve_args_with_dependencies(args, hash) # :nodoc: fail "Task Argument Error" if From c3953d4b2935895e1bb4596c435653d3a865711a Mon Sep 17 00:00:00 2001 From: Orien Madgwick <_@orien.io> Date: Wed, 2 Oct 2019 23:06:46 +1000 Subject: [PATCH 112/136] Add project metadata to the gemspec As per https://guides.rubygems.org/specification-reference/#metadata, add metadata to the gemspec file. This'll allow people to more easily access the source code, raise issues and read the changelog. These `bug_tracker_uri`, `changelog_uri`, `documentation_uri`, and `source_code_uri` links will appear on the rubygems page at https://rubygems.org/gems/rake and be available via the Rubygems API after the next release. --- rake.gemspec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rake.gemspec b/rake.gemspec index 20591cb36..ecdec7299 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -23,6 +23,13 @@ Rake has the following features: s.homepage = "https://github.com/ruby/rake".freeze s.licenses = ["MIT".freeze] + s.metadata = { + "bug_tracker_uri" => "https://github.com/ruby/rake/issues", + "changelog_uri" => "https://github.com/ruby/rake/blob/v#{s.version}/History.rdoc", + "documentation_uri" => "https://ruby.github.io/rake", + "source_code_uri" => "https://github.com/ruby/rake/tree/v#{s.version}", + } + s.files = %x[git ls-files -z].split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - %w[.rubocop.yml .gitignore .travis.yml appveyor.yml] s.bindir = "exe" From 4dc6282eb24c0117a012d07744ea1bbcae1b3a79 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 4 Oct 2019 09:06:44 -0700 Subject: [PATCH 113/136] Skip a taint test on Ruby 2.7 Ruby 2.7 is deprecating taint, and taint will no longer have an effect. See https://bugs.ruby-lang.org/issues/16131. This just skips the test for FileList#clone and #dup copying the taint flag on Ruby 2.7+. --- test/test_rake_file_list.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/test_rake_file_list.rb b/test/test_rake_file_list.rb index 853ebc8d9..eda55d29f 100644 --- a/test/test_rake_file_list.rb +++ b/test/test_rake_file_list.rb @@ -496,13 +496,15 @@ def test_clone_and_dup assert_equal ["a", "b", "c"], d end - def test_dup_and_clone_replicate_taint - a = FileList["a", "b", "c"] - a.taint - c = a.clone - d = a.dup - assert c.tainted?, "Clone should be tainted" - assert d.tainted?, "Dup should be tainted" + if RUBY_VERSION < '2.7' + def test_dup_and_clone_replicate_taint + a = FileList["a", "b", "c"] + a.taint + c = a.clone + d = a.dup + assert c.tainted?, "Clone should be tainted" + assert d.tainted?, "Dup should be tainted" + end end def test_duped_items_will_thaw From 8edd860cd0fc9035bda472ef45110a40889b9627 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 12 Nov 2019 12:27:50 +0900 Subject: [PATCH 114/136] Fixed build failure of the latest GitHub Actions --- .github/workflows/macos.yml | 4 ++-- .github/workflows/ubuntu-rvm.yml | 2 +- .github/workflows/ubuntu.yml | 4 ++-- .github/workflows/windows.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1c52cc0c3..2dbc56a36 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -7,13 +7,13 @@ jobs: runs-on: macos-latest strategy: matrix: - ruby: [ '2.6.x', '2.5.x', '2.4.x', '2.3.x' ] + ruby: [ '2.6.x', '2.5.x', '2.4.x' ] steps: - uses: actions/checkout@master - name: Set up Ruby uses: actions/setup-ruby@v1 with: - version: ${{ matrix.ruby }} + ruby-version: ${{ matrix.ruby }} - name: Install dependencies run: gem install minitest - name: Run test diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index 5b5cf8391..cf3d1d05b 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ 'jruby-head', 'jruby-9.2.8.0', 'ruby-head', '2.2.10' ] + ruby: [ 'jruby-head', 'jruby-9.2.9.0', 'ruby-head', '2.3.8', '2.2.10' ] steps: - uses: actions/checkout@master - name: Set up RVM diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index e42be3dda..b67130ad8 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -7,13 +7,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ '2.6.x', '2.5.x', '2.4.x', '2.3.x' ] + ruby: [ '2.6.x', '2.5.x', '2.4.x' ] steps: - uses: actions/checkout@master - name: Set up Ruby uses: actions/setup-ruby@v1 with: - version: ${{ matrix.ruby }} + ruby-version: ${{ matrix.ruby }} - name: Install dependencies run: gem install minitest - name: Run test diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6fea96fb7..5ced11c45 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Ruby uses: actions/setup-ruby@v1 with: - version: ${{ matrix.ruby }} + ruby-version: ${{ matrix.ruby }} - name: Install dependencies run: gem install minitest - name: Run test From c8251e2299616d8126e4ac7426e0bb87df7e6922 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 12 Nov 2019 12:28:15 +0900 Subject: [PATCH 115/136] Bump version to 13.0.1 --- History.rdoc | 9 +++++++++ lib/rake/version.rb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/History.rdoc b/History.rdoc index 3d0b53d1d..119747c66 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,3 +1,12 @@ +=== 13.0.1 + +==== Bug fixes + +* Fixed bug: Reenabled task raises previous exception on second invokation + Pull Request #271 by thorsteneckel +* Fix an incorrectly resolved arg pattern + Pull Request #327 by mjbellantoni + === 13.0.0 ==== Enhancements diff --git a/lib/rake/version.rb b/lib/rake/version.rb index 7f47740c1..b5486ba79 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "13.0.0" + VERSION = "13.0.1" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "." From c4a50da6217eacaef26d0d34d2e11c551bfe54ba Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 21 Nov 2019 17:24:44 +0100 Subject: [PATCH 116/136] Test Rake on TruffleRuby * See https://github.com/oracle/truffleruby/issues/1739 and f19222ffae9168d4c4d2867f14de06df89febad2. --- .github/workflows/ubuntu-rvm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index cf3d1d05b..d938cdb50 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ 'jruby-head', 'jruby-9.2.9.0', 'ruby-head', '2.3.8', '2.2.10' ] + ruby: [ 'jruby-head', 'jruby-9.2.9.0', 'truffleruby', 'ruby-head', '2.3.8', '2.2.10' ] steps: - uses: actions/checkout@master - name: Set up RVM From 4a4bc2ea071d7cb70d83505955a4d9b53f1e1e96 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 21 Nov 2019 17:28:35 +0100 Subject: [PATCH 117/136] Enable GitHub Actions on pull requests --- .github/workflows/macos.yml | 2 +- .github/workflows/ubuntu-rvm.yml | 2 +- .github/workflows/ubuntu.yml | 2 +- .github/workflows/windows.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2dbc56a36..f888bfa33 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,6 +1,6 @@ name: macos -on: [push] +on: [push, pull_request] jobs: build: diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index d938cdb50..39171322a 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -1,6 +1,6 @@ name: ubuntu-rvm -on: [push] +on: [push, pull_request] jobs: build: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index b67130ad8..362f91c6c 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,6 +1,6 @@ name: ubuntu -on: [push] +on: [push, pull_request] jobs: build: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5ced11c45..10700a416 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,6 +1,6 @@ name: windows -on: [push] +on: [push, pull_request] jobs: build: From 18508c4845b1c7026e645295f4ceb27a46308347 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 22 Nov 2019 15:50:59 +0100 Subject: [PATCH 118/136] Skip the only failing test on TruffleRuby 19.3.0 * See https://github.com/ruby/rake/pull/331 --- test/test_rake_clean.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_rake_clean.rb b/test/test_rake_clean.rb index b0b1ad602..1e78a3667 100644 --- a/test/test_rake_clean.rb +++ b/test/test_rake_clean.rb @@ -4,7 +4,11 @@ class TestRakeClean < Rake::TestCase # :nodoc: def test_clean - load "rake/clean.rb", true + if RUBY_ENGINE == 'truffleruby' and RUBY_ENGINE_VERSION == '19.3.0' + load "rake/clean.rb" # TruffleRuby 19.3 does not set self correctly with wrap=true + else + load "rake/clean.rb", true + end assert Rake::Task["clean"], "Should define clean" assert Rake::Task["clobber"], "Should define clobber" From 1fec8e27731fca0d86fa8cde8f0008cba03402ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 14 Jan 2020 17:41:24 +0100 Subject: [PATCH 119/136] Do not include `.github` directory into released gem I have not tested this change, I have just edited the file via GH, but the point is that currently, the `.github` directory is included in released gem, which is probably mistake. --- rake.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rake.gemspec b/rake.gemspec index ecdec7299..75321497d 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -30,7 +30,7 @@ Rake has the following features: "source_code_uri" => "https://github.com/ruby/rake/tree/v#{s.version}", } - s.files = %x[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|\.github)/}) } - %w[.rubocop.yml .gitignore .travis.yml appveyor.yml] s.bindir = "exe" s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) } From 5dd9db024e525177b34199d374fcffb3ca4aafb8 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 6 Feb 2020 15:52:02 +0100 Subject: [PATCH 120/136] Improve version check in test_rake_clean.rb --- test/test_rake_clean.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_rake_clean.rb b/test/test_rake_clean.rb index 1e78a3667..dffab932d 100644 --- a/test/test_rake_clean.rb +++ b/test/test_rake_clean.rb @@ -4,7 +4,7 @@ class TestRakeClean < Rake::TestCase # :nodoc: def test_clean - if RUBY_ENGINE == 'truffleruby' and RUBY_ENGINE_VERSION == '19.3.0' + if RUBY_ENGINE == 'truffleruby' and RUBY_ENGINE_VERSION.start_with?('19.3.') load "rake/clean.rb" # TruffleRuby 19.3 does not set self correctly with wrap=true else load "rake/clean.rb", true From 9e83d30cdc8b442b51698221fb280c91a118488d Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 6 Feb 2020 15:40:36 +0100 Subject: [PATCH 121/136] Use ruby/setup-ruby to simplify CI --- .github/workflows/macos.yml | 7 +++---- .github/workflows/ubuntu-rvm.yml | 28 ---------------------------- .github/workflows/ubuntu.yml | 7 +++---- .github/workflows/windows.yml | 7 +++---- 4 files changed, 9 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/ubuntu-rvm.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f888bfa33..fe47348c0 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -7,11 +7,10 @@ jobs: runs-on: macos-latest strategy: matrix: - ruby: [ '2.6.x', '2.5.x', '2.4.x' ] + ruby: [ 2.6, 2.5, 2.4 ] steps: - - uses: actions/checkout@master - - name: Set up Ruby - uses: actions/setup-ruby@v1 + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: Install dependencies diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml deleted file mode 100644 index 39171322a..000000000 --- a/.github/workflows/ubuntu-rvm.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: ubuntu-rvm - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - ruby: [ 'jruby-head', 'jruby-9.2.9.0', 'truffleruby', 'ruby-head', '2.3.8', '2.2.10' ] - steps: - - uses: actions/checkout@master - - name: Set up RVM - run: | - curl -sSL https://get.rvm.io | bash - - name: Set up Ruby - run: | - source $HOME/.rvm/scripts/rvm - rvm install ${{ matrix.ruby }} --binary - rvm --default use ${{ matrix.ruby }} - - name: Install dependencies - run: | - source $HOME/.rvm/scripts/rvm - gem install minitest - - name: Run test - run: | - source $HOME/.rvm/scripts/rvm - ruby -Ilib exe/rake diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 362f91c6c..94b89a474 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -7,11 +7,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ '2.6.x', '2.5.x', '2.4.x' ] + ruby: [ 2.6, 2.5, 2.4, 2.3, 2.2, jruby, truffleruby, ruby-head ] steps: - - uses: actions/checkout@master - - name: Set up Ruby - uses: actions/setup-ruby@v1 + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: Install dependencies diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 10700a416..61b87313c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -7,11 +7,10 @@ jobs: runs-on: windows-latest strategy: matrix: - ruby: [ '2.6.x', '2.5.x', '2.4.x' ] + ruby: [ 2.6, 2.5, 2.4 ] steps: - - uses: actions/checkout@master - - name: Set up Ruby - uses: actions/setup-ruby@v1 + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: Install dependencies From 5dd198c76781d05c92cd6df18e0700a14a47aedc Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 16 Feb 2020 16:51:22 +0100 Subject: [PATCH 122/136] Test with jruby-head --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 94b89a474..7622c5bba 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ 2.6, 2.5, 2.4, 2.3, 2.2, jruby, truffleruby, ruby-head ] + ruby: [ 2.6, 2.5, 2.4, 2.3, 2.2, jruby, jruby-head, truffleruby, ruby-head ] steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 From 8bf306586399785e5e4e644fd4c06f13b94fdc21 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 6 Mar 2020 21:10:12 +0900 Subject: [PATCH 123/136] Unify workflow files --- .github/workflows/{ubuntu.yml => test.yml} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename .github/workflows/{ubuntu.yml => test.yml} (81%) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/test.yml similarity index 81% rename from .github/workflows/ubuntu.yml rename to .github/workflows/test.yml index 7622c5bba..f70c12e8a 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/test.yml @@ -4,9 +4,10 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] ruby: [ 2.6, 2.5, 2.4, 2.3, 2.2, jruby, jruby-head, truffleruby, ruby-head ] steps: - uses: actions/checkout@v2 From 8ce1c04e98a9d590e7af5a293c5949de22e16420 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 6 Mar 2020 21:15:49 +0900 Subject: [PATCH 124/136] exclude truffleruby and windows --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f70c12e8a..139a136d6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,9 @@ jobs: matrix: os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] ruby: [ 2.6, 2.5, 2.4, 2.3, 2.2, jruby, jruby-head, truffleruby, ruby-head ] + exclude: + - os: windows-latest + ruby: truffleruby steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 From 1b3cc29baeaf9aef4894fd1c1f4047bf543c297a Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 6 Mar 2020 21:21:14 +0900 Subject: [PATCH 125/136] indent --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 139a136d6..d876810c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,9 +9,9 @@ jobs: matrix: os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] ruby: [ 2.6, 2.5, 2.4, 2.3, 2.2, jruby, jruby-head, truffleruby, ruby-head ] - exclude: - - os: windows-latest - ruby: truffleruby + exclude: + - os: windows-latest + ruby: truffleruby steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 From 6c07d631b8f53ae09ad5b7fe33f908108ba4e5e5 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 6 Mar 2020 21:27:37 +0900 Subject: [PATCH 126/136] Allow failure with JRuby head --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d876810c2..2a0da57ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,3 +21,4 @@ jobs: run: gem install minitest - name: Run test run: ruby -Ilib exe/rake + continue-on-error: ${{ matrix.ruby == 'jruby-head' }} From 7be2afeae8b74e697a41d349a82bb0601f872dd6 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 6 Mar 2020 22:17:54 +0900 Subject: [PATCH 127/136] exclude jruby and windows --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a0da57ce..a76aa0c87 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,10 @@ jobs: exclude: - os: windows-latest ruby: truffleruby + - os: windows-latest + ruby: jruby-head + - os: windows-latest + ruby: jruby steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 @@ -21,4 +25,3 @@ jobs: run: gem install minitest - name: Run test run: ruby -Ilib exe/rake - continue-on-error: ${{ matrix.ruby == 'jruby-head' }} From 063950d6f1bed23243037c8838dc7306b0dbf877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Fri, 12 Jun 2020 12:34:03 +0200 Subject: [PATCH 128/136] Simplify default rake test loader Unless I'm missing something, we can require `rake_test_loader` directly. It's also safer, because there's no chance of requiring the file of a different copy of `rake`, and faster. --- lib/rake/testtask.rb | 37 +------------------------------------ test/test_rake_test_task.rb | 2 +- 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 537627567..6150f2f6e 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -181,44 +181,9 @@ def run_code # :nodoc: when :testrb "-S testrb" when :rake - "#{rake_include_arg} \"#{rake_loader}\"" + "-r#{__dir__}/rake_test_loader" end end - def rake_loader # :nodoc: - find_file("rake/rake_test_loader") or - fail "unable to find rake test loader" - end - - def find_file(fn) # :nodoc: - $LOAD_PATH.each do |path| - file_path = File.join(path, "#{fn}.rb") - return file_path if File.exist? file_path - end - nil - end - - def rake_include_arg # :nodoc: - spec = Gem.loaded_specs["rake"] - if spec.respond_to?(:default_gem?) && spec.default_gem? - "" - else - "-I\"#{rake_lib_dir}\"" - end - end - - def rake_lib_dir # :nodoc: - find_dir("rake") or - fail "unable to find rake lib" - end - - def find_dir(fn) # :nodoc: - $LOAD_PATH.each do |path| - file_path = File.join(path, "#{fn}.rb") - return path if File.exist? file_path - end - nil - end - end end diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 2fd1c1526..8f7d13f84 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -128,7 +128,7 @@ def test_run_code_rake t.loader = :rake end - assert_match(/\A-I".*?" ".*?"\Z/, test_task.run_code) + assert_match(/\A-r.*?\Z/, test_task.run_code) ensure Gem.loaded_specs["rake"] = rake end From bfdf462b0b4d6d12aa906f3a6f8ba1372e77e26e Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 12 Jun 2020 08:52:41 -0700 Subject: [PATCH 129/136] Fix tests to work with current FileUtils Historically, FileUtils logged verbose output to stderr instead of stdout. This was fixed in FileUtils to log verbose output to stdout (since it isn't an error). This commit adjusts the tests to handle both FileUtils versions. --- test/test_rake_clean.rb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/test/test_rake_clean.rb b/test/test_rake_clean.rb index dffab932d..654b95258 100644 --- a/test/test_rake_clean.rb +++ b/test/test_rake_clean.rb @@ -40,11 +40,20 @@ def test_cleanup_ignores_missing_files def test_cleanup_trace file_name = create_file - assert_output "", "rm -r #{file_name}\n" do + out, err = capture_io do with_trace true do Rake::Cleaner.cleanup(file_name) end end + + if err == "" + # Current FileUtils + assert_equal "rm -r #{file_name}\n", out + else + # Old FileUtils + assert_equal "", out + assert_equal "rm -r #{file_name}\n", err + end end def test_cleanup_without_trace @@ -70,11 +79,18 @@ def test_cleanup_opt_overrides_trace_silent def test_cleanup_opt_overrides_trace_verbose file_name = create_file - assert_output "", "rm -r #{file_name}\n" do + out, err = capture_io do with_trace false do Rake::Cleaner.cleanup(file_name, verbose: true) end end + + if err == "" + assert_equal "rm -r #{file_name}\n", out + else + assert_equal "", out + assert_equal "rm -r #{file_name}\n", err + end end private From 9e8e90db36aff3a9aeff9f911ed67f6a1e80486d Mon Sep 17 00:00:00 2001 From: svl7 Date: Mon, 3 Aug 2020 11:17:43 +0200 Subject: [PATCH 130/136] Update broken links to rake articles from Avdi in README --- README.rdoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.rdoc b/README.rdoc index 5f0278d8e..f4b68d921 100644 --- a/README.rdoc +++ b/README.rdoc @@ -82,13 +82,13 @@ Type "rake --help" for all available options. === Presentations and Articles about Rake * Avdi Grimm's rake series: - 1. {Rake Basics}[http://devblog.avdi.org/2014/04/21/rake-part-1-basics/] - 2. {Rake File Lists}[http://devblog.avdi.org/2014/04/22/rake-part-2-file-lists/] - 3. {Rake Rules}[http://devblog.avdi.org/2014/04/23/rake-part-3-rules/] - 4. {Rake Pathmap}[http://devblog.avdi.org/2014/04/24/rake-part-4-pathmap/] - 5. {File Operations}[http://devblog.avdi.org/2014/04/25/rake-part-5-file-operations/] - 6. {Clean and Clobber}[http://devblog.avdi.org/2014/04/28/rake-part-6-clean-and-clobber/] - 7. {MultiTask}[http://devblog.avdi.org/2014/04/29/rake-part-7-multitask/] + 1. {Rake Basics}[https://avdi.codes/rake-part-1-basics/] + 2. {Rake File Lists}[https://avdi.codes/rake-part-2-file-lists-2/] + 3. {Rake Rules}[https://avdi.codes/rake-part-3-rules/] + 4. {Rake Pathmap}[https://avdi.codes/rake-part-4-pathmap/] + 5. {File Operations}[https://avdi.codes/rake-part-5-file-operations/] + 6. {Clean and Clobber}[https://avdi.codes/rake-part-6-clean-and-clobber/] + 7. {MultiTask}[https://avdi.codes/rake-part-7-multitask/] * {Jim Weirich's 2003 RubyConf presentation}[http://web.archive.org/web/20140221123354/http://onestepback.org/articles/buildingwithrake/] * Martin Fowler's article on Rake: http://martinfowler.com/articles/rake.html From 49820401e29089fddb95f0499769a40c433b94ca Mon Sep 17 00:00:00 2001 From: Alam <73675883+bahasalien@users.noreply.github.com> Date: Mon, 9 Nov 2020 23:34:09 +0800 Subject: [PATCH 131/136] Update rdoc; HTTP -> HTTPS except www.a-a-p.org still cannot.... --- README.rdoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.rdoc b/README.rdoc index f4b68d921..9dc2a0546 100644 --- a/README.rdoc +++ b/README.rdoc @@ -89,20 +89,20 @@ Type "rake --help" for all available options. 5. {File Operations}[https://avdi.codes/rake-part-5-file-operations/] 6. {Clean and Clobber}[https://avdi.codes/rake-part-6-clean-and-clobber/] 7. {MultiTask}[https://avdi.codes/rake-part-7-multitask/] -* {Jim Weirich's 2003 RubyConf presentation}[http://web.archive.org/web/20140221123354/http://onestepback.org/articles/buildingwithrake/] -* Martin Fowler's article on Rake: http://martinfowler.com/articles/rake.html +* {Jim Weirich's 2003 RubyConf presentation}[https://web.archive.org/web/20140221123354/http://onestepback.org/articles/buildingwithrake/] +* Martin Fowler's article on Rake: https://martinfowler.com/articles/rake.html == Other Make Re-envisionings ... Rake is a late entry in the make replacement field. Here are links to other projects with similar (and not so similar) goals. -* http://directory.fsf.org/wiki/Bras -- Bras, one of earliest +* https://directory.fsf.org/wiki/Bras -- Bras, one of earliest implementations of "make in a scripting language". -* http://www.a-a-p.org -- Make in Python -* http://ant.apache.org -- The Ant project -* http://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System -* http://www.rubydoc.info/gems/rant/0.5.7/frames -- Rant, another Ruby make tool. +* http://http://www.a-a-p.org -- Make in Python +* https://ant.apache.org -- The Ant project +* https://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System +* https://www.rubydoc.info/gems/rant/0.5.7/frames -- Rant, another Ruby make tool. == Credits From efae4f88963229a7c8ee54c3d13af5730993308b Mon Sep 17 00:00:00 2001 From: Alam <73675883+bahasalien@users.noreply.github.com> Date: Mon, 9 Nov 2020 23:40:59 +0800 Subject: [PATCH 132/136] Fix doubled "http://" in line 102 sorry about that.... --- README.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index 9dc2a0546..0bcaef000 100644 --- a/README.rdoc +++ b/README.rdoc @@ -99,7 +99,7 @@ other projects with similar (and not so similar) goals. * https://directory.fsf.org/wiki/Bras -- Bras, one of earliest implementations of "make in a scripting language". -* http://http://www.a-a-p.org -- Make in Python +* http://www.a-a-p.org -- Make in Python * https://ant.apache.org -- The Ant project * https://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System * https://www.rubydoc.info/gems/rant/0.5.7/frames -- Rant, another Ruby make tool. From 6b8c70d2b39ac7c952f446d82fcf5e2fe6a09e09 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 19 Dec 2020 16:45:52 +0900 Subject: [PATCH 133/136] History for rake-13.0.2 --- History.rdoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/History.rdoc b/History.rdoc index 119747c66..0bd376a9d 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,5 +1,18 @@ === 13.0.1 +==== Enhancements + +* Fix tests to work with current FileUtils + Pull Request #358 by jeremyevans +* Simplify default rake test loader + Pull Request #357 by deivid-rodriguez +* Update rdoc + Pull Request #366 by bahasalien +* Update broken links to rake articles from Avdi in README + Pull Request #360 by svl7 + +=== 13.0.1 + ==== Bug fixes * Fixed bug: Reenabled task raises previous exception on second invokation From 65be0c78c84510be26e4c6abc1a3d12301f583aa Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 19 Dec 2020 16:46:19 +0900 Subject: [PATCH 134/136] Bump version to 13.0.2 --- lib/rake/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake/version.rb b/lib/rake/version.rb index b5486ba79..5438d3cb6 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "13.0.1" + VERSION = "13.0.2" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "." From 37635e61ad2b663542216105ba23042f1e80683c Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Sun, 20 Dec 2020 16:30:11 +0900 Subject: [PATCH 135/136] Fix breaking change of execution order on TestTask Due to #357, execution order on Rake 13.0.2 changes from Rake 13.0.1. Example: ``` Rake::TestTask do |t| t.test_files = [ "test/a.rb", "test/b.rb", ] end ``` On 13.0.2, Rake executes test/b.rb before test/a.rb because test/a.rb are loaded before rake_test_loader.rb. rake_test_loader.rb executes the Ruby code in ARGV using Kernel.#require, but does not execute test/a.rb which is already loaded. In addition, Rake 13.0.1 allows specifying test_files without .rb but 13.0.2 doesn't allows. This commit also fixes this problem. ``` Rake::TestTask do |t| t.test_files = [ "test/setup", "test/a.rb", ] end ``` --- lib/rake/testtask.rb | 2 +- test/test_rake_test_task.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index 6150f2f6e..56521d23d 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -181,7 +181,7 @@ def run_code # :nodoc: when :testrb "-S testrb" when :rake - "-r#{__dir__}/rake_test_loader" + "#{__dir__}/rake_test_loader.rb" end end diff --git a/test/test_rake_test_task.rb b/test/test_rake_test_task.rb index 8f7d13f84..fdb844607 100644 --- a/test/test_rake_test_task.rb +++ b/test/test_rake_test_task.rb @@ -128,7 +128,7 @@ def test_run_code_rake t.loader = :rake end - assert_match(/\A-r.*?\Z/, test_task.run_code) + assert_includes test_task.run_code, "lib/rake/rake_test_loader.rb" ensure Gem.loaded_specs["rake"] = rake end From c2eeae2fe2b67170472a1441ebf84d3a238c3361 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 21 Dec 2020 11:12:05 +0900 Subject: [PATCH 136/136] Bump version to 13.0.3 --- History.rdoc | 7 ++++++- lib/rake/version.rb | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/History.rdoc b/History.rdoc index 0bd376a9d..99b863e1d 100644 --- a/History.rdoc +++ b/History.rdoc @@ -1,4 +1,9 @@ -=== 13.0.1 +=== 13.0.3 + +* Fix breaking change of execution order on TestTask. + Pull request #368 by ysakasin + +=== 13.0.2 ==== Enhancements diff --git a/lib/rake/version.rb b/lib/rake/version.rb index 5438d3cb6..3d4c5aec9 100644 --- a/lib/rake/version.rb +++ b/lib/rake/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Rake - VERSION = "13.0.2" + VERSION = "13.0.3" module Version # :nodoc: all MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "."