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

Require Reline 0.3.6 or higher #632

Merged
merged 2 commits into from
Jul 11, 2023

Conversation

ima1zumi
Copy link
Member

@ima1zumi ima1zumi commented Jul 8, 2023

Because "Multi-line multibyte regular expression raises exception" (#627) is fixed in Reline 0.3.6.

ref: ruby/reline#562

@ima1zumi ima1zumi requested a review from a team July 8, 2023 13:07
@ima1zumi ima1zumi added the dependencies Pull requests that update a dependency file label Jul 8, 2023
@st0012
Copy link
Member

st0012 commented Jul 8, 2023

With the new Reline requirement, I think we can also drop these conditions:

@ima1zumi
Copy link
Member Author

ima1zumi commented Jul 9, 2023

@st0012 Sorry, there was a change in input-method.rb and the lines are off. Could you tell me the line number again?

@st0012
Copy link
Member

st0012 commented Jul 9, 2023

They are 3 respond_to? that's associated with Reline. If you search for respond_to at input-method.rb, you will find 5 occurrences. And skip the first 2 that's on Readline, the rest are what I'm referring to.

"Multi-line multibyte regular expression raises exception" (ruby#627) is fixed in Reline 0.3.6.
@ima1zumi ima1zumi force-pushed the require-reline-0.3.6-or-higher branch from 111460f to fa2998a Compare July 11, 2023 12:04
@ima1zumi
Copy link
Member Author

Thank you! I removed it.

Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

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

👍

@st0012 st0012 merged commit 241022d into ruby:master Jul 11, 2023
24 checks passed
matzbot pushed a commit to ruby/ruby that referenced this pull request Jul 11, 2023
(ruby/irb#632)

* Require Reline 0.3.6 or higher

"Multi-line multibyte regular expression raises exception" (ruby/irb#627) is fixed in Reline 0.3.6.

* Remove unnecessary conditional
@ima1zumi ima1zumi deleted the require-reline-0.3.6-or-higher branch July 11, 2023 16:09
@@ -398,7 +396,7 @@ def auto_indent(&block)
mod_key = RUBY_PLATFORM.match?(/darwin/) ? "Option" : "Alt"
message = "Press #{mod_key}+d to read the full document"
contents = [message] + doc.accept(formatter).split("\n")
contents = contents.take(Reline.preferred_dialog_height) if Reline.respond_to?(:preferred_dialog_height)

Choose a reason for hiding this comment

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

I believe the removal of this check has broken IRB's autocomplete for me. I'm getting an error saying undefined method preferred_dialog_height' for Reline:Module`.

~/Code/springboard $ irb
irb(main):001:0> select/Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb/input-method.rb:399:in `block in <class:RelineInputMethod>': undefined method `preferred_dialog_height' for Reline:Module (NoMethodError)
                 select                    █
      contents = contents.take(Reline.preferred_dialog_height)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline/line_editor.rb:588:in `instance_exec'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline/line_editor.rb:588:in `call'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline/line_editor.rb:623:in `call'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline/line_editor.rb:776:in `update_each_dialog'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline/line_editor.rb:652:in `block in render_dialog'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline/line_editor.rb:650:in `map'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline/line_editor.rb:650:in `render_dialog'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline/line_editor.rb:500:in `rerender'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline.rb:356:in `block (3 levels) in inner_readline'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline.rb:354:in `each'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline.rb:354:in `block (2 levels) in inner_readline'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline.rb:429:in `block in read_io'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline.rb:399:in `loop'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline.rb:399:in `read_io'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline.rb:352:in `block in inner_readline'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline.rb:350:in `loop'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline.rb:350:in `inner_readline'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline.rb:278:in `block in readmultiline'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline/ansi.rb:149:in `block in with_raw_input'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline/ansi.rb:149:in `raw'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline/ansi.rb:149:in `with_raw_input'
	from /Users/brianmcgue/.gem/gems/reline-0.3.6/lib/reline.rb:274:in `readmultiline'
	from /Users/brianmcgue/.rbenv/versions/3.2.0/lib/ruby/3.2.0/forwardable.rb:240:in `readmultiline'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb/input-method.rb:413:in `gets'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb.rb:540:in `block (2 levels) in eval_input'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb.rb:764:in `signal_status'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb.rb:539:in `block in eval_input'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb/ruby-lex.rb:220:in `readmultiline'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb/ruby-lex.rb:246:in `block in each_top_level_statement'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb/ruby-lex.rb:245:in `loop'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb/ruby-lex.rb:245:in `each_top_level_statement'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb.rb:558:in `eval_input'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb.rb:494:in `block in run'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb.rb:493:in `catch'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb.rb:493:in `run'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/lib/irb.rb:416:in `start'
	from /Users/brianmcgue/.gem/gems/irb-1.7.2/exe/irb:9:in `<top (required)>'
	from /Users/brianmcgue/.gem/bin/irb:25:in `load'
	from /Users/brianmcgue/.gem/bin/irb:25:in `<main>'

This is confirmed if I reopen IRB:

irb(main):001:0> Reline.respond_to?(:preferred_dialog_height)
=> false

My apologies if this isn't the way correct manner to bring up issues. Would you like me to create an issue in the repo?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the trouble, the issue has been addressed in #638

Choose a reason for hiding this comment

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

Sorry, I should have checked the issues first!

Copy link
Member

Choose a reason for hiding this comment

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

No worries. Thanks for raising the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Development

Successfully merging this pull request may close these issues.

3 participants