pry / pry-doc

Provide MRI Core documentation and source code for the Pry REPL
https://github.com/pry/pry-doc
Other
175 stars 26 forks source link

Doc and source for Kernel#is_a? aren't shown with pry-doc > 0.8.0 #131

Open dgutov opened 7 months ago

dgutov commented 7 months ago

I've been upgrading some gems on CI, and this difference sticks out (I have it in a spec):

Test scenario (inside irb repl):

gem 'pry-doc', '0.8.0'
gem 'pry', '0.10.0'
require 'pry'
pry
? Kernel#is_a? # => Returns true if if class is the class of ...
$ Kernel#is_a? # => ... VALUE\nrb_obj_is_kind_of ...
gem 'pry-doc', '0.9.0'
gem 'pry', '0.10.0'
require 'pry'
pry
? Kernel#is_a? # => Error: Cannot locate this method: is_a?. (source_location returns nil)
$ Kernel#is_a? # same 

You need to install some pretty old Ruby to try these versions. I tested both of the above with 2.2.0 and 1.9.3.

And all newer versions of pry-doc have this problem.

The same functionality stays working for Kernel#class and Kernel#method, so I'm not sure where to look. The code around rb_obj_is_kind_of's definition didn't change for decades.