Silence LoadError only if it is for `rubygems` itself

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
This commit is contained in:
Daniel Niknam 2021-08-08 23:15:40 +10:00 коммит произвёл Hiroshi SHIBATA
Родитель d668cd188c
Коммит 0b7969b6a3
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -1,6 +1,8 @@
begin begin
require 'rubygems' require 'rubygems'
rescue LoadError rescue LoadError => e
raise unless e.path == 'rubygems'
warn "`RubyGems' were not loaded." warn "`RubyGems' were not loaded."
end if defined?(Gem) end if defined?(Gem)