[#67346] Future of test suites for Ruby — Charles Oliver Nutter <headius@...>

I'll try to be brief so we can discuss all this. tl;dr: RubySpec is

19 messages 2015/01/05

[ruby-core:67745] [ruby-trunk - Feature #10771] [Open] An easy way to get the source location of a constant

From: sawadatsuyoshi@...
Date: 2015-01-22 05:50:18 UTC
List: ruby-core #67745
Issue #10771 has been reported by Tsuyoshi Sawada.

----------------------------------------
Feature #10771: An easy way to get the source location of a constant
https://bugs.ruby-lang.org/issues/10771

* Author: Tsuyoshi Sawada
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
For constants, it is difficult to get the source location where it was (last) defined. I request either of the following to be implemented:

* Tracepoint emits a signal when a constant is defined.
* Implement a `Constant` class (similar to `Method` class) and a `constant` method (similar to `method` method) that behave as follows:

        foo1.rb
        1| module Foo
        2|   Bar = :bar
        3| end
        4| Foo.constant(:Bar) #=> #<Constant: Foo#Bar>
        5| Foo.constant(:Bar).source_location #=> ["foo1.rb", 2]

* Implement `Module#constant_source_location`

        foo2.rb
        1| module Foo
        2|   Bar = :bar
        3| end
        4| Foo.constant_source_location(:Bar) #=> ["foo2.rb", 2]






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

In This Thread

Prev Next