mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] Ignore global constants when checking if Fiddle::VERSION exists
If a top-level `VERSION` constant exists, or if a module containing a `VERSION` constant is included into the top-level scope, then `Fiddle.const_defined?(:VERSION)` will erroneously return true when `RUBY_VERSION < 3.0.0`.
8529c8e47a
This commit is contained in:
parent
bb955096d8
commit
c155445752
1 changed files with 1 additions and 1 deletions
|
@ -35,7 +35,7 @@ module Reline::Terminfo
|
|||
# Gem module isn't defined in test-all of the Ruby repository, and
|
||||
# Fiddle in Ruby 3.0.0 or later supports Fiddle::TYPE_VARIADIC.
|
||||
fiddle_supports_variadic = true
|
||||
elsif Fiddle.const_defined?(:VERSION) and Gem::Version.create(Fiddle::VERSION) >= Gem::Version.create('1.0.1')
|
||||
elsif Fiddle.const_defined?(:VERSION,false) and Gem::Version.create(Fiddle::VERSION) >= Gem::Version.create('1.0.1')
|
||||
# Fiddle::TYPE_VARIADIC is supported from Fiddle 1.0.1.
|
||||
fiddle_supports_variadic = true
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue