diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-09-16 15:14:34 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-09-16 15:32:58 -0700 |
commit | 1ce3174538126c8e3642bf005382f1ee396b5542 (patch) | |
tree | 91cea9acb1701d971c14a92f50b17be569222b76 /chef-bin/Rakefile | |
parent | 40c71d4e8702894600276f11ce615a9d6334496b (diff) | |
download | chef-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/Rakefile | 2 |
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}" |