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

Ruby 3 compat #306

Merged
merged 2 commits into from
Jan 5, 2021
Merged

Ruby 3 compat #306

merged 2 commits into from
Jan 5, 2021

Conversation

voxik
Copy link

@voxik voxik commented Dec 22, 2020

This should fix #301.

I have split the PR into two commits. I think the first is essential while the second is NTH.

Also note that there are already similar Ruby 2.6+ condition:

if RUBY_VERSION >= "2.6"

therefore maybe RUBY_VERSION should be used instead of respond_to?

Ruby 3.0 changes behavior of `binding.eval` [[1]] resulting in test
failure:

~~~
WebConsole::EvaluatorTest#test_Evaluator_callers_are_cleaned_up_of_unneeded_backtraces [/home/travis/build/rails/web-console/test/web_console/evaluator_test.rb:63]:
--- expected
+++ actual
@@ -1,3 +1,3 @@
 "RuntimeError: oops
-\tfrom /home/travis/build/rails/web-console/test/web_console/evaluator_test.rb:61:in `block in <class:EvaluatorTest>'
+\tfrom (eval):1:in `block in <class:EvaluatorTest>'
~~~

Fixes rails#301

[1]: https://bugs.ruby-lang.org/issues/17419
This is not really necessary ATM, but should the condition introduced by
1a2a9f8 be removed one day, it will be needed anyway.
@gsamokovarov
Copy link
Collaborator

Thank you!

@gsamokovarov gsamokovarov merged commit 5345813 into rails:master Jan 5, 2021
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.

WebConsole::EvaluatorTest#test_Evaluator_callers_are_cleaned_up_of_unneeded_backtraces test failure
2 participants