From 3d5a5be09038c160fa6ec9c3186a5c8a24d7d8d8 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Thu, 27 Dec 2018 01:02:23 +1100 Subject: [PATCH 01/18] 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 02/18] 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 03/18] 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 04/18] 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 05/18] 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 06/18] 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 07/18] 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 08/18] 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 09/18] 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 10/18] 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 11/18] 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 12/18] 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 13/18] 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 14/18] 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 15/18] Remove deprecated travis ci option --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eb197f74e..b0bf3ebe3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: ruby -sudo: false rvm: - 2.0.0 - 2.1.10 From be62efb6cdfc2cc00d660f8fc7d6c1c9de8014e2 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 15 May 2019 09:14:08 +0900 Subject: [PATCH 16/18] 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 17/18] 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 18/18] 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 "."