Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass statements to Context#evaluate #920

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Pass statements to Context#evaluate #920

merged 1 commit into from
Apr 12, 2024

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Apr 11, 2024

This has a few benefits:

In addition to the refactor, I also converted some context-level evaluation tests into integration tests, which are more robust and easier to maintain.

This has a few benefits:

- We can keep hiding the evaluation logic inside the Context level, which
  has always been the convention until #824 was merged recently.
- Although not an official API, gems like `debug` and `mission_control-jobs`
  patch `Context#evaluate` to wrap their own logic around it. This implicit
  contract was broken after #824, and this change restores it.

In addition to the refactor, I also converted some context-level evaluation
tests into integration tests, which are more robust and easier to maintain.
# We also need to have a way to restart/stop threads around command execution
# when being used as `debug`'s console.
# https://github.com/ruby/debug/blob/master/lib/debug/irb_integration.rb#L8-L13
puts "INTERNAL_INFO: {}" if @context.with_debugger && ENV['RUBY_DEBUG_TEST_UI'] == 'terminal'
Copy link
Member Author

Choose a reason for hiding this comment

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

We won't need this workaround with this change because the current debug patch will be applied to command execution too.

@st0012 st0012 requested a review from tompng April 11, 2024 19:17
@st0012 st0012 self-assigned this Apr 11, 2024
@tompng tompng merged commit b32aee4 into master Apr 12, 2024
57 checks passed
@tompng tompng deleted the refactor-evaluation branch April 12, 2024 12:00
matzbot pushed a commit to ruby/ruby that referenced this pull request Apr 12, 2024
(ruby/irb#920)

This has a few benefits:

- We can keep hiding the evaluation logic inside the Context level, which
  has always been the convention until #824 was merged recently.
- Although not an official API, gems like `debug` and `mission_control-jobs`
  patch `Context#evaluate` to wrap their own logic around it. This implicit
  contract was broken after #824, and this change restores it.

In addition to the refactor, I also converted some context-level evaluation
tests into integration tests, which are more robust and easier to maintain.

ruby/irb@b32aee4068
artur-intech pushed a commit to artur-intech/ruby that referenced this pull request Apr 26, 2024
(ruby/irb#920)

This has a few benefits:

- We can keep hiding the evaluation logic inside the Context level, which
  has always been the convention until ruby#824 was merged recently.
- Although not an official API, gems like `debug` and `mission_control-jobs`
  patch `Context#evaluate` to wrap their own logic around it. This implicit
  contract was broken after ruby#824, and this change restores it.

In addition to the refactor, I also converted some context-level evaluation
tests into integration tests, which are more robust and easier to maintain.

ruby/irb@b32aee4068
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants