Repository navigation
Fallback to Reline when require 'readline' fails - #1076
Conversation
Require readline may fail because it is a bundled gem in 3.5.0.dev.
| const_set(:Readline, ::Readline) | ||
| rescue LoadError | ||
| const_set(:Readline, ::Reline) | ||
| end |
There was a problem hiding this comment.
Adds ReadlineInputMethod::Readline = ::Readline or ::Reline
because we don't want to pollute the top level by adding constant ::Readline when require 'readline' fails.
|
To use GNU readline, now we need to add both Maybe we can require |
|
Is there any feature that readline does better than reline? Does it make sense to still allow both types of input methods going forward 🤔 |
|
I didn't thought of that. Maybe it's time to use Reline also in (Off topic: |
#3408 の残タスク 2 件。 - lib/irb/ext/history.rb は Ruby 3.3.0 で ext/eval_history.rb に改名 (ruby/irb#623。3.2.9 まで旧名)。history.md に until: "3.3" を付け、 同内容の eval_history.md(since: "3.3")を新設して文書を引き継ぐ。 extend-command.md の require も版分岐(3.3 の実装は eval_history を 参照している) - IRB::ReadlineInputMethod の include ::Readline は irb 1.15.2 で廃止 (ruby/irb#1076。const_set 方式+readline 不在時は Reline に フォールバック)。Ruby 4.0.0 は irb 1.16.0 を bundled gem として 同梱するため 4.0 から乖離 → front matter の include を #%until 4.0 でゲートし、本文の「require 失敗時は定義されない」も版分岐 検証: 境界版(3.2/3.3/4.0)の DB で存否・require・include・ IRB::Context#eval_history の継続を機械確認・checklink 死リンクゼロ。 メソッド単位バッジはライブラリ無視で名前 union のため改名で途切れない。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Require readline may fail because it is a bundled gem in 3.5.0.dev.