ruby-changes:61102
From: David <ko1@a...>
Date: Fri, 8 May 2020 14:14:12 +0900 (JST)
Subject: [ruby-changes:61102] de57d3895e (master): [rubygems/rubygems] Shortcuit method earlier
https://git.ruby-lang.org/ruby.git/commit/?id=de57d3895e From de57d3895ef6eb681c12a27720e7c185a22023d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Sat, 2 May 2020 12:22:42 +0200 Subject: [rubygems/rubygems] Shortcuit method earlier If the class variable is set, we can skip the whole thing from the beginning. Co-authored-by: MSP-Greg <MSP-Greg@u...> https://github.com/rubygems/rubygems/commit/83abf3a3d4 diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index cb212e9..343037e 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -706,6 +706,8 @@ class Gem::Installer https://github.com/ruby/ruby/blob/trunk/lib/rubygems/installer.rb#L706 end def check_that_user_bin_dir_is_in_path # :nodoc: + return if self.class.path_warning + user_bin_dir = @bin_dir || Gem.bindir(gem_home) user_bin_dir = user_bin_dir.gsub(File::SEPARATOR, File::ALT_SEPARATOR) if File::ALT_SEPARATOR @@ -720,10 +722,8 @@ class Gem::Installer https://github.com/ruby/ruby/blob/trunk/lib/rubygems/installer.rb#L722 unless path.include? user_bin_dir unless !Gem.win_platform? && (path.include? user_bin_dir.sub(ENV['HOME'], '~')) - unless self.class.path_warning - alert_warning "You don't have #{user_bin_dir} in your PATH,\n\t gem executables will not run." - self.class.path_warning = true - end + alert_warning "You don't have #{user_bin_dir} in your PATH,\n\t gem executables will not run." + self.class.path_warning = true end end end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/