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

Fix NoMethodError in backend #364

Merged
merged 1 commit into from
Jan 24, 2025
Merged

Fix NoMethodError in backend #364

merged 1 commit into from
Jan 24, 2025

Conversation

edsinclair
Copy link
Contributor

I didn't include any new tests as this existing test was failing when run with IRB >= 1.15.0

Error: test_eval_one_plus_two(IRubyTest::PlainBackendTest): NoMethodError: undefined method `build_statement' for an instance of IRB::Irb
/Users/eirik/github.com/edsinclair/iruby/lib/iruby/backend.rb:64:in `eval'
/Users/eirik/github.com/edsinclair/iruby/lib/iruby/backend.rb:16:in `eval'
/Users/eirik/github.com/edsinclair/iruby/test/iruby/backend_test.rb:8:in `test_eval_one_plus_two'
      5:     end
      6:
      7:     def test_eval_one_plus_two
  =>  8:       assert_equal 3, @plainbackend.eval('1+2', false)
      9:     end
     10:
     11:     def test_include_module
============================================================================================================================================================
F
============================================================================================================================================================
Failure: test_include_module(IRubyTest::PlainBackendTest):
  Exception raised:
  NoMethodError(<undefined method `build_statement' for an instance of IRB::Irb>)

- IRB v1.15.0 renamed build_statement -> parse_input
@edsinclair
Copy link
Contributor Author

This addresses the issue reported in #363

@sealocal
Copy link
Contributor

LGTM - would be nice to see the test suite pass aside from the Ruby 3.4 issue. Also, a release would be nice so that users can take advantage of these revisions without needing to install from master.

@irb.context.last_value unless IRuby.silent_assignment && assignment_expression?(code)
end

def parse_code(code)
Copy link
Contributor

Choose a reason for hiding this comment

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

This method could be moved down to the private methods.

@kojix2 kojix2 merged commit bb7f658 into SciRuby:master Jan 24, 2025
9 of 11 checks passed
@kojix2
Copy link
Member

kojix2 commented Jan 24, 2025

@edsinclair Thank you!

@sealocal
Hi! Are you interested in committing to IRuby?
If so, the current project owner is @mrkn, so he may be able to grant you commit access (I can't).

@sealocal
Copy link
Contributor

@sealocal Hi! Are you interested in committing to IRuby? If so, the current project owner is @mrkn, so he may be able to grant you commit access (I can't).

Sure, maybe I can help with triaging the backlog of issues.

@kojix2
Copy link
Member

kojix2 commented Jan 25, 2025

@sealocal
Thank you for helping with issue triaging. It’s much appreciated.

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.

3 participants