Issue #13383 has been updated by shevegen (Robert A. Heiler).


I am also for this if it is easily possible.

I remember many years ago in the ruby 1.8.x days, before pry, 
I twiddled and played with the programming language Io.

I do not remember much about it, but one argument that it
said in its favour (aside from being small/lightweight) 
was that it allowed introspection at run-time of pretty
much everything. (I do not remember if this was correct
or perhaps I may misremember.)

Since that, ruby got a lot more introspection support,
pry, also .source_location and being able to pull in 
the method body and method comments (I think one of the
gems of pry does that).

I always found this awesome.

Anyway to come back to the suggestion by Hidekazu Kobayashi,
I agree. It would be nice to have full introspection of
everything in ruby at run-time. We got a lot more access
to all these various things these day, with the RubyVM and
objectspace showing memory even of a "namespace" like:

Like in my irb:

  require 'objspace'; ObjectSpace.memsize_of([])     # => 20
  require 'objspace'; ObjectSpace.memsize_of(Kernel) # => 2340
  require 'objspace'; ObjectSpace.memsize_of(Object) # => 6484

I think that all of this is very cool. :)

----------------------------------------
Feature #13383: [PATCH] Module#source_location
https://bugs.ruby-lang.org/issues/13383#change-64218

* Author: koba789 (Hidekazu Kobayashi)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
# Abstract

It can inspect where the module or class is defined.

# Background

In debugging or development an application, I usually want to find out where the class definition of using library.
There is Method#source_location but I could not find **Class** easily.

# Implementation

In Github: https://github.com/ruby/ruby/pull/1562




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>