From 37856203a666f1bfdbc076d8c2628af335e470a7 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 7 Dec 2018 13:42:38 +0900 Subject: [PATCH] Use Regexp#=== to match loosely Till ruby 2.5, `Object#=~` silently ignored non-string argument, but it has been deprecated since ruby 2.6 and will be removed in the future. Use `Regexp#===` instead, to match loosely. Also `/^-/` is not a proper pattern to tell if the argument starts with a `-`. --- 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..9e64aa45a 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| /\A-/ === o }.map(&:downcase).sort.reverse } end private :sort_options