diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-07 02:49:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-07 02:49:02 +0000 |
commit | 8ebdec34ae4d3bf300a065b2a4a936721e8c4a40 (patch) | |
tree | 46c9f8fc91d28d108254c64bbde3ed8e51de6990 /tool/rbinstall.rb | |
parent | a4fde3b60cc16672c69bdfd986e8655a08b39fa4 (diff) | |
download | ruby-8ebdec34ae4d3bf300a065b2a4a936721e8c4a40.tar.gz |
rbinstall.rb: umask hack
* tool/rbinstall.rb (Gem::Installer#install): moved umask hack.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-x | tool/rbinstall.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 9f42325364..1851f01f79 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -737,7 +737,12 @@ class Gem::Installer 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-gems') do 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 |