1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib/readline.rb
Nobuyoshi Nakada e19b656409 [ruby/readline] Suppress constant redefinition warning
When already set by `use_lib_reline` in test/readline/helper.rb of
readline-ext.

https://github.com/ruby/readline/commit/0e3ca3b217
2021-11-29 18:50:27 +09:00

7 lines
189 B
Ruby

begin
require 'readline.so'
rescue LoadError
require 'reline' unless defined? Reline
Object.send(:remove_const, :Readline) if Object.const_defined?(:Readline)
Readline = Reline
end