IRB with completion

K

Kent S

IRB process dies when doing code completion in these cases:

1)
$ irb -r irb/completion
irb(main):001:0> class Test
irb(main):002:1> undef :methods
irb(main):003:1> end
=> nil
irb(main):004:0> t = Test.new
=> #<Test:0x32afe4>
irb(main):005:0> t./usr/local/lib/ruby/1.9/irb/completion.rb:129:in
`eval': undefined method `methods' for #<Test:0x32afe4> (NoMethodError)
from /usr/local/lib/ruby/1.9/irb/workspace.rb:52:in `irb_binding'
from /usr/local/lib/ruby/1.9/irb/workspace.rb:52

2)
$ irb -r irb/completion
irb(main):001:0> class Test
irb(main):002:1> def methods
irb(main):003:2> :blah
irb(main):004:2> end
irb(main):005:1> end
=> nil
irb(main):006:0> t = Test.new
=> #<Test:0x328f28>
irb(main):007:0> t./usr/local/lib/ruby/1.9/irb/completion.rb:171:in
`select_message': undefined method `grep' for :blah:Symbol (NoMethodError)
from /usr/local/lib/ruby/1.9/irb/completion.rb:148
from /usr/local/lib/ruby/1.9/irb/completion.rb:37:in `call'
from /usr/local/lib/ruby/1.9/irb/input-method.rb:134:in `readline'
from /usr/local/lib/ruby/1.9/irb/input-method.rb:134:in `gets'
from /usr/local/lib/ruby/1.9/irb.rb:130:in `eval_input'
from /usr/local/lib/ruby/1.9/irb.rb:129:in `signal_status'
from /usr/local/lib/ruby/1.9/irb.rb:129:in `eval_input'
from /usr/local/lib/ruby/1.9/irb.rb:128:in `call'
... 12 levels...
from /usr/local/lib/ruby/1.9/irb.rb:70:in `start'
from /usr/local/lib/ruby/1.9/irb.rb:69:in `catch'
from /usr/local/lib/ruby/1.9/irb.rb:69:in `start'
from /usr/local/bin/irb:13

I think IRB::InputCompletor::CompletionProc should digest these
exceptional cases and warn user about possible problem.

/kent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top