mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Completion fix for Jruby.
Jruby doesn't always provide the method `#instance_methods()` on objects. By checking to see if this method exists before using it the completion system won't totally barf itself when used on Jruby. Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
This commit is contained in:
parent
d53eb0921d
commit
d3f1abbe37
1 changed files with 6 additions and 1 deletions
|
@ -163,7 +163,12 @@ class Pry
|
|||
end
|
||||
next if name != "IRB::Context" and
|
||||
/^(IRB|SLex|RubyLex|RubyToken)/ =~ name
|
||||
candidates.concat m.instance_methods(false).collect{|x| x.to_s}
|
||||
|
||||
# jruby doesn't always provide #instance_methods() on each
|
||||
# object.
|
||||
if m.respond_to?(:instance_methods)
|
||||
candidates.concat m.instance_methods(false).collect{|x| x.to_s}
|
||||
end
|
||||
}
|
||||
candidates.sort!
|
||||
candidates.uniq!
|
||||
|
|
Loading…
Reference in a new issue