未验证 提交 8cbfdf4b 编写于 作者: T Trevor Brown 提交者: GitHub

Merge pull request #162 from djmarcin/master

Fix auto-reshim on bundle install and gem uninstall.
# Yes borrowed from rbenv. Couldn't take my mind off that implementation
Gem.post_install do |installer|
module ReshimInstaller
def install(options)
super
# We don't know which gems were installed, so always reshim.
`asdf reshim ruby`
end
end
if installer.spec.executables.any? && installer.bin_dir == Gem.default_bindir
if defined?(Bundler::Installer)
Bundler::Installer.prepend ReshimInstaller
else
Gem.post_install do |installer|
# Reshim any (potentially) new executables.
installer.spec.executables.each do |executable|
`asdf reshim ruby #{RUBY_VERSION} bin/#{executable}`
`asdf reshim ruby #{RUBY_VERSION} bin/#{executable}`
end
end
Gem.post_uninstall do |installer|
# Unfortunately, reshimming just the removed executables or
# ruby version doesn't work as of 2020/04/23.
`asdf reshim ruby` if installer.spec.executables.any?
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册