diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-05-02 09:08:12 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-05-09 12:57:12 +0900 |
commit | 59fd67fc3d405e529e038172e769ff20a8fb5535 (patch) | |
tree | 5d49172c077ff9c9c2866b34753b49c5787a7d01 /test/readline/helper.rb | |
parent | 5831f7c83177d6214aee1165df694bb4d4ae8ec6 (diff) |
Extract ext/readline
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7781
Diffstat (limited to 'test/readline/helper.rb')
-rw-r--r-- | test/readline/helper.rb | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/test/readline/helper.rb b/test/readline/helper.rb deleted file mode 100644 index 72c913a860..0000000000 --- a/test/readline/helper.rb +++ /dev/null @@ -1,35 +0,0 @@ -begin - # for standalone test suite on ruby/logger - require_relative '../lib/envutil' -rescue LoadError -end - -begin - require "readline.so" - ReadlineSo = Readline -rescue LoadError -end - -def use_ext_readline # Use ext/readline as Readline - Object.send(:remove_const, :Readline) if Object.const_defined?(:Readline) - Object.const_set(:Readline, ReadlineSo) -end - -begin - require "reline" -rescue LoadError - Object.class_eval {remove_const :Reline} if defined?(Reline) -else - def use_lib_reline # Use lib/reline as Readline - Reline.send(:remove_const, 'IOGate') if Reline.const_defined?('IOGate') - Reline.const_set('IOGate', Reline::GeneralIO) - Reline.send(:core).config.instance_variable_set(:@test_mode, true) - Reline.send(:core).config.reset - Object.send(:remove_const, :Readline) if Object.const_defined?(:Readline) - Object.const_set(:Readline, Reline) - end - - def finish_using_lib_reline - Reline.instance_variable_set(:@core, nil) - end -end |