-
Notifications
You must be signed in to change notification settings - Fork 31
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
restore support for IRB <= v1.13.0 #358
Conversation
Hello! def initialize
# ommited
@completor = defined?(IRB::RegexpCompletor) ? IRB::RegexpCompletor.new : nil
end
def complete(code)
if @completor
@completor.completion_candidates('', code, '', bind: @workspace.binding)
else
IRB::InputCompletor::CompletionProc.call(code)
end
end Wouldn't this be better? Note: I don't have any professional Ruby/Rails development experience, so I'm not necessarily familiar with the best practices for Ruby web development. |
lib/iruby/backend.rb
Outdated
# preposing and postposing never used, so they are empty, pass only target as code | ||
@completor.completion_candidates('', code, '', bind: @workspace.binding) | ||
if defined? IRB::RegexpCompletor # IRB::VERSION >= 1.8.2 | ||
completor = IRB::RegexpCompletor.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that an instance of IRB::RegexpCompletor is created each time. This seems inefficient, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, agree! Added e07b7eb
5efff04
to
e07b7eb
Compare
Ah, agree - that was an oversight and changes more than I intended. I've restored the attribute! |
Thank you. Please send another pull request if you find anything else. |
#339 dropped support of IRB older than v1.13.0, which introduced #351
This change restores support for all versions of the
irb
gemIRB 1.6.3