From baf2ec2ca8127cd610a3681a1e84ebcb404fe8f2 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Wed, 13 Dec 2023 03:46:10 -0800 Subject: [rubygems/rubygems] Use match? when regexp match data is unused Improved performance / reduced allocations https://github.com/rubygems/rubygems/commit/b04726c9a7 --- lib/bundler/cli.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/bundler/cli.rb') diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index da5950917b..bf6e0fbec9 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -127,8 +127,8 @@ module Bundler if man_pages.include?(command) man_page = man_pages[command] - if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+} - Kernel.exec "man #{man_page}" + if Bundler.which("man") && !man_path.match?(%r{^file:/.+!/META-INF/jruby.home/.+}) + Kernel.exec("man", man_page) else puts File.read("#{man_path}/#{File.basename(man_page)}.ronn") end -- cgit v1.2.3