diff options
author | Postmodern <[email protected]> | 2022-01-21 06:59:13 -0800 |
---|---|---|
committer | git <[email protected]> | 2022-01-24 07:00:34 +0900 |
commit | c155445752bdf51f048284519587f73443f2f227 (patch) | |
tree | c4f48cf3aa64343cb54e0f9b1c27e5f17a91183c | |
parent | bb955096d86939a4b7f0d819590afb0ec588f3bd (diff) |
[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`.
https://github.com/ruby/reline/commit/8529c8e47a
-rw-r--r-- | lib/reline/terminfo.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/reline/terminfo.rb b/lib/reline/terminfo.rb index fd8a312d78..f53642b919 100644 --- a/lib/reline/terminfo.rb +++ b/lib/reline/terminfo.rb @@ -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 |