summaryrefslogtreecommitdiff
path: root/chef-bin/Rakefile
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-09-16 15:14:34 -0700
committerTim Smith <tsmith84@gmail.com>2020-09-16 15:32:58 -0700
commit1ce3174538126c8e3642bf005382f1ee396b5542 (patch)
tree91cea9acb1701d971c14a92f50b17be569222b76 /chef-bin/Rakefile
parent40c71d4e8702894600276f11ce615a9d6334496b (diff)
downloadchef-1ce3174538126c8e3642bf005382f1ee396b5542.tar.gz
Resolve Style/RedundantSort warnings
Avoid a sort then last and just grab the max. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'chef-bin/Rakefile')
-rw-r--r--chef-bin/Rakefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/chef-bin/Rakefile b/chef-bin/Rakefile
index 5e5c9bbf5f..7fe4f1e9d4 100644
--- a/chef-bin/Rakefile
+++ b/chef-bin/Rakefile
@@ -10,7 +10,7 @@ Bundler::GemHelper.install_tasks
desc "force install the chef-bin gem"
task "install:force" do
sh "gem build -V chef-bin.gemspec"
- built_gem_path = Dir["chef-bin-*.gem"].sort_by { |f| File.mtime(f) }.last
+ built_gem_path = Dir["chef-bin-*.gem"].max_by { |f| File.mtime(f) }
FileUtils.mkdir_p("pkg") unless Dir.exist?("pkg")
FileUtils.mv(built_gem_path, "pkg")
sh "gem install -f pkg/#{built_gem_path}"