Issue #13383 has been updated by sawa (Tsuyoshi Sawada).


We now have `Module#const_source_location` #10771, which tells us when the module was named as a constant (which is usually the same as when the module was created). If that fulfills the purpose of this issue, then this issue should be closed as duplicate.

If you mean by "open a module" to use the `module Foo; ... end` construction, then notice that a module can be modified without being opened in that sense. For example,

```ruby
module Foo; end
...
Foo.define_method(:bar){}
```

Hence it might make sense and be useful to ask for a feature that tells us all locations where a module was modified rather than where a module was opened.

I am not particularly for or against such feature.

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

* Author: koba789 (Hidekazu Kobayashi)
* Status: Open
* Priority: Normal
* Assignee: ioquatix (Samuel Williams)
* 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>