From a453f26b0d47070c661baf7e302469cd8ab486ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 27 Apr 2020 22:58:35 +0200 Subject: [rubygems/rubygems] Extract a local variable https://github.com/rubygems/rubygems/commit/445c9da2ac --- lib/bundler/cli.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 3ef0e28f26..d0398c712d 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -130,10 +130,11 @@ module Bundler end] 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_pages[command]}" + Kernel.exec "man #{man_page}" else - puts File.read("#{man_path}/#{File.basename(man_pages[command])}.txt") + puts File.read("#{man_path}/#{File.basename(man_page)}.txt") end elsif command_path = Bundler.which("bundler-#{cli}") Kernel.exec(command_path, "--help") -- cgit v1.2.3