Skip to content

Refactor eval history - #623

Merged
tompng merged 3 commits into
masterfrom
refactor-eval-history
Jul 4, 2023
Merged

tompng merged 3 commits into
masterfrom
refactor-eval-history

Conversation

@st0012

@st0012 st0012 commented Jul 3, 2023

Copy link
Copy Markdown
Member

This feature was not enabled by default, not tested, and could be easily confused with IRB's history saving feature. So in this PR I did these improvements:

  • Rename the file and constant so it's clearer what it is for.
  • Add basic test cases for it.
    • I found that it only displays limit - 1 results, which is probably a bug. But since it's not widely used and we don't have any reports about it, I don't prioritise fixing it atm.

To confusion with `lib/irb/history.rb`
@st0012
st0012 requested a review from a team July 3, 2023 16:02
@st0012 st0012 self-assigned this Jul 3, 2023
@st0012
st0012 force-pushed the refactor-eval-history branch from e1ad483 to 4249ca6 Compare July 3, 2023 17:24

@tompng tompng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

could be easily confused with IRB's history saving feature

renaming 👍

@tompng
tompng merged commit f67b657 into master Jul 4, 2023
@tompng
tompng deleted the refactor-eval-history branch July 4, 2023 15:17
matzbot pushed a commit to ruby/ruby that referenced this pull request Jul 4, 2023
(ruby/irb#623)

* Rename `ext/history.rb` to `ext/eval_history.rb`

To confusion with `lib/irb/history.rb`

* Add eval_history tests

* Rename eval_history's History to EvalHistory to avoid confusion
mvz added a commit to cucumber/aruba that referenced this pull request Dec 24, 2023
See ruby/irb#623. The file was removed and the
corresponding feature should be activated by setting :EVAL_HISTORY.
znz added a commit to rurema/doctree that referenced this pull request Aug 3, 2026
#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants