瀏覽代碼

Avoid JRuby warning during rehash Rubygems plugin

As it seems, JRuby 1.7 complains on stderr every time you invoke `system`:

    warning: executable? does not in this environment and will return a dummy value

It doesn't seem to complain when backtics are used. It's safe to use
backticks here because `rbenv rehash` doesn't output anything on stdout,
and the exit status of the command is irrelevant.
pull/360/head^2
Mislav Marohnić 10 年之前
父節點
當前提交
7e0e85bdda
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      rbenv.d/exec/gem-rehash/rubygems_plugin.rb

+ 1
- 1
rbenv.d/exec/gem-rehash/rubygems_plugin.rb 查看文件

@ -3,7 +3,7 @@ hook = lambda do |installer|
# Ignore gems that aren't installed in locations that rbenv searches for binstubs
if installer.spec.executables.any? &&
[Gem.default_bindir, Gem.bindir(Gem.user_dir)].include?(installer.bin_dir)
system "rbenv", "rehash"
`rbenv rehash`
end
rescue
warn "rbenv: error in gem-rehash (#{$!})"

Loading…
取消
儲存