From: shyouhei@... Date: 2017-03-31T06:03:21+00:00 Subject: [ruby-core:80508] [Ruby trunk Feature#13383] [PATCH] Module#source_location Issue #13383 has been updated by shyouhei (Shyouhei Urabe). Eregon (Benoit Daloze) wrote: > shyouhei (Shyouhei Urabe) wrote: > > In modern Ruby, prior to actually requiring a library, its gemspec tends to be loaded. From what I understand, people require foo/version.rb from foo.gemspec, and this is the first time when namespace foo is opened. > > > > Is this info that useful? > > I think that's only the case of the development gemspec in the repository. > If installed as a gem, the gemspec is a generated file from the metadata which does not require any other file. Great. I didn't know this. Thank you. > Example: > > ~~~ ruby > # -*- encoding: utf-8 -*- > # stub: concurrent-ruby 1.0.2 ruby lib > > Gem::Specification.new do |s| > s.name = "concurrent-ruby" > s.version = "1.0.2" > ~~~ > > I agree it would be more useful to be able to collect all source locations where a Module was opened. Yes, I'm not against such feature. ---------------------------------------- Feature #13383: [PATCH] Module#source_location https://bugs.ruby-lang.org/issues/13383#change-64009 * 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: