irb icon indicating copy to clipboard operation
irb copied to clipboard

Support C-method source in `show_source` command

Open st0012 opened this issue 2 years ago • 4 comments

The main challenge of this support comes from acquiring the C-method source files:

  • Unless users install Ruby with ruby-install or ruby-build -k, Ruby's C source code wouldn't be preserved after Ruby is built
  • Between ruby-install and ruby-build -k, the location of sources are different:
    • ruby-install: ~/src or /usr/local/src for the root user
    • ruby-build -k: ~/.cache
  • Pry uses pry-doc to serve as an installable source database

So instead of relying on the installed CRuby source, downloading the source later may be a better approach (proposed by @k0kubun).

Questions:

  • Should it be rdoc, irb, or another tool's responsibility to perform this action?
  • Should it install multiple Ruby versions' sources, or just 1?
    • I prefer the former, like downloading all actively maintained Ruby versions at once
  • TBD

st0012 avatar Aug 02 '23 21:08 st0012