ruby-changes:70989
From: Postmodern <ko1@a...>
Date: Mon, 24 Jan 2022 07:00:52 +0900 (JST)
Subject: [ruby-changes:70989] c155445752 (master): [ruby/reline] Ignore global constants when checking if Fiddle::VERSION exists
https://git.ruby-lang.org/ruby.git/commit/?id=c155445752 From c155445752bdf51f048284519587f73443f2f227 Mon Sep 17 00:00:00 2001 From: Postmodern <postmodern.mod3@g...> Date: Fri, 21 Jan 2022 06:59:13 -0800 Subject: [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 --- lib/reline/terminfo.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reline/terminfo.rb b/lib/reline/terminfo.rb index fd8a312d785..f53642b919b 100644 --- a/lib/reline/terminfo.rb +++ b/lib/reline/terminfo.rb @@ -35,7 +35,7 @@ module Reline::Terminfo https://github.com/ruby/ruby/blob/trunk/lib/reline/terminfo.rb#L35 # 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 -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/