ruby-changes:45480
From: nobu <ko1@a...>
Date: Tue, 7 Feb 2017 11:49:08 +0900 (JST)
Subject: [ruby-changes:45480] nobu:r57552 (trunk): rbinstall.rb: umask hack
nobu 2017-02-07 11:49:02 +0900 (Tue, 07 Feb 2017) New Revision: 57552 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57552 Log: rbinstall.rb: umask hack * tool/rbinstall.rb (Gem::Installer#install): moved umask hack. Modified files: trunk/tool/rbinstall.rb Index: tool/rbinstall.rb =================================================================== --- tool/rbinstall.rb (revision 57551) +++ tool/rbinstall.rb (revision 57552) @@ -737,7 +737,12 @@ class Gem::Installer https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L737 install = instance_method(:install) define_method(:install) do spec.post_install_message = nil - install.bind(self).call + begin + u = File.umask(0022) + install.bind(self).call + ensure + File.umask(u) + end end generate_bin_script = instance_method(:generate_bin_script) @@ -845,14 +850,7 @@ install?(:ext, :comm, :gem, :'bundle-gem https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L850 inst = Gem::Installer.new(gem, options) inst.spec.extension_dir = with_destdir(inst.spec.extension_dir) begin - Gem::DefaultUserInteraction.use_ui(silent) do - begin - File.umask(022) - inst.install - ensure - File.umask(0222) - end - end + Gem::DefaultUserInteraction.use_ui(silent) {inst.install} rescue Gem::InstallError => e next end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/