[ruby/reline] Check existance of a constant, Fiddle::VERSION

https://github.com/ruby/reline/commit/4b74c3d83a
This commit is contained in:
aycabta 2021-05-20 19:40:09 +09:00
Родитель 18b79b4c49
Коммит 582b5705ab
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -9,7 +9,7 @@ module Reline::Terminfo
@curses_dl = nil
def self.curses_dl
return @curses_dl if @curses_dl
if Gem::Version.create(Fiddle::VERSION) >= Gem::Version.create('1.0.1')
if Fiddle.const_defined?(:VERSION) and Gem::Version.create(Fiddle::VERSION) >= Gem::Version.create('1.0.1')
# Fiddle::TYPE_VARIADIC is supported from Fiddle 1.0.1.
%w[libncursesw.so libcursesw.so libncurses.so libcurses.so].each do |curses_name|
result = Fiddle::Handle.new(curses_name)