summaryrefslogtreecommitdiff
path: root/chef-config/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-12-31 23:37:21 -0500
committerTim Smith <tsmith84@gmail.com>2021-12-31 23:37:21 -0500
commit8856702f3f83570ac466dc016b3aba005f8b3949 (patch)
treef4309fbdfbef78e740aa7127634092f0ddfeb7fd /chef-config/lib
parentbb6116d12fbc75dbb3d1daa36b8413b1bc6638d1 (diff)
downloadchef-Style_SelectByRegexp.tar.gz
Resolve Style/SelectByRegexp warningsStyle_SelectByRegexp
Simplify how we collect or reject data based on regex matches Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'chef-config/lib')
-rw-r--r--chef-config/lib/chef-config/config.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb
index 3eb8c8475c..4700a687ee 100644
--- a/chef-config/lib/chef-config/config.rb
+++ b/chef-config/lib/chef-config/config.rb
@@ -1223,7 +1223,7 @@ module ChefConfig
"en.UTF-8"
else
# Will match en_ZZ.UTF-8, en_ZZ.utf-8, en_ZZ.UTF8, en_ZZ.utf8
- guesses = locales.select { |l| l =~ /^en_.*UTF-?8$/i }
+ guesses = locales.grep(/^en_.*UTF-?8$/i)
unless guesses.empty?
guessed_locale = guesses.first
# Transform into the form en_ZZ.UTF-8