ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:119320] [Ruby master Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
@ 2024-09-27 15:06 ` Eregon (Benoit Daloze) via ruby-core
  2024-09-27 15:21 ` [ruby-core:119322] " Eregon (Benoit Daloze) via ruby-core
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2024-09-27 15:06 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #6012 has been updated by Eregon (Benoit Daloze).


It seems good to revisit this, the workarounds are pretty messy and CRuby-specific, e.g. https://github.com/rails/rails/pull/53055/files

I think @mame 's suggestion in https://bugs.ruby-lang.org/issues/6012#note-12 is fine although I think it would be convenient to also expose the byte offsets (start and end):
`.source_location #=> [path, start_line, start_column, start_offset, end_line, end_column, end_offset]`

Then it would be really easy to "get the source code of a Proc".
And of course we should do the same for Method/UnboundMethod (#8751).

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-109934

* Author: rogerdpack (Roger Pack)
* Status: Assigned
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:119322] [Ruby master Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
  2024-09-27 15:06 ` [ruby-core:119320] [Ruby master Feature#6012] Proc#source_location also return the column Eregon (Benoit Daloze) via ruby-core
@ 2024-09-27 15:21 ` Eregon (Benoit Daloze) via ruby-core
  2025-01-05 14:05 ` [ruby-core:120485] " Eregon (Benoit Daloze) via ruby-core
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2024-09-27 15:21 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #6012 has been updated by Eregon (Benoit Daloze).


I also really like @ioquatix 's suggestion in https://bugs.ruby-lang.org/issues/6012#note-13 and it is a lot more flexible and more efficient too (since computing e.g. column information if unused is not cheap).
For instance `method.source.code` is great because it completely hides the details how to get the source code and slice it.
TruffleRuby currently keeps the source code in memory and so could provide this automatically without needing to reread the file from disk.
CRuby keeps it but only if `RubyVM.keep_script_lines = true`, so then could use that if available and automatically fallback to read the file from disk (great, because we should avoid users/gems referring to `RubyVM` in their code).

One question is where would we place/how would we name this class?
We could reuse `Thread::Backtrace::Location` as it's quite similar and already has `path`, `lineno`.
But it's not really related to a backtrace here.
Still it seems quite a good fit, and I don't have much idea where to place it otherwise (top-level `Source` seems way too prone for conflicts).

I think in term of the interface we should have:
* start_line
* start_column
* start_offset
* end_line
* end_column
* end_offset
* code: gets the source of the Proc/Method/UnboundMethod

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-109936

* Author: rogerdpack (Roger Pack)
* Status: Assigned
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:120485] [Ruby master Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
  2024-09-27 15:06 ` [ruby-core:119320] [Ruby master Feature#6012] Proc#source_location also return the column Eregon (Benoit Daloze) via ruby-core
  2024-09-27 15:21 ` [ruby-core:119322] " Eregon (Benoit Daloze) via ruby-core
@ 2025-01-05 14:05 ` Eregon (Benoit Daloze) via ruby-core
  2025-01-05 21:06 ` [ruby-core:120489] " bkuhlmann (Brooke Kuhlmann) via ruby-core
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2025-01-05 14:05 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #6012 has been updated by Eregon (Benoit Daloze).


One idea for this new SourceLocation/CodeLocation class would be under the new `Ruby` module, see https://bugs.ruby-lang.org/issues/20884#note-3

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-111269

* Author: rogerdpack (Roger Pack)
* Status: Assigned
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:120489] [Ruby master Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2025-01-05 14:05 ` [ruby-core:120485] " Eregon (Benoit Daloze) via ruby-core
@ 2025-01-05 21:06 ` bkuhlmann (Brooke Kuhlmann) via ruby-core
  2025-01-09 11:26 ` [ruby-core:120566] " nobu (Nobuyoshi Nakada) via ruby-core
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: bkuhlmann (Brooke Kuhlmann) via ruby-core @ 2025-01-05 21:06 UTC (permalink / raw)
  To: ruby-core; +Cc: bkuhlmann (Brooke Kuhlmann)

Issue #6012 has been updated by bkuhlmann (Brooke Kuhlmann).


💡 Please see [Feature 21005](https://bugs.ruby-lang.org/issues/21005) as an evolution of this discussion based on feedback I've had with Kevin Newton and Benoit Daloze. Thanks.

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-111272

* Author: rogerdpack (Roger Pack)
* Status: Assigned
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:120566] [Ruby master Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2025-01-05 21:06 ` [ruby-core:120489] " bkuhlmann (Brooke Kuhlmann) via ruby-core
@ 2025-01-09 11:26 ` nobu (Nobuyoshi Nakada) via ruby-core
  2025-01-09 11:51 ` [ruby-core:120572] " mame (Yusuke Endoh) via ruby-core
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: nobu (Nobuyoshi Nakada) via ruby-core @ 2025-01-09 11:26 UTC (permalink / raw)
  To: ruby-core; +Cc: nobu (Nobuyoshi Nakada)

Issue #6012 has been updated by nobu (Nobuyoshi Nakada).


I'm not sure about attributes and `Binding#source_location`.

https://github.com/ruby/ruby/pull/12539

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-111390

* Author: rogerdpack (Roger Pack)
* Status: Assigned
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:120572] [Ruby master Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2025-01-09 11:26 ` [ruby-core:120566] " nobu (Nobuyoshi Nakada) via ruby-core
@ 2025-01-09 11:51 ` mame (Yusuke Endoh) via ruby-core
  2025-01-09 14:31 ` [ruby-core:120576] " Eregon (Benoit Daloze) via ruby-core
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2025-01-09 11:51 UTC (permalink / raw)
  To: ruby-core; +Cc: mame (Yusuke Endoh)

Issue #6012 has been updated by mame (Yusuke Endoh).


This was discussed at the October 2024 dev meeting and @matz approved `source_location` to return `[path, start_line, start_column, end_line, end_column]`.

https://github.com/ruby/dev-meeting-log/blob/28e0f45f334b31e60c7e07d25b6b6cb3655b2c75/2024/DevMeeting-2024-10-03.md?plain=1#L176

Matz was negative neither on adding a new class like Ruby::CodeLocation for this purpose, or adding offset information.

We briefly re-asked matz about this at today's dev meeting, and he had not changed his mind.

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-111396

* Author: rogerdpack (Roger Pack)
* Status: Assigned
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:120576] [Ruby master Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (5 preceding siblings ...)
  2025-01-09 11:51 ` [ruby-core:120572] " mame (Yusuke Endoh) via ruby-core
@ 2025-01-09 14:31 ` Eregon (Benoit Daloze) via ruby-core
  2025-01-09 15:55 ` [ruby-core:120581] " Dan0042 (Daniel DeLorme) via ruby-core
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2025-01-09 14:31 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #6012 has been updated by Eregon (Benoit Daloze).


Great to see this was accepted and even already implemented! (thanks @nobu!)

Byte offsets would be mostly for performance ("character" columns in multibyte files can be expensive to compute) and convenience (e.g. read the code at the given source_location from the file).
They are not strictly necessary.

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-111403

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:120581] [Ruby master Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (6 preceding siblings ...)
  2025-01-09 14:31 ` [ruby-core:120576] " Eregon (Benoit Daloze) via ruby-core
@ 2025-01-09 15:55 ` Dan0042 (Daniel DeLorme) via ruby-core
  2025-12-16  2:43 ` [ruby-core:124220] [Ruby " matz (Yukihiro Matsumoto) via ruby-core
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: Dan0042 (Daniel DeLorme) via ruby-core @ 2025-01-09 15:55 UTC (permalink / raw)
  To: ruby-core; +Cc: Dan0042 (Daniel DeLorme)

Issue #6012 has been updated by Dan0042 (Daniel DeLorme).


mame (Yusuke Endoh) wrote in #note-25:
> Matz was negative neither on adding a new class like Ruby::CodeLocation for this purpose

Any idea why? Because it seems like the "obviously correct" design so I'm curious why it was decided against.

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-111406

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124220] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (7 preceding siblings ...)
  2025-01-09 15:55 ` [ruby-core:120581] " Dan0042 (Daniel DeLorme) via ruby-core
@ 2025-12-16  2:43 ` matz (Yukihiro Matsumoto) via ruby-core
  2025-12-16  9:42 ` [ruby-core:124229] " mame (Yusuke Endoh) via ruby-core
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: matz (Yukihiro Matsumoto) via ruby-core @ 2025-12-16  2:43 UTC (permalink / raw)
  To: ruby-core; +Cc: matz (Yukihiro Matsumoto)

Issue #6012 has been updated by matz (Yukihiro Matsumoto).


Although last minute, we will cancel this feature in 4.0 because of design ambiguities such as whether to return column positions in bytes or characters as in #21783.

Matz.


----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115703

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124229] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (8 preceding siblings ...)
  2025-12-16  2:43 ` [ruby-core:124220] [Ruby " matz (Yukihiro Matsumoto) via ruby-core
@ 2025-12-16  9:42 ` mame (Yusuke Endoh) via ruby-core
  2025-12-16 10:16 ` [ruby-core:124232] " Eregon (Benoit Daloze) via ruby-core
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2025-12-16  9:42 UTC (permalink / raw)
  To: ruby-core; +Cc: mame (Yusuke Endoh)

Issue #6012 has been updated by mame (Yusuke Endoh).

Status changed from Closed to Open

I record the summary of the discussion regarding Matz's decision to revert this for now. The decision was based on a combination of several reasons:

* Unclear use cases
  * The description of #6012 lacked a use case.
  * The use case presented in #21005 was not convincing.
* Difficulty in changing `Binding#source_location` (#6012#note-24, #21005#note-19)
  * `Binding#source_location` still returns `[file, lineno]`.
  * Implementation issues: It was challenging to preserve the location information of `Kernel#binding`   calls within the ISeq.
  * Compatibility issues: `eval(code, nil, *binding.source_location)` is used in several gems; adding column information would break them.
* Related issues:
  * We may need to adjust Proc#source_location's position (#21784).
  * We need to discuss column units (bytes vs characters) (#21783).
* Timing: We can still revert without compatibility issues at this point.

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115715

* Author: rogerdpack (Roger Pack)
* Status: Open
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124232] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (9 preceding siblings ...)
  2025-12-16  9:42 ` [ruby-core:124229] " mame (Yusuke Endoh) via ruby-core
@ 2025-12-16 10:16 ` Eregon (Benoit Daloze) via ruby-core
  2025-12-16 11:25 ` [ruby-core:124234] " vo.x (Vit Ondruch) via ruby-core
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2025-12-16 10:16 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #6012 has been updated by Eregon (Benoit Daloze).


mame (Yusuke Endoh) wrote in #note-32:
> I record the summary of the discussion regarding Matz's decision to revert this for now. The decision was based on a combination of several reasons:

Thank you for documenting that.
It feels to me like the decision was taken while we were in the middle of discussing https://bugs.ruby-lang.org/issues/21783,
where we seem to now have reached an agreement, but the revert decision (and revert PR merged) was taken without any time for me to even reply there.

> * Unclear use cases

The fact many issues have been filed about this seems to show this is clearly a wanted feature.
It has always been useful to find where a method/block is defined.
https://rubygems.org/gems/method_source has 700 millions downloads, what other proof do we need?

> * Difficulty in changing `Binding#source_location` (#6012#note-24, #21005#note-19)

I wasn't aware of these, but I think this is much less needed than on {Proc,Method,UnboundMethod}.
Unless I'm missing something, a Binding doesn't always have a properly-defined source location/definition, e.g. for `b = binding`.
It has a start line if we consider that to be at the line of the `binding` call, but not really an end line/column.
IOW it's not a "scope" unlike a method or block, and seems much less useful.

> * Related issues:
>   * We may need to adjust Proc#source_location's position (#21784).
>   * We need to discuss column units (bytes vs characters) (#21783).

I'm fixing both of these in https://github.com/ruby/ruby/pull/15580.
Both issues seem to have rather clear agreements at this point.

> * Timing: We can still revert without compatibility issues at this point.

The feature has been implemented since 9th January, almost a year ago.
It's not been in a proper release yet of course but it has been in multiple previews.
I'm not sure if other people have tried it already, but I'm pretty confident a bunch of people are gonna be disappointed if this is removed last minute and it needs another year before it's in a Ruby release.
Do we really want to encourage heuristics like https://bugs.ruby-lang.org/issues/20999#note-1 vs a proper a solution by providing the necessary information in `{Method,UnboundMethod,Proc}#source_location`?

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115718

* Author: rogerdpack (Roger Pack)
* Status: Open
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124234] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (10 preceding siblings ...)
  2025-12-16 10:16 ` [ruby-core:124232] " Eregon (Benoit Daloze) via ruby-core
@ 2025-12-16 11:25 ` vo.x (Vit Ondruch) via ruby-core
  2025-12-16 11:26 ` [ruby-core:124235] " vo.x (Vit Ondruch) via ruby-core
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: vo.x (Vit Ondruch) via ruby-core @ 2025-12-16 11:25 UTC (permalink / raw)
  To: ruby-core; +Cc: vo.x (Vit Ondruch)

Issue #6012 has been updated by vo.x (Vit Ondruch).


Just FTR, not sure how the revert is supposed to look like, but at least Pry was adjusted for the new behavior:

https://github.com/pry/pry/pull/2357

It does not benefit from columns, but I suspect the revert would somehow influenced also the end of method location.



----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115720

* Author: rogerdpack (Roger Pack)
* Status: Open
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124235] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (11 preceding siblings ...)
  2025-12-16 11:25 ` [ruby-core:124234] " vo.x (Vit Ondruch) via ruby-core
@ 2025-12-16 11:26 ` vo.x (Vit Ondruch) via ruby-core
  2025-12-16 12:20 ` [ruby-core:124240] " Eregon (Benoit Daloze) via ruby-core
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: vo.x (Vit Ondruch) via ruby-core @ 2025-12-16 11:26 UTC (permalink / raw)
  To: ruby-core; +Cc: vo.x (Vit Ondruch)

Issue #6012 has been updated by vo.x (Vit Ondruch).


And RSpec were also adjusted to the new behavior AFAICT:

https://github.com/rspec/rspec/pull/282/commits/1c20fa80772ca7a1ed0512056ce7cd6a94f8e68d

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115721

* Author: rogerdpack (Roger Pack)
* Status: Open
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124240] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (12 preceding siblings ...)
  2025-12-16 11:26 ` [ruby-core:124235] " vo.x (Vit Ondruch) via ruby-core
@ 2025-12-16 12:20 ` Eregon (Benoit Daloze) via ruby-core
  2025-12-24 13:36 ` [ruby-core:124355] " matz (Yukihiro Matsumoto) via ruby-core
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2025-12-16 12:20 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #6012 has been updated by Eregon (Benoit Daloze).


Right, I thought about that too but forgot to write it.
Several gems have already adapted to this feature and their functionality and/or tests might rely on having the extra information, so it's definitely not great to remove this last minute.
If https://github.com/ruby/prism/pull/3808 had been merged already we'd make the entire method unusable in Prism, which certainly sounds bad.

I think we should do https://github.com/ruby/ruby/pull/15580

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115726

* Author: rogerdpack (Roger Pack)
* Status: Open
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124355] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (13 preceding siblings ...)
  2025-12-16 12:20 ` [ruby-core:124240] " Eregon (Benoit Daloze) via ruby-core
@ 2025-12-24 13:36 ` matz (Yukihiro Matsumoto) via ruby-core
  2026-01-07  0:17 ` [ruby-core:124421] " mame (Yusuke Endoh) via ruby-core
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: matz (Yukihiro Matsumoto) via ruby-core @ 2025-12-24 13:36 UTC (permalink / raw)
  To: ruby-core; +Cc: matz (Yukihiro Matsumoto)

Issue #6012 has been updated by matz (Yukihiro Matsumoto).


I didn't mean to cancel nor reject this proposal. It would probably be merged in 4.1 (or later). But since any design mistake would remain virtually forever in Ruby, and I am the one to be blamed.
We had some concerns, e.g. #21783 or #21784 and it was only days before the release.

Matz.


----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115866

* Author: rogerdpack (Roger Pack)
* Status: Open
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124421] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (14 preceding siblings ...)
  2025-12-24 13:36 ` [ruby-core:124355] " matz (Yukihiro Matsumoto) via ruby-core
@ 2026-01-07  0:17 ` mame (Yusuke Endoh) via ruby-core
  2026-01-07 11:31 ` [ruby-core:124426] " Eregon (Benoit Daloze) via ruby-core
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2026-01-07  0:17 UTC (permalink / raw)
  To: ruby-core; +Cc: mame (Yusuke Endoh)

Issue #6012 has been updated by mame (Yusuke Endoh).


Eregon (Benoit Daloze) wrote in #note-41:
> @mame Matz explicitly approved it: https://github.com/ruby/ruby/pull/15580#issuecomment-3691058342

Ah, I missed that the PR had already been approved. Sorry about that.

However, we should consider the fact that code like `source_location.last` actually exists in the wild, as RSpec fixed in advance. It seems this idiom is used in quite a few gems.

```
2017-01-10 /srv/gems/abaci-0.3.0/vendor/bundle/gems/pry-0.10.4/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2017-01-10 /srv/gems/abaci-0.3.0/vendor/bundle/gems/pry-0.10.4/lib/pry/module_candidate.rb:        end_method_line = last_method_source_location.last
2016-05-18 /srv/gems/able-neo4j-1.0.0/vendor/bundle/jruby/1.9/gems/pry-0.10.2-java/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2016-05-18 /srv/gems/able-neo4j-1.0.0/vendor/bundle/jruby/1.9/gems/pry-0.10.2-java/lib/pry/module_candidate.rb:        end_method_line = last_method_source_location.last
2025-08-06 /srv/gems/affixapi-1.1.113/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-08-06 /srv/gems/affixapi-1.1.113/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-08-06 /srv/gems/affixapi-1.1.113/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-08-06 /srv/gems/affixapi-1.1.113/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-08-06 /srv/gems/affixapi-1.1.113/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 4, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/web-console-4.2.1/lib/web_console/source_location.rb:      def lineno() @binding.source_location.last end
1980-01-02 /srv/gems/alchemy_i18n-5.0.1/vendor/bundle/ruby/4.0.0/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 4, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/alchemy_i18n-5.0.1/vendor/bundle/ruby/4.0.0/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/alchemy_i18n-5.0.1/vendor/bundle/ruby/4.0.0/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/alchemy_i18n-5.0.1/vendor/bundle/ruby/4.0.0/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/alchemy_i18n-5.0.1/vendor/bundle/ruby/4.0.0/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/alchemy_i18n-5.0.1/vendor/bundle/ruby/4.0.0/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/alchemy_i18n-5.0.1/vendor/bundle/ruby/4.0.0/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/web-console-4.2.1/lib/web_console/source_location.rb:      def lineno() @binding.source_location.last end
2023-12-18 /srv/gems/ali-cli-0.0.2/lib/ali/template.rb:    Rouge.highlight "\n#{"".ljust(indent, " ")}# #{task_path}:#{source_location.last}\n#{source}", lexer, formatter
2019-01-10 /srv/gems/alimentos-alu0100945645-1.0.0/vendor/bundle/ruby/2.3.0/gems/pry-0.12.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2019-01-10 /srv/gems/alimentos-alu0100945645-1.0.0/vendor/bundle/ruby/2.3.0/gems/pry-0.12.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2019-01-10 /srv/gems/alimentos-alu0100945645-1.0.0/vendor/bundle/ruby/2.3.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2022-06-14 /srv/gems/alloy_sdk-0.1.0/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.11.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2022-06-14 /srv/gems/alloy_sdk-0.1.0/vendor/bundle/ruby/3.0.0/gems/rspec-expectations-3.11.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2022-03-18 /srv/gems/andyw8-seeing_is_believing-4.2.1/spec/event_stream_spec.rb:        return raises_exception.source_location.last
2020-03-09 /srv/gems/argon-1.3.1/vendor/bundle/ruby/2.7.0/gems/pry-0.12.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2020-03-09 /srv/gems/argon-1.3.1/vendor/bundle/ruby/2.7.0/gems/pry-0.12.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2020-03-09 /srv/gems/argon-1.3.1/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-06-25 /srv/gems/asktive_record-0.1.7/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.4/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2018-05-07 /srv/gems/attestify-0.1.1/lib/attestify/test_list.rb:          return result if source_location.last > line
2025-11-21 /srv/gems/avalara_sdk-25.11.2/vendor/bundle/ruby/3.3.0/gems/pry-0.13.1/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-11-21 /srv/gems/avalara_sdk-25.11.2/vendor/bundle/ruby/3.3.0/gems/pry-0.13.1/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-11-21 /srv/gems/avalara_sdk-25.11.2/vendor/bundle/ruby/3.3.0/gems/pry-0.13.1/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-11-21 /srv/gems/avalara_sdk-25.11.2/vendor/bundle/ruby/3.3.0/gems/pry-0.13.1/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-11-21 /srv/gems/avalara_sdk-25.11.2/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.11.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2015-02-02 /srv/gems/billygoat-0.0.7.2/lib/billygoat/documentation.rb:      @line_number ||= self.method.source_location.last
2019-07-10 /srv/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 4, exc.bindings.first.source_location.last
2019-07-10 /srv/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
2019-07-10 /srv/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
2019-07-10 /srv/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
2019-07-10 /srv/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
2023-03-04 /srv/gems/blinka-reporter-0.8.0/lib/blinka_reporter/minitest_adapter.rb:      @line ||= source_location.last
2022-05-02 /srv/gems/boothby-0.1.1/lib/boothby/seeds.rb:      methods.sort_by { |method| seed_class.method(method).source_location.last }
2022-05-02 /srv/gems/boothby-0.1.1/lib/boothby/seeds.rb:    methods.sort_by { |method| seed_class.method(method).source_location.last }
2018-09-11 /srv/gems/bsielski_control_flow-1.0.0/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.8.1/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2023-12-18 /srv/gems/builder_apm-0.5.14/lib/builder_apm/controllers/instrumenter.rb:          line_number = method_info.source_location.last
2023-04-01 /srv/gems/call_your_name-0.1.0/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2019-10-31 /srv/gems/chatops-rpc-0.0.2/fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 4, exc.bindings.first.source_location.last
2019-10-31 /srv/gems/chatops-rpc-0.0.2/fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
2019-10-31 /srv/gems/chatops-rpc-0.0.2/fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
2019-10-31 /srv/gems/chatops-rpc-0.0.2/fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
2019-10-31 /srv/gems/chatops-rpc-0.0.2/fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
2019-10-31 /srv/gems/chatops-rpc-0.0.2/fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/pry-0.12.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2019-10-31 /srv/gems/chatops-rpc-0.0.2/fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/pry-0.12.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2019-10-31 /srv/gems/chatops-rpc-0.0.2/fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/web-console-4.0.1/lib/web_console/source_location.rb:    def lineno() @binding.source_location.last end
1980-01-02 /srv/gems/ci-queue-0.81.0/lib/minitest/queue/junit_reporter.rb:          lineno = tests.first.source_location.last
1980-01-02 /srv/gems/ci-queue-0.81.0/lib/minitest/queue/test_data.rb:        @test.source_location.last
2025-09-03 /srv/gems/citypay_api_client-1.1.4/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-09-03 /srv/gems/citypay_api_client-1.1.4/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-09-03 /srv/gems/citypay_api_client-1.1.4/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-09-03 /srv/gems/citypay_api_client-1.1.4/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-09-03 /srv/gems/citypay_api_client-1.1.4/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2020-07-10 /srv/gems/cli-nasa-0.1.1/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-10-02 /srv/gems/cloudsmith-api-2.0.22/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2021-05-26 /srv/gems/coingecko_client-0.1.2/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/command_deck-0.3.3/TAGS:      def lineno() @binding.source_location.last endlineno11,0
2023-12-18 /srv/gems/constrain-0.10.0/lib/constrain.rb:      when Proc; "Proc@#{expr.source_location.first}:#{expr.source_location.last}"
2020-03-05 /srv/gems/coresv_db_backup-0.1.0/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/crx_packmgr_api_client_maintenance-1.3.2/vendor/ruby/3.4.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2024-07-10 /srv/gems/curlybars-1.12.0/lib/curlybars/rendering_support.rb:        line_number = source_location ? helper.source_location.last : "n/a"
1980-01-02 /srv/gems/cybrid_api_bank_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
1980-01-02 /srv/gems/cybrid_api_bank_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
1980-01-02 /srv/gems/cybrid_api_bank_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
1980-01-02 /srv/gems/cybrid_api_bank_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
1980-01-02 /srv/gems/cybrid_api_bank_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/cybrid_api_id_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
1980-01-02 /srv/gems/cybrid_api_id_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
1980-01-02 /srv/gems/cybrid_api_id_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
1980-01-02 /srv/gems/cybrid_api_id_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
1980-01-02 /srv/gems/cybrid_api_id_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/cybrid_api_organization_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
1980-01-02 /srv/gems/cybrid_api_organization_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
1980-01-02 /srv/gems/cybrid_api_organization_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
1980-01-02 /srv/gems/cybrid_api_organization_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
1980-01-02 /srv/gems/cybrid_api_organization_ruby-0.126.13/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2024-07-11 /srv/gems/databox-2.1.1/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2024-07-11 /srv/gems/databox-2.1.1/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2024-07-11 /srv/gems/databox-2.1.1/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2024-07-11 /srv/gems/databox-2.1.1/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2024-07-11 /srv/gems/databox-2.1.1/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.1/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/devil_fruit-0.3.0/vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2021-03-04 /srv/gems/dialekt-0.1.0/lib/dialekt/util/call_adapter.rb:        "#{File.basename(@callable.source_location.first)}:#{@callable.source_location.last}"
2018-08-09 /srv/gems/dirwatch-0.0.9/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.7.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2018-08-09 /srv/gems/dirwatch-0.0.9/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.8.1/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/docspring-3.2.0/vendor/bundle/ruby/3.4.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
1980-01-02 /srv/gems/docspring-3.2.0/vendor/bundle/ruby/3.4.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
1980-01-02 /srv/gems/docspring-3.2.0/vendor/bundle/ruby/3.4.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
1980-01-02 /srv/gems/docspring-3.2.0/vendor/bundle/ruby/3.4.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
1980-01-02 /srv/gems/docspring-3.2.0/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2017-08-29 /srv/gems/echonet_lite-0.1.0/vendor/bundle/gems/rspec-expectations-3.6.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/ed-precompiled_bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 4, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/ed-precompiled_bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/ed-precompiled_bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/ed-precompiled_bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
1980-01-02 /srv/gems/ed-precompiled_bindex-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
2018-12-19 /srv/gems/embulk-input-druginfo_interview_form-0.1.0/vendor/bundle/ruby/2.4.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2018-12-19 /srv/gems/embulk-input-druginfo_interview_form-0.1.0/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-07-28 /srv/gems/encrypted_jsonb-0.1.2/vendor/cache/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2023-07-06 /srv/gems/fablicop-1.10.3/vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2015-04-18 /srv/gems/fare-0.1.8/lib/fare/configuration_dsl.rb:          raise "Stack without topics for stack on line #{@source_location.last} of #{@source_location.first}"
2015-04-18 /srv/gems/fare-0.1.8/lib/fare/configuration_dsl.rb:          raise "No run list specified for stack on line #{@source_location.last} of #{@source_location.first}"
2019-11-11 /srv/gems/genkaio-0.0.2/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2019-11-11 /srv/gems/genkaio-0.0.2/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/gettext_i18n_rails_js-3.0.0/vendor/bundle/ruby/4.0.0/gems/pry-0.16.0/lib/pry/wrapped_module/candidate.rb:          last_method_source_location.last
1980-01-02 /srv/gems/gettext_i18n_rails_js-3.0.0/vendor/bundle/ruby/4.0.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2015-11-12 /srv/gems/git_compound-0.2.2/lib/git_compound/logger/debug/task.rb:        "in line `#{@block.source_location.last}`, " \
2021-11-23 /srv/gems/glimmer-dsl-specification-0.0.5/lib/glimmer/specification/element/fact.rb:          source_code = PutsDebuggerer::SourceFile.new(@block.source_location.first).source(1, @block.source_location.last)
2020-09-11 /srv/gems/grape-extra_validators-2.0.0/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2020-09-11 /srv/gems/grape-extra_validators-2.0.0/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/grape_rails_logger-1.2.0/lib/grape_rails_logger/subscriber.rb:      line = endpoint.source.source_location.last
2024-04-15 /srv/gems/harbr-2.8.1/vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2019-04-14 /srv/gems/hatena_bookmark_client_for_ruby-0.1.3/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/invoicetronic_sdk-1.0.1/vendor/bundle/ruby/3.4.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
1980-01-02 /srv/gems/invoicetronic_sdk-1.0.1/vendor/bundle/ruby/3.4.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
1980-01-02 /srv/gems/invoicetronic_sdk-1.0.1/vendor/bundle/ruby/3.4.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
1980-01-02 /srv/gems/invoicetronic_sdk-1.0.1/vendor/bundle/ruby/3.4.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
1980-01-02 /srv/gems/invoicetronic_sdk-1.0.1/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/itsi-0.2.20/gems/server/lib/itsi/server/typed_handlers/source_parser.rb:          proc_line = source_location.last - 1
1980-01-02 /srv/gems/itsi-server-0.2.20/lib/itsi/server/typed_handlers/source_parser.rb:          proc_line = source_location.last - 1
2016-12-31 /srv/gems/ivanvc-logstash-input-s3-3.1.1.4/vendor/local/gems/pry-0.10.4-java/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2016-12-31 /srv/gems/ivanvc-logstash-input-s3-3.1.1.4/vendor/local/gems/pry-0.10.4-java/lib/pry/module_candidate.rb:        end_method_line = last_method_source_location.last
2025-01-07 /srv/gems/lazy_graph-0.2.0/lib/lazy_graph/node/derived_rules.rb:            derived.source_location.last + offset
2025-01-07 /srv/gems/lazy_graph-0.2.0/lib/lazy_graph/node/derived_rules.rb:            proc_line = source_location.last - 1
2017-05-26 /srv/gems/logstash-filter-htmlentities-0.1.0/vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2017-05-26 /srv/gems/logstash-filter-htmlentities-0.1.0/vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/module_candidate.rb:        end_method_line = last_method_source_location.last
2017-05-26 /srv/gems/logstash-filter-htmlentities-0.1.0/vendor/bundle/jruby/1.9/gems/rspec-expectations-3.6.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2017-03-08 /srv/gems/logstash-filter-zabbix-0.1.2/vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2017-03-08 /srv/gems/logstash-filter-zabbix-0.1.2/vendor/bundle/jruby/1.9/gems/pry-0.10.4-java/lib/pry/module_candidate.rb:        end_method_line = last_method_source_location.last
2020-10-04 /srv/gems/lotrd-0.1.9/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2021-09-17 /srv/gems/loupe-0.1.5/lib/loupe/executor.rb:            line_numbers.include?(klass.instance_method(method_name).source_location.last.to_s)
2015-10-16 /srv/gems/mastermind_adeybee-0.1.4/vendor/bundle/ruby/2.2.0/gems/pry-0.10.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2015-10-16 /srv/gems/mastermind_adeybee-0.1.4/vendor/bundle/ruby/2.2.0/gems/pry-0.10.2/lib/pry/module_candidate.rb:        end_method_line = last_method_source_location.last
2016-05-06 /srv/gems/matest-1.7.4/lib/matest/example_block.rb:    lineno = block.source_location.last
2020-03-07 /srv/gems/mdap-0.2.1/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2017-03-09 /srv/gems/mdg-1.0.1/vendor/bundle/ruby/2.3.0/gems/pry-0.10.4/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2017-03-09 /srv/gems/mdg-1.0.1/vendor/bundle/ruby/2.3.0/gems/pry-0.10.4/lib/pry/module_candidate.rb:        end_method_line = last_method_source_location.last
2021-03-18 /srv/gems/mfk_openapi_ruby_client-1.0.0/vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2021-03-18 /srv/gems/mfk_openapi_ruby_client-1.0.0/vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2021-03-18 /srv/gems/mfk_openapi_ruby_client-1.0.0/vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2021-03-18 /srv/gems/mfk_openapi_ruby_client-1.0.0/vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2021-03-18 /srv/gems/mfk_openapi_ruby_client-1.0.0/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.10.1/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2011-09-03 /srv/gems/minecraft-0.3.3/lib/minecraft/extensions.rb:        src_b, src_e = get_comment_range(meth.source_location.last)
2015-12-08 /srv/gems/minirails-0.2.0/lib/minirails.rb:            c.instance_method(m).source_location.last
2024-09-16 /srv/gems/minitest-distributed-0.2.11/lib/minitest/distributed/reporters/junitxml_reporter.rb:            lineno = test.source_location.last
1980-01-01 /srv/gems/minitest-junit-2.1.0/lib/minitest/junit.rb:        testcase['line'] = result.source_location.last
2018-05-21 /srv/gems/monero_wallet_gen-0.1.0/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2018-05-21 /srv/gems/monero_wallet_gen-0.1.0/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2018-05-21 /srv/gems/monero_wallet_gen-0.1.0/vendor/bundle/ruby/2.3.0/gems/rspec-expectations-3.7.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-05-02 /srv/gems/moneykit-0.2.2/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-05-02 /srv/gems/moneykit-0.2.2/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-05-02 /srv/gems/moneykit-0.2.2/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-05-02 /srv/gems/moneykit-0.2.2/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-05-02 /srv/gems/moneykit-0.2.2/vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.13.4/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2018-06-14 /srv/gems/mrcooper-logstash-output-azuresearch-0.2.2/vendor/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2018-06-14 /srv/gems/mrcooper-logstash-output-azuresearch-0.2.2/vendor/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/module_candidate.rb:        end_method_line = last_method_source_location.last
2018-06-14 /srv/gems/mrcooper-logstash-output-azuresearch-0.2.2/vendor/jruby/2.5.0/gems/rspec-expectations-3.7.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2023-04-15 /srv/gems/mumukit-content-type-1.12.1/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/mutant-0.14.1/lib/mutant/matcher/method.rb:          source_location.last
2019-02-11 /srv/gems/mutest-0.0.10/lib/mutest/matcher/method.rb:          source_location.last
1980-01-02 /srv/gems/mux_ruby-5.1.0/vendor/bundle/ruby/3.2.0/gems/pry-0.13.1/lib/pry/method/weird_method_locator.rb:          target.source_location.last
1980-01-02 /srv/gems/mux_ruby-5.1.0/vendor/bundle/ruby/3.2.0/gems/pry-0.13.1/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
1980-01-02 /srv/gems/mux_ruby-5.1.0/vendor/bundle/ruby/3.2.0/gems/pry-0.13.1/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
1980-01-02 /srv/gems/mux_ruby-5.1.0/vendor/bundle/ruby/3.2.0/gems/pry-0.13.1/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
1980-01-02 /srv/gems/mux_ruby-5.1.0/vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.11.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2019-06-09 /srv/gems/nabea2-0.1.2/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2022-11-24 /srv/gems/opal-rspec-1.0.0/rspec-expectations/upstream/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/openhab-scripting-5.44.0/lib/openhab/dsl/rules/name_inference.rb:            "#{file}:#{block.source_location.last}".tr(".", "_")
2025-08-08 /srv/gems/openstudio-common-measures-0.12.3/lib/measures/envelope_and_internal_load_breakdown/measure.rb:      method_hash[section.to_s] = OsLib_ReportingHeatGainLoss.method(section).source_location.last
2025-08-08 /srv/gems/openstudio-common-measures-0.12.3/lib/measures/example_report/measure.rb:      method_hash[section.to_s] = OsLib_Reporting_example.method(section).source_location.last
2025-12-10 /srv/gems/ory-client-1.22.16/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-12-10 /srv/gems/ory-client-1.22.16/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-12-10 /srv/gems/ory-client-1.22.16/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-12-10 /srv/gems/ory-client-1.22.16/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-12-10 /srv/gems/ory-client-1.22.16/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-11-07 /srv/gems/ory-hydra-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-11-07 /srv/gems/ory-hydra-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-11-07 /srv/gems/ory-hydra-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-11-07 /srv/gems/ory-hydra-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-11-07 /srv/gems/ory-hydra-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-11-09 /srv/gems/ory-keto-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-11-09 /srv/gems/ory-keto-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-11-09 /srv/gems/ory-keto-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-11-09 /srv/gems/ory-keto-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-11-09 /srv/gems/ory-keto-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-11-07 /srv/gems/ory-kratos-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-11-07 /srv/gems/ory-kratos-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-11-07 /srv/gems/ory-kratos-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-11-07 /srv/gems/ory-kratos-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-11-07 /srv/gems/ory-kratos-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-11-09 /srv/gems/ory-oathkeeper-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-11-09 /srv/gems/ory-oathkeeper-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-11-09 /srv/gems/ory-oathkeeper-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-11-09 /srv/gems/ory-oathkeeper-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-11-09 /srv/gems/ory-oathkeeper-client-25.4.0/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-10-17 /srv/gems/package-installer-cli-2.4.0/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-10-17 /srv/gems/package-installer-cli-2.4.0/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-10-17 /srv/gems/package-installer-cli-2.4.0/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-10-17 /srv/gems/package-installer-cli-2.4.0/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-10-17 /srv/gems/package-installer-cli-2.4.0/vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2023-02-28 /srv/gems/pad_character-0.1.0/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.12.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2021-06-16 /srv/gems/passbase-1.3.0/vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2021-06-16 /srv/gems/passbase-1.3.0/vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2021-06-16 /srv/gems/passbase-1.3.0/vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2021-06-16 /srv/gems/passbase-1.3.0/vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2021-06-16 /srv/gems/passbase-1.3.0/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2020-03-15 /srv/gems/pokedex-terminal-0.2.8/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2019-03-11 /srv/gems/pomodorokun-0.1.0/bundle/ruby/2.4.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2022-12-28 /srv/gems/pork-2.1.0/lib/pork/extra/show_source.rb:      lowers = test.source_location.last
2024-02-11 /srv/gems/prawn-manual_builder-0.4.0/lib/prawn/manual_builder/chapter.rb:          block_source_line = example.source_location.last
1980-01-02 /srv/gems/pry-0.16.0/lib/pry/wrapped_module/candidate.rb:          last_method_source_location.last
2020-01-03 /srv/gems/puppet-function-updater-0.0.5/lib/pfu/parser.rb:        return [funcname, opts, block.source_location.last]
2025-04-11 /srv/gems/rails8_spree_admin-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-04-11 /srv/gems/rails8_spree_admin-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-04-11 /srv/gems/rails8_spree_admin-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-04-11 /srv/gems/rails8_spree_admin-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-04-11 /srv/gems/rails8_spree_admin-5.0.6/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-04-11 /srv/gems/rails8_spree_api-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-04-11 /srv/gems/rails8_spree_api-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-04-11 /srv/gems/rails8_spree_api-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-04-11 /srv/gems/rails8_spree_api-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-04-11 /srv/gems/rails8_spree_api-5.0.6/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-04-11 /srv/gems/rails8_spree_cli-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-04-11 /srv/gems/rails8_spree_cli-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-04-11 /srv/gems/rails8_spree_cli-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-04-11 /srv/gems/rails8_spree_cli-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-04-11 /srv/gems/rails8_spree_cli-5.0.6/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-04-11 /srv/gems/rails8_spree_core-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-04-11 /srv/gems/rails8_spree_core-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-04-11 /srv/gems/rails8_spree_core-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-04-11 /srv/gems/rails8_spree_core-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-04-11 /srv/gems/rails8_spree_core-5.0.6/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-04-11 /srv/gems/rails8_spree_emails-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-04-11 /srv/gems/rails8_spree_emails-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-04-11 /srv/gems/rails8_spree_emails-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-04-11 /srv/gems/rails8_spree_emails-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-04-11 /srv/gems/rails8_spree_emails-5.0.6/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-04-11 /srv/gems/rails8_spree_storefront-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-04-11 /srv/gems/rails8_spree_storefront-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-04-11 /srv/gems/rails8_spree_storefront-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-04-11 /srv/gems/rails8_spree_storefront-5.0.6/vendor/bundle/ruby/3.3.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-04-11 /srv/gems/rails8_spree_storefront-5.0.6/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2016-07-13 /srv/gems/rblineprof-0.3.7/test/test_lineprof.rb:    line = profile[__FILE__][m.source_location.last]
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/method/source_location_spec.rb:      line = @method.source_location.last
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/method/source_location_spec.rb:      MethodSpecs::SourceLocation.method(:redefined).source_location.last.should == 13
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/method/source_location_spec.rb:      MethodSpecs::SourceLocation.new.method(:aka).source_location.last.should == 17
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      line = @proc.source_location.last
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      line = @proc_new.source_location.last
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      line = @lambda.source_location.last
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_multiline_proc.source_location.last.should == 16
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_multiline_proc_new.source_location.last.should == 30
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_multiline_lambda.source_location.last.should == 23
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_detached_proc.source_location.last.should == 37
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_detached_proc_new.source_location.last.should == 47
2024-02-15 /srv/gems/rhodes-7.6.0/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_detached_lambda.source_location.last.should == 42
1980-01-02 /srv/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2020-02-21 /srv/gems/ruby-scheduler-0.1.3/vendor/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2020-02-21 /srv/gems/ruby-scheduler-0.1.3/vendor/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2012-10-25 /srv/gems/rubymirrors-0.0.3/lib/ruby/reflection/method_mirror.rb:        source_location.last - 1
2023-08-21 /srv/gems/sampero-0.1.0/vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2018-04-30 /srv/gems/sb_prime_table-0.1.1/vendor/bundle/ruby/2.4.0/gems/pry-0.11.3/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2018-04-30 /srv/gems/sb_prime_table-0.1.1/vendor/bundle/ruby/2.4.0/gems/pry-0.11.3/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2018-04-30 /srv/gems/sb_prime_table-0.1.1/vendor/bundle/ruby/2.4.0/gems/rspec-expectations-3.7.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2015-10-13 /srv/gems/sc_core-0.0.7/test/dummy/vendor/bundle/ruby/2.2.0/gems/pry-0.10.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2015-10-13 /srv/gems/sc_core-0.0.7/test/dummy/vendor/bundle/ruby/2.2.0/gems/pry-0.10.2/lib/pry/module_candidate.rb:        end_method_line = last_method_source_location.last
1980-01-02 /srv/gems/scnr-introspector-0.3.2/lib/scnr/introspector/data_flow/sink.rb:            lineno   = @method_source_location.last
2025-10-19 /srv/gems/scrapbook-0.4.0/vendor/ruby/2.7.0/gems/rspec-expectations-3.11.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2021-01-13 /srv/gems/seeing_is_believing-4.0.1/spec/event_stream_spec.rb:        return raises_exception.source_location.last
2025-12-17 /srv/gems/shopsavvy-sdk-1.0.2/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/siteimprove_api_client-1.0.3/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
1980-01-02 /srv/gems/siteimprove_api_client-1.0.3/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
1980-01-02 /srv/gems/siteimprove_api_client-1.0.3/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
1980-01-02 /srv/gems/siteimprove_api_client-1.0.3/vendor/bundle/ruby/3.2.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
1980-01-02 /srv/gems/siteimprove_api_client-1.0.3/vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2019-07-10 /srv/gems/skiptrace-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 4, exc.bindings.first.source_location.last
2019-07-10 /srv/gems/skiptrace-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
2019-07-10 /srv/gems/skiptrace-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
2019-07-10 /srv/gems/skiptrace-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 14, exc.bindings.first.source_location.last
2019-07-10 /srv/gems/skiptrace-0.8.1/test/skiptrace/exception_test.rb:      assert_equal 6, exc.bindings.first.source_location.last
2019-11-14 /srv/gems/spec_fill-0.1.2/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2020-11-28 /srv/gems/spud-0.2.10/lib/spud/block_param_info.rb:      line = File.read(@filename).split("\n")[@block.source_location.last - 1]
2013-06-11 /srv/gems/sshp-0.0.2/vendor/ruby/1.9.1/gems/pry-0.9.12.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2013-06-11 /srv/gems/sshp-0.0.2/vendor/ruby/1.9.1/gems/pry-0.9.12.2/lib/pry/module_candidate.rb:        end_method_line = last_method_source_location.last
2020-03-09 /srv/gems/symbolic_enum-1.1.5/vendor/bundle/ruby/2.7.0/gems/pry-0.12.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2020-03-09 /srv/gems/symbolic_enum-1.1.5/vendor/bundle/ruby/2.7.0/gems/pry-0.12.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2020-03-09 /srv/gems/symbolic_enum-1.1.5/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2023-08-22 /srv/gems/synctera_ruby_sdk-1.1.3/vendor/bundle/ruby/3.2.0/gems/pry-0.14.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2023-08-22 /srv/gems/synctera_ruby_sdk-1.1.3/vendor/bundle/ruby/3.2.0/gems/pry-0.14.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2023-08-22 /srv/gems/synctera_ruby_sdk-1.1.3/vendor/bundle/ruby/3.2.0/gems/pry-0.14.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2023-08-22 /srv/gems/synctera_ruby_sdk-1.1.3/vendor/bundle/ruby/3.2.0/gems/pry-0.14.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2023-08-22 /srv/gems/synctera_ruby_sdk-1.1.3/vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2017-08-03 /srv/gems/ta910_helloworld-0.1.1/vendor/bundle/gems/rspec-expectations-3.6.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2023-01-06 /srv/gems/takuya-lvm-snapshot-0.1.0/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/method/source_location_spec.rb:      line = @method.source_location.last
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/method/source_location_spec.rb:      MethodSpecs::SourceLocation.method(:redefined).source_location.last.should == 13
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/method/source_location_spec.rb:      MethodSpecs::SourceLocation.new.method(:aka).source_location.last.should == 17
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      line = @proc.source_location.last
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      line = @proc_new.source_location.last
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      line = @lambda.source_location.last
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_multiline_proc.source_location.last.should == 16
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_multiline_proc_new.source_location.last.should == 30
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_multiline_lambda.source_location.last.should == 23
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_detached_proc.source_location.last.should == 37
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_detached_proc_new.source_location.last.should == 47
2016-05-23 /srv/gems/tauplatform-1.0.3/spec/framework_spec/app/spec/core/proc/source_location_spec.rb:      ProcSpecs::SourceLocation.my_detached_lambda.source_location.last.should == 42
2017-09-21 /srv/gems/test_gem2_dh-0.1.0/vendor/bundle/gems/rspec-expectations-3.6.0/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2013-07-30 /srv/gems/torquebox-console-0.3.0/vendor/bundle/jruby/1.9/gems/pry-0.9.12-java/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2013-07-30 /srv/gems/torquebox-console-0.3.0/vendor/bundle/jruby/1.9/gems/pry-0.9.12-java/lib/pry/module_candidate.rb:        end_method_line = last_method_source_location.last
2016-05-22 /srv/gems/transform_tree-0.3.1/lib/transform_tree/node.rb:    "#{File.basename closure.source_location.first}:#{closure.source_location.last}"
2015-04-01 /srv/gems/turnip-dry_run-0.1.0/lib/turnip/dry_run.rb:        step_method.source_location.last
2023-08-19 /srv/gems/tursodb-0.1.0/vendor/bundle/ruby/3.2.0/gems/rspec-expectations-3.12.3/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2023-09-05 /srv/gems/web-console-4.2.1/lib/web_console/source_location.rb:      def lineno() @binding.source_location.last end
2025-07-18 /srv/gems/whatpulse-sdk-1.0.1/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          target.source_location.last
2025-07-18 /srv/gems/whatpulse-sdk-1.0.1/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method/weird_method_locator.rb:          [File.expand_path(source_location.first), source_location.last]
2025-07-18 /srv/gems/whatpulse-sdk-1.0.1/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/method.rb:      source_location.nil? ? nil : source_location.last
2025-07-18 /srv/gems/whatpulse-sdk-1.0.1/vendor/bundle/ruby/3.1.0/gems/pry-0.15.2/lib/pry/wrapped_module/candidate.rb:        end_method_line = last_method_source_location.last
2025-07-18 /srv/gems/whatpulse-sdk-1.0.1/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2020-07-07 /srv/gems/yoshioka_gem-0.1.0/vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.9.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2025-09-23 /srv/gems/zayef-0.2.0.1/vendor/bundle/ruby/3.0.0/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2024-09-11 /srv/gems/zeus-0.17.0/lib/zeus/m/test_method.rb:          start_line = method.source_location.last
2012-11-15 /srv/gems/zeus-edge-0.12.1/lib/zeus/m/test_method.rb:          start_line = method.source_location.last
2014-04-06 /srv/gems/zeus-justinf-0.13.5/lib/zeus/m/test_method.rb:          start_line = method.source_location.last
```

@matz, are you sure this is okay?

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115970

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124426] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (15 preceding siblings ...)
  2026-01-07  0:17 ` [ruby-core:124421] " mame (Yusuke Endoh) via ruby-core
@ 2026-01-07 11:31 ` Eregon (Benoit Daloze) via ruby-core
  2026-01-07 11:54 ` [ruby-core:124430] " mame (Yusuke Endoh) via ruby-core
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2026-01-07 11:31 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #6012 has been updated by Eregon (Benoit Daloze).


mame (Yusuke Endoh) wrote in #note-43:
> However, we should consider the fact that code like `source_location.last` actually exists in the wild, as RSpec fixed in advance. It seems this idiom is used in quite a few gems.

This change has been in all 3.5 and 4.0 preview builds and seems to have caused very little incompatibility.
It will have another full year before the 4.1 release, so I think this is no problem.

BTW, if we remove tests & specs from that list (since they wouldn't break any code) we have:
```
$ cat matches.txt | grep -Fv '_spec.rb' | grep -Fv '_test.rb' | grep -Fv '/test_'
1980-01-01 /srv/gems/minitest-junit-2.1.0/lib/minitest/junit.rb:        testcase['line'] = result.source_location.last
1980-01-02 /srv/gems/ci-queue-0.81.0/lib/minitest/queue/junit_reporter.rb:          lineno = tests.first.source_location.last
1980-01-02 /srv/gems/command_deck-0.3.3/TAGS:      def lineno() @binding.source_location.last endlineno11,0
1980-01-02 /srv/gems/grape_rails_logger-1.2.0/lib/grape_rails_logger/subscriber.rb:      line = endpoint.source.source_location.last
1980-01-02 /srv/gems/itsi-0.2.20/gems/server/lib/itsi/server/typed_handlers/source_parser.rb:          proc_line = source_location.last - 1
1980-01-02 /srv/gems/itsi-server-0.2.20/lib/itsi/server/typed_handlers/source_parser.rb:          proc_line = source_location.last - 1
1980-01-02 /srv/gems/mutant-0.14.1/lib/mutant/matcher/method.rb:          source_location.last
1980-01-02 /srv/gems/openhab-scripting-5.44.0/lib/openhab/dsl/rules/name_inference.rb:            "#{file}:#{block.source_location.last}".tr(".", "_")
1980-01-02 /srv/gems/pry-0.16.0/lib/pry/wrapped_module/candidate.rb:          last_method_source_location.last
1980-01-02 /srv/gems/rspec-expectations-3.13.5/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
1980-01-02 /srv/gems/scnr-introspector-0.3.2/lib/scnr/introspector/data_flow/sink.rb:            lineno   = @method_source_location.last
2011-09-03 /srv/gems/minecraft-0.3.3/lib/minecraft/extensions.rb:        src_b, src_e = get_comment_range(meth.source_location.last)
2012-10-25 /srv/gems/rubymirrors-0.0.3/lib/ruby/reflection/method_mirror.rb:        source_location.last - 1
2015-02-02 /srv/gems/billygoat-0.0.7.2/lib/billygoat/documentation.rb:      @line_number ||= self.method.source_location.last
2015-04-01 /srv/gems/turnip-dry_run-0.1.0/lib/turnip/dry_run.rb:        step_method.source_location.last
2015-04-18 /srv/gems/fare-0.1.8/lib/fare/configuration_dsl.rb:          raise "No run list specified for stack on line #{@source_location.last} of #{@source_location.first}"
2015-04-18 /srv/gems/fare-0.1.8/lib/fare/configuration_dsl.rb:          raise "Stack without topics for stack on line #{@source_location.last} of #{@source_location.first}"
2015-11-12 /srv/gems/git_compound-0.2.2/lib/git_compound/logger/debug/task.rb:        "in line `#{@block.source_location.last}`, " \
2015-12-08 /srv/gems/minirails-0.2.0/lib/minirails.rb:            c.instance_method(m).source_location.last
2016-05-06 /srv/gems/matest-1.7.4/lib/matest/example_block.rb:    lineno = block.source_location.last
2016-05-22 /srv/gems/transform_tree-0.3.1/lib/transform_tree/node.rb:    "#{File.basename closure.source_location.first}:#{closure.source_location.last}"
2019-02-11 /srv/gems/mutest-0.0.10/lib/mutest/matcher/method.rb:          source_location.last
2019-03-11 /srv/gems/pomodorokun-0.1.0/bundle/ruby/2.4.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2020-01-03 /srv/gems/puppet-function-updater-0.0.5/lib/pfu/parser.rb:        return [funcname, opts, block.source_location.last]
2020-11-28 /srv/gems/spud-0.2.10/lib/spud/block_param_info.rb:      line = File.read(@filename).split("\n")[@block.source_location.last - 1]
2021-03-04 /srv/gems/dialekt-0.1.0/lib/dialekt/util/call_adapter.rb:        "#{File.basename(@callable.source_location.first)}:#{@callable.source_location.last}"
2021-09-17 /srv/gems/loupe-0.1.5/lib/loupe/executor.rb:            line_numbers.include?(klass.instance_method(method_name).source_location.last.to_s)
2021-11-23 /srv/gems/glimmer-dsl-specification-0.0.5/lib/glimmer/specification/element/fact.rb:          source_code = PutsDebuggerer::SourceFile.new(@block.source_location.first).source(1, @block.source_location.last)
2022-05-02 /srv/gems/boothby-0.1.1/lib/boothby/seeds.rb:      methods.sort_by { |method| seed_class.method(method).source_location.last }
2022-05-02 /srv/gems/boothby-0.1.1/lib/boothby/seeds.rb:    methods.sort_by { |method| seed_class.method(method).source_location.last }
2022-11-24 /srv/gems/opal-rspec-1.0.0/rspec-expectations/upstream/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2022-12-28 /srv/gems/pork-2.1.0/lib/pork/extra/show_source.rb:      lowers = test.source_location.last
2023-01-06 /srv/gems/takuya-lvm-snapshot-0.1.0/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations/block_snippet_extractor.rb:        source_location.last
2023-03-04 /srv/gems/blinka-reporter-0.8.0/lib/blinka_reporter/minitest_adapter.rb:      @line ||= source_location.last
2023-09-05 /srv/gems/web-console-4.2.1/lib/web_console/source_location.rb:      def lineno() @binding.source_location.last end
2023-12-18 /srv/gems/ali-cli-0.0.2/lib/ali/template.rb:    Rouge.highlight "\n#{"".ljust(indent, " ")}# #{task_path}:#{source_location.last}\n#{source}", lexer, formatter
2023-12-18 /srv/gems/builder_apm-0.5.14/lib/builder_apm/controllers/instrumenter.rb:          line_number = method_info.source_location.last
2023-12-18 /srv/gems/constrain-0.10.0/lib/constrain.rb:      when Proc; "Proc@#{expr.source_location.first}:#{expr.source_location.last}"
2024-02-11 /srv/gems/prawn-manual_builder-0.4.0/lib/prawn/manual_builder/chapter.rb:          block_source_line = example.source_location.last
2024-07-10 /srv/gems/curlybars-1.12.0/lib/curlybars/rendering_support.rb:        line_number = source_location ? helper.source_location.last : "n/a"
2024-09-16 /srv/gems/minitest-distributed-0.2.11/lib/minitest/distributed/reporters/junitxml_reporter.rb:            lineno = test.source_location.last
2025-01-07 /srv/gems/lazy_graph-0.2.0/lib/lazy_graph/node/derived_rules.rb:            derived.source_location.last + offset
2025-01-07 /srv/gems/lazy_graph-0.2.0/lib/lazy_graph/node/derived_rules.rb:            proc_line = source_location.last - 1
2025-08-08 /srv/gems/openstudio-common-measures-0.12.3/lib/measures/envelope_and_internal_load_breakdown/measure.rb:      method_hash[section.to_s] = OsLib_ReportingHeatGainLoss.method(section).source_location.last
2025-08-08 /srv/gems/openstudio-common-measures-0.12.3/lib/measures/example_report/measure.rb:      method_hash[section.to_s] = OsLib_Reporting_example.method(section).source_location.last
```

In any case it's a tiny fraction of e.g. the change in 3.4 for backtraces from `foo' to 'Module#foo'.

In https://bugs.ruby-lang.org/issues/21777#note-7 you write:
> Is this incompatibility really ok? I feel it is disproportionately incompatible for unclear use cases.

Why don't you consider the gems that need this functionality `method_source` (700 million downloads) and `proc_to_ast` (71 million downloads) as valid use cases?
Clearly people use them.
Currently `method_source` which defines `Method#source` works around by parsing from the start line and adding an extra line one by one until valid:
https://github.com/banister/method_source/blob/06f21c66380c64ff05c8031c0208eef240da0e83/lib/method_source/code_helpers.rb#L95-L98
This is obviously hacky (but there was no better way before this), and wouldn't work with multiple `def` on the same line.

`proc_to_ast` currently uses the `parser` gem to find the block at the given line but fails if there are multiple blocks at that line.
This functionality will fix that: https://github.com/joker1007/proc_to_ast/issues/5

This is already plenty of use cases I think, but additionally we also discussed:
* It would enabling fixing the issue with `power_assert` with 2 `assert` on the same line: https://bugs.ruby-lang.org/issues/21783#note-21. It might also help `power_assert` to support multi-line blocks, which is a pretty big limitation.
* It enables to implement `Prism.node_for` (https://bugs.ruby-lang.org/issues/21005#note-5) and similar functionality in a portable-across-Ruby-implementations way, so it's both useful directly and indirectly. #21795 would also solve that, but not necessarily the other use cases above, which don't all need the AST (e.g. `Method#source`, which e.g. can be useful to just show the source of a method for documentation, debugging, etc).

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115975

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124430] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (16 preceding siblings ...)
  2026-01-07 11:31 ` [ruby-core:124426] " Eregon (Benoit Daloze) via ruby-core
@ 2026-01-07 11:54 ` mame (Yusuke Endoh) via ruby-core
  2026-01-07 12:07 ` [ruby-core:124431] " mame (Yusuke Endoh) via ruby-core
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2026-01-07 11:54 UTC (permalink / raw)
  To: ruby-core; +Cc: mame (Yusuke Endoh)

Issue #6012 has been updated by mame (Yusuke Endoh).


Eregon (Benoit Daloze) wrote in #note-44:
> mame (Yusuke Endoh) wrote in #note-43:
> Why don't you consider the gems that need this functionality `method_source` (700 million downloads) and `proc_to_ast` (71 million downloads) as valid use cases?

First, I suspect that what many users of `method_source` gem actually need is the AST. The proposal #21005 itself demonstrates this.

I recognize the use case of retrieving the AST subtree corresponding to some kinds of Ruby objects. However, `source_location` is not an appropriate key to look up the AST subtree corresponding to a Ruby object. At least for CRuby, `node_id` should be used, though I don't say you should implement `node_id` in TruffleRuby. 

Therefore, the valid use case for `source_location` itself is not clear yet, IMO.

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115979

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124431] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (17 preceding siblings ...)
  2026-01-07 11:54 ` [ruby-core:124430] " mame (Yusuke Endoh) via ruby-core
@ 2026-01-07 12:07 ` mame (Yusuke Endoh) via ruby-core
  2026-01-07 12:44 ` [ruby-core:124433] " Eregon (Benoit Daloze) via ruby-core
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2026-01-07 12:07 UTC (permalink / raw)
  To: ruby-core; +Cc: mame (Yusuke Endoh)

Issue #6012 has been updated by mame (Yusuke Endoh).


Note that there is also an idiom like `foo(*obj.source_location)`, not just `source_location.last`. By checking the result of "gem-codesearch", we see not only `@binding.source_location` but also `@proc.source_location`. I am not sure if these are actually affected, though.
I guess there are probably other affected code patterns.

```
$ gem-codesearch -f rb "\\(.*\\*.*\\.source_location[^\\[]"
1980-01-02 /srv/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/web-console-4.2.1/lib/web_console/evaluator.rb:        "=> #{@binding.eval(input, *@binding.source_location).inspect}\n"
1980-01-02 /srv/gems/alchemy_i18n-5.0.1/vendor/bundle/ruby/4.0.0/gems/alchemy_cms-8.0.2/vendor/bundle/ruby/3.4.0/gems/web-console-4.2.1/lib/web_console/evaluator.rb:        "=> #{@binding.eval(input, *@binding.source_location).inspect}\n"
2017-06-09 /srv/gems/aristotle-0.3.0/lib/aristotle/presenter.rb:      code = find_code(*proc.source_location) || 'no code found'
2025-12-10 /srv/gems/cucumber-10.2.0/lib/cucumber/glue/hook.rb:        @location = Cucumber::Core::Test::Location.from_source_location(*@proc.source_location)
2025-12-10 /srv/gems/cucumber-10.2.0/lib/cucumber/glue/registry_and_more.rb:      location = Cucumber::Core::Test::Location.from_source_location(*proc.source_location)
2025-12-10 /srv/gems/cucumber-10.2.0/lib/cucumber/glue/step_definition.rb:        @location ||= Cucumber::Core::Test::Location.from_source_location(*@proc.source_location)
2010-04-06 /srv/gems/dde-0.2.11/spec/spec_helper.rb:    it description_from(caller[0]), &block # it description_from(*block.source_location), &block
2010-01-16 /srv/gems/git_hub-0.3.0/spec/spec_helper.rb:    it description_from(*block.source_location), &block
2017-04-17 /srv/gems/ikra-0.0.2/lib/sourcify/lib/sourcify/method/parser.rb:        @source_code = SourceCode.new(*_meth.source_location)
2017-04-17 /srv/gems/ikra-0.0.2/lib/sourcify/lib/sourcify/proc/parser.rb:        @arity, @source_code = _proc.arity, SourceCode.new(*_proc.source_location(false))
1980-01-02 /srv/gems/irb-kit-2.0.0/lib/irb/kit/handlers/method_editor.rb:          editor.call(*object.method(name).source_location)
2017-12-11 /srv/gems/lab42_core-0.5.1/lib/lab42/core/kernel.rb:    dir = File.expand_path File.join( '..', blk.(), '*.rb'), blk.source_location.first
2011-08-02 /srv/gems/live_ast-1.0.2/lib/live_ast/base.rb:        Linker.find_method_ast(obj.owner, obj.name, *obj.source_location)
2011-08-02 /srv/gems/live_ast-1.0.2/lib/live_ast/linker.rb:            ast = find_ast(*obj.source_location) or raise ASTNotFoundError
2016-10-31 /srv/gems/mobiusloop-0.1.5/lib/cucumber/filters/prepare_world.rb:          empty_hook_location = Cucumber::Core::Ast::Location.from_source_location(*empty_hook.source_location)
2016-10-31 /srv/gems/mobiusloop-0.1.5/lib/cucumber/rb_support/rb_hook.rb:        @location = Cucumber::Core::Ast::Location.from_source_location(*@proc.source_location)
2016-10-31 /srv/gems/mobiusloop-0.1.5/lib/cucumber/rb_support/rb_language.rb:      location = Cucumber::Core::Ast::Location.from_source_location(*proc.source_location)
2016-10-31 /srv/gems/mobiusloop-0.1.5/lib/cucumber/rb_support/rb_step_definition.rb:        @location ||= Cucumber::Core::Ast::Location.from_source_location(*@proc.source_location)
1980-01-02 /srv/gems/mvz-live_ast-2.3.0/lib/live_ast/base.rb:        Linker.find_method_ast(obj.owner, obj.name, *obj.source_location)
1980-01-02 /srv/gems/mvz-live_ast-2.3.0/lib/live_ast/linker.rb:            ast = find_ast(*obj.source_location) or raise ASTNotFoundError
2025-12-02 /srv/gems/openproject-primer_view_components-0.78.1/app/lib/primer/experimental_render_helpers.rb:        return yield(*args, **kwargs) if block&.source_location.nil?
2025-12-03 /srv/gems/primer_view_components-0.48.0/app/lib/primer/experimental_render_helpers.rb:        return yield(*args, **kwargs) if block&.source_location.nil?
2024-12-30 /srv/gems/r_spec-clone-1.7.2/lib/r_spec/clone/dsl.rb:        Logger.source(*block.source_location)
2024-12-30 /srv/gems/r_spec-clone-1.7.2/lib/r_spec/clone/dsl.rb:        Logger.source(*block.source_location)
2010-09-06 /srv/gems/remote_logger-0.0.5/spec/spec_helper.rb:    it description_from(*block.source_location), &block
2017-02-23 /srv/gems/respectable-0.3.3/lib/respectable.rb:        instance_eval(<<-IT, *block.source_location)
2017-02-23 /srv/gems/respectable-0.3.3/lib/respectable.rb:            eval(block.source, binding, *block.source_location)
2025-10-19 /srv/gems/scrapbook-0.4.0/vendor/ruby/2.7.0/gems/irb-1.4.1/lib/irb/workspace.rb:        @binding = eval("IRB.conf[:__MAIN__].instance_eval('binding', __FILE__, __LINE__)", @binding, *@binding.source_location)
1980-01-02 /srv/gems/showcase-rails-0.5.0/app/models/showcase/sample.rb:    source = extract_source_block_via_matched_indentation_from(*block.source_location)
2011-05-02 /srv/gems/sourcify-0.5.0/lib/sourcify/proc/parser.rb:        @arity, @source_code = _proc.arity, SourceCode.new(*_proc.source_location(false))
2018-11-12 /srv/gems/suture-1.1.2/lib/suture/error/verification_failed.rb:        "Proc # (in: `#{describe_source_location(*comparator.source_location)}`)"
2018-11-12 /srv/gems/suture-1.1.2/lib/suture/error/verification_failed.rb:        "#{comparator.inspect}.new, # (in: `#{describe_source_location(*comparator.method(:call).source_location)}`)"
2018-02-12 /srv/gems/tuttle-0.0.8/app/views/tuttle/rack_attack/index.html.erb:      <dd><%= display_source_locaction(*Rack::Attack.blocklisted_response.source_location) %></dd>
2018-02-12 /srv/gems/tuttle-0.0.8/app/views/tuttle/rack_attack/index.html.erb:      <dd><%= display_source_locaction(*Rack::Attack.throttled_response.source_location) %></dd>
2018-02-12 /srv/gems/tuttle-0.0.8/app/views/tuttle/rack_attack/index.html.erb:                <%= display_source_locaction(*throttle.limit.source_location)  %>
2018-02-12 /srv/gems/tuttle-0.0.8/app/views/tuttle/rack_attack/index.html.erb:                <%= display_source_locaction(*throttle.period.source_location)  %>
2018-02-12 /srv/gems/tuttle-0.0.8/app/views/tuttle/rack_attack/index.html.erb:              <%= display_source_locaction(*throttle.block.source_location) %>
2018-02-12 /srv/gems/tuttle-0.0.8/app/views/tuttle/rack_attack/index.html.erb:          <td><%= display_source_locaction(*safelist.block.source_location) %></td>
2018-02-12 /srv/gems/tuttle-0.0.8/app/views/tuttle/rack_attack/index.html.erb:            <td><%= display_source_locaction(*blocklists.block.source_location) %></td>
2018-02-12 /srv/gems/tuttle-0.0.8/app/views/tuttle/rack_attack/index.html.erb:              <td><%= display_source_locaction(*track.filter.block.source_location)  rescue 'No Source Location' %></td>
2018-02-12 /srv/gems/tuttle-0.0.8/app/views/tuttle/rack_attack/index.html.erb:            <td><%= display_source_locaction(*listener.instance_variable_get(:@delegate).source_location) rescue 'Unknown'   %></td>
2018-02-12 /srv/gems/tuttle-0.0.8/app/views/tuttle/rails/index.html.erb:          <td colspan="4"><code><%= display_source_locaction(*k.source_location) %></code></td>
2018-02-12 /srv/gems/tuttle-0.0.8/app/views/tuttle/rails/index.html.erb:              <td colspan="4"><code><%= display_source_locaction(*k.source_location) %></code></td>
2023-09-05 /srv/gems/web-console-4.2.1/lib/web_console/evaluator.rb:        "=> #{@binding.eval(input, *@binding.source_location).inspect}\n"
2011-11-11 /srv/gems/win-0.3.27/spec/spec_helper.rb:    it description_from(caller[0]), &block # it description_from(*block.source_location), &block
2011-11-11 /srv/gems/win_gui-0.2.21/spec/spec_helper.rb:    it description_from(*block.source_location), &block
```

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115980

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124433] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (18 preceding siblings ...)
  2026-01-07 12:07 ` [ruby-core:124431] " mame (Yusuke Endoh) via ruby-core
@ 2026-01-07 12:44 ` Eregon (Benoit Daloze) via ruby-core
  2026-01-07 14:18 ` [ruby-core:124435] " mame (Yusuke Endoh) via ruby-core
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2026-01-07 12:44 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #6012 has been updated by Eregon (Benoit Daloze).


mame (Yusuke Endoh) wrote in #note-45:
> First, I suspect that what many users of `method_source` gem actually need is the AST.

Many yes but not all, maybe even only a minority (see below).
The fact there is `Method#source` indicates that some usages only want the code, and don't need to parse it.
If it was all, there likely wouldn't be `Method#source`, but another method to return the (e.g. parser gem) AST directly then.

A quick search shows some examples which do not use an AST:
https://github.com/search?q=language%3ARuby+%2F%28method%7Cmeth%29%5C.source%5Cb%2F&type=code
```ruby
# spree/spree
    obj_method.source.squish[/(expect *({|do) *)(.*?)( *(}|end).(not_)*to)/, 3]
# evilmartians/terraforming-rails, perfect use case for end_line in source_location
        # Uses `method_source` to get the source code and the number of lines
        meth.source_location.last..(meth.source_location.last + meth.source.lines.size)
# pry/pry-git
        final_code = before_code << meth.source.lines.to_a << after_code
# Darkmux/cyberspy, seems pry related, makes sense to be able to show the source of a method/block in a REPL
        new(meth.source, start_line, meth.source_type)
# rambler-digital-solutions/rusby, the preprocessor acts on the code String, not an AST
        Preprocessor.apply(orig_method.source),
# tdg5/tco_method
      code = <<-CODE
        #{receiver_class} #{receiver.name}
          #{existing_method.source}
        end
      CODE
# garmoshka-mo/pry-moves, perfect use case for end_line in source_location
        end: (source[1] + method.source.count("\n") - 1)
# SyborgStudios/overrides_tracker
    def self.outdented_method_body(method)
      body = method.source
      indent = body.match(/^\W+/).to_s
# rpanachi/core_ext, perfect use case for end_line in source_location
              end_line = method.source.count("\n") + start_line - 1
# annkissam/scryglass
            method_lines = Hexes.capture_io { puts method.source }.split("\n")
# callstacking/callstacking-rails, seems like it adds extra code to instrument, no AST, no dependency on parser
            method_source = method(__method__).super_method.source if settings.analyze_source?
# jeromedalbert/rubocop-obsession
                corrector.replace(method, method.source.sub(method.method_name.to_s, 'perform'))
# geni/sweatshop, perfect use case for end_line in source_location
        end_line = method.source.count("\n") + start_line + 1
# Auralcat/my-dotfiles
# Display source code quickly in IRB.
def srd(method)
   method.source.display
end
```
and that's only the examples from the first page.
In fact a majority of the matches in that first page seem to not use an AST, so I'm not even sure the majority of uses cases need the AST.

Finding the `end_line` of a method seems a recurrent need, this is now provided with the extended `source_location`.

---

> However, `source_location` is not an appropriate key to look up the AST subtree corresponding to a Ruby object.

I believe it is though, with the knowledge of what kind of node we are looking for.
For example in `def foo; bar; end`, `bar` in the AST is covered exactly by both a `StatementsNode` and a `CallNode`.
If we are using `Thread::Backtrace::Location#ast` we'd want the location of the call to `bar`, so we know we want the `CallNode`, not the `StatementsNode` and there is no ambiguity.
I believe the same holds for all 5 methods proposed in #21795.
My intuition there is all nodes listed in https://bugs.ruby-lang.org/issues/21795#note-2 cannot have the exact same `source_location` (e.g. we cannot have code with the same starting and ending position that is two of `DefNode`, `LambdaNode`, `ForNode`, `Call*Node`, `Index*Node`, `YieldNode`).
Do you have a counter-example where this wouldn't hold?

In fact if #21795 is accepted I do plan to implement it in TruffleRuby based on byte offsets in the source, which are equivalent to line+column start/end.



----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115982

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124435] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (19 preceding siblings ...)
  2026-01-07 12:44 ` [ruby-core:124433] " Eregon (Benoit Daloze) via ruby-core
@ 2026-01-07 14:18 ` mame (Yusuke Endoh) via ruby-core
  2026-01-07 15:37 ` [ruby-core:124438] " Eregon (Benoit Daloze) via ruby-core
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2026-01-07 14:18 UTC (permalink / raw)
  To: ruby-core; +Cc: mame (Yusuke Endoh)

Issue #6012 has been updated by mame (Yusuke Endoh).


> A quick search shows some examples which do not use an AST:

A "use case" is the ultimate goal that the examples aim to achieve via `Method#source`.

By the way, I tried the `method_source` gem, and I noticed that it includes heredoc content that lies outside the method definition block.

```ruby
require "method_source"

def foo; <<END; end
FOO
END

p method(:foo).source          #=> "def foo; <<END; end\nFOO\nEND\n"
p method(:foo).source_location #=> ["/tmp/t.rb", 3, 0, 3, 19]
```

On the other hand, the current `source_location` (as shown above) only includes the range of `def ... end`.

I am not arguing that `source_location` needs to be fixed. My point is that the "better" return value depends entirely on the final use case.

If the goal of `Method#source` is to return a parsable code fragment (I don't know if that is the official goal), then its current behavior might be expected.
However, since @eregon seems to want to use `source_location` to identify AST subtrees, `source_location` should not be fine-tuned for one specific use case.

I don't think there is a single, perfect "correct" `source_location` that everyone can agree on. It will likely vary depending on the ultimate use case.
Instead, I believe users should extract the AST and decide for themselves what location information to obtain.

> Do you have a counter-example where this wouldn't hold?

I don't have one at present. However, such a case could arise through future extensions.
For example, @ko1 might add a new TracePoint type in the future, and depending on the type, it might be necessary to distinguish between `StatementsNode` and `CallNode`.

More importantly, CRuby can implement `Prism.node_for` using `node_id` without the risk of future ambiguity.
There is no reason to implement such a heuristic hack that tries to select overlapping nodes based on Ruby object type.

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115984

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124438] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (20 preceding siblings ...)
  2026-01-07 14:18 ` [ruby-core:124435] " mame (Yusuke Endoh) via ruby-core
@ 2026-01-07 15:37 ` Eregon (Benoit Daloze) via ruby-core
  2026-01-08 22:01 ` [ruby-core:124460] " mame (Yusuke Endoh) via ruby-core
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 25+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2026-01-07 15:37 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #6012 has been updated by Eregon (Benoit Daloze).


mame (Yusuke Endoh) wrote in #note-48:
> A "use case" is the ultimate goal that the examples aim to achieve via `Method#source`.

The above snippets show examples of source transformation, instrumentation of code by adding extra code in the method body, displaying the source code of a method to the user, and other use cases which would need more time to find out.
In any case I don't think it's our place to judge whether each usage is "valid" or "correct" or not, it's definitely useful functionality since it's used so much.
For example, some gems might transform the source code of a method as a string, you might argue it's less safe but it's also much simpler than parsing + unparsing and it obviously works well enough for them.

> By the way, I tried the `method_source` gem, and I noticed that it includes heredoc content that lies outside the method definition block.

I think that's just a side effect of `method_source` currently adding lines until it's valid Ruby source code.
In practice I think there are very few heredocs like this for methods, so it probably does not matter for 99.99% cases.

Note that the current `method_source` approach is much worse than using the new `source_location`, because it's incorrect for e.g.
```ruby
def method
end; any code
```
e.g.
```ruby
def foo
end; def bar
end
```
where it would return the entire code for the source of `foo`.

This is much more common than heredocs spanning across `end`.
For example this is common in tests:
```ruby
def some_test
  some assertions
end unless /mswin|mingw/ =~ RUBY_PLATFORM
```
The gem currently return the entire snippet, but with `source_location` it would be correct and stop at `end`

> My point is that the "better" return value depends entirely on the final use case.

Yes, that's fair but that edge case is very rare.
For the final use case of getting an AST, `Prism.node_for(Method)` or `Method#ast` is more direct and works even for that edge case.
For the final use case of displaying the method source code it seems nicer to include the heredoc, and OTOH that is somewhat complicated and unintuitive to do from the AST.

> > Do you have a counter-example where this wouldn't hold?
> 
> I don't have one at present. However, such a case could arise through future extensions.
> For example, @ko1 might add a new TracePoint type in the future, and depending on the type, it might be necessary to distinguish between `StatementsNode` and `CallNode`.

#21795 is specifically about call/return TracePoint, so that's not an issue.
I don't think anyone would ever want to get a `StatementsNode` from some `#ast` method, that's "invisible" in user code (IOW, it doesn't "consume" characters in the source to exist).
So I think for every node that "consumes" characters in the source to exist there is no problem, it's uniquely identified by start/end line/column.

> More importantly, CRuby can implement `Prism.node_for` using `node_id` without the risk of future ambiguity.
> There is no reason to implement such a heuristic hack that tries to select overlapping nodes based on Ruby object type.

IMO using `node_id` is a hack, and my implementation of `Prism.node_for` in https://github.com/ruby/prism/pull/3808 is AFAIK fully correct and portable (does not depend on CRuby internals, can easily be supported by all Ruby implementations through the extended `source_location` from this issue).
There is no "heuristic hack", it's the fully correct and deterministic decision in this context.
Nobody expects the `StatementsNode` instead of the `CallNode` for `Prism.node_for(Proc)`.

That implementation also works even with `--parser=parse.y`, while it wouldn't if it were using `node_id`.
This is a good illustration that start/end line/column are more universal and well-defined, unlike `node_id` which is dependent on the parser and order-of-iteration.

I do agree with you that for final use case of getting a Prism AST, #21795 would be more direct and safer (e.g. can check hash of the file).
And there it's totally fine to use `node_id` internally on CRuby, as it remains an implementation detail not exposed to the user.
So I'd be happy if you help me get that issue approved.

But there are other use cases for `source_location` to include end line and start/end column as shown in my previous comment, and the current implementation meets them well, except for very rare edge cases where as you say, there is no correct or wrong way.

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-115987

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124460] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (21 preceding siblings ...)
  2026-01-07 15:37 ` [ruby-core:124438] " Eregon (Benoit Daloze) via ruby-core
@ 2026-01-08 22:01 ` mame (Yusuke Endoh) via ruby-core
  2026-01-09 14:46 ` [ruby-core:124464] " Eregon (Benoit Daloze) via ruby-core
  2026-01-09 14:55 ` [ruby-core:124465] " Eregon (Benoit Daloze) via ruby-core
  24 siblings, 0 replies; 25+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2026-01-08 22:01 UTC (permalink / raw)
  To: ruby-core; +Cc: mame (Yusuke Endoh)

Issue #6012 has been updated by mame (Yusuke Endoh).


Eregon (Benoit Daloze) wrote in #note-49:
> In any case I don't think it's our place to judge whether each usage is "valid" or "correct" or not, it's definitely useful functionality since it's used so much.

"I don't know exactly what users are using the `method_source` gem for, but since it's used so much, we should provide equivalent functionality as a built-in feature"

This argument can hardly persuade anyone... However, let’s assume we proceed with that logic. In that case, `source_location` would have to follow the behavior of the `method_source` gem exactly, without questioning its validity (including heredocs and the glitch-like behavior you pointed out). Since we do not know the user's ultimate purpose, there is a possibility that those glitch-like behaviors happen to be exactly what satisfies the user.

Is that really what you want?

> Nobody expects the `StatementsNode` instead of the `CallNode` for `Prism.node_for(Proc)`.

To give an extreme example, suppose we implement a TracePoint like `:ast_node_enter` that fires every time the interpreter evaluates each Prism node (as like a tree-walking interpreter). In that scenario, `Prism.node_for(TracePoint)` would need to distinguish between a `StatementsNode` and a `CallNode`.
Also, Ruby's grammar will certainly continue to change, and I have no doubt that the instances of overlapping Nodes, beyond just `StatementsNode` and `CallNode`, can increase accordingly.

> I do agree with you that for final use case of getting a Prism AST, #21795 would be more direct and safer (e.g. can check hash of the file).
> And there it's totally fine to use `node_id` internally on CRuby, as it remains an implementation detail not exposed to the user.

I agree with this. While #21795 seems like a heavy task with many issues to resolve, I think it is a sound approach in the sense that it is better to hide the implementation details of how to map Ruby objects to AST nodes.

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-116011

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124464] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (22 preceding siblings ...)
  2026-01-08 22:01 ` [ruby-core:124460] " mame (Yusuke Endoh) via ruby-core
@ 2026-01-09 14:46 ` Eregon (Benoit Daloze) via ruby-core
  2026-01-09 14:55 ` [ruby-core:124465] " Eregon (Benoit Daloze) via ruby-core
  24 siblings, 0 replies; 25+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2026-01-09 14:46 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #6012 has been updated by Eregon (Benoit Daloze).


mame (Yusuke Endoh) wrote in #note-50:
> "I don't know exactly what users are using the `method_source` gem for, but since it's used so much, we should provide equivalent functionality as a built-in feature"
> 
> This argument can hardly persuade anyone... However, let’s assume we proceed with that logic. In that case, `source_location` would have to follow the behavior of the `method_source` gem exactly, without questioning its validity (including heredocs and the glitch-like behavior you pointed out). Since we do not know the user's ultimate purpose, there is a possibility that those glitch-like behaviors happen to be exactly what satisfies the user.
> 
> Is that really what you want?

Of course there is nuance there.
I think the high usage of that gem means that some functionality there is found useful by many.
I think looking a bit further than the number of usages to what the usages look like I did in https://bugs.ruby-lang.org/issues/6012#note-47 is good.
I think knowing the exact ultimate purpose of each usage is unnecessary and would require way too much work, and that this grouping of some ultimate purposes is enough:
> The above snippets show examples of source transformation, instrumentation of code by adding extra code in the method body, displaying the source code of a method to the user, and other use cases which would need more time to find out.

Also the analysis above showing e.g. having `end_line` is a recurrent need.

That is I believe enough to justify the extended `source_location`, and the fact #21795 doesn't address some of these usages (or would it be a roundabout/inefficient way to get that information).

Separately, the fact this has been asked 14 years ago and lots of people want it (in this and related issues), and that there seems to be no significant downside to it is IMO enough.

Also, I find it weird that you question (a lot) the need for it now, when it has already been approved a year ago: https://bugs.ruby-lang.org/issues/6012#note-25
And approved again in https://github.com/ruby/ruby/pull/15580#issuecomment-3691058342.

The change has been in master for a year, no compatibility concern has been raised, so why be so worried now when it was the same a year ago?

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-116015

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [ruby-core:124465] [Ruby Feature#6012] Proc#source_location also return the column
       [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
                   ` (23 preceding siblings ...)
  2026-01-09 14:46 ` [ruby-core:124464] " Eregon (Benoit Daloze) via ruby-core
@ 2026-01-09 14:55 ` Eregon (Benoit Daloze) via ruby-core
  24 siblings, 0 replies; 25+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2026-01-09 14:55 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #6012 has been updated by Eregon (Benoit Daloze).


mame (Yusuke Endoh) wrote in #note-50:
> Also, Ruby's grammar will certainly continue to change, and I have no doubt that the instances of overlapping Nodes, beyond just `StatementsNode` and `CallNode`, can increase accordingly.

Maybe, but this does not matter for this feature.
A {Method,UnboundMethod,Proc}#source_location will remain the same regardless of the number of overlapping Nodes.
There are many use cases and ultimate purposes that are treating the source of a method/block as a string to e.g. print the source of the method/block, or inject extra code in it.
I believe those are valid, even if they don't work in some weird edge case (heredoc across end).
Requiring e.g. parsing + unparsing for every code transformation/instrumentation is too heavy, many use cases don't need that.

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-116016

* Author: rogerdpack (Roger Pack)
* Status: Closed
* Assignee: nobu (Nobuyoshi Nakada)
----------------------------------------
As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418

Suggestion/feature request:
have #source_location also return the beginning column where it was defined.
["test.rb", 8, 33]

Thanks!
-roger-




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2026-01-09 14:55 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-6012.20120214091730.59@ruby-lang.org>
2024-09-27 15:06 ` [ruby-core:119320] [Ruby master Feature#6012] Proc#source_location also return the column Eregon (Benoit Daloze) via ruby-core
2024-09-27 15:21 ` [ruby-core:119322] " Eregon (Benoit Daloze) via ruby-core
2025-01-05 14:05 ` [ruby-core:120485] " Eregon (Benoit Daloze) via ruby-core
2025-01-05 21:06 ` [ruby-core:120489] " bkuhlmann (Brooke Kuhlmann) via ruby-core
2025-01-09 11:26 ` [ruby-core:120566] " nobu (Nobuyoshi Nakada) via ruby-core
2025-01-09 11:51 ` [ruby-core:120572] " mame (Yusuke Endoh) via ruby-core
2025-01-09 14:31 ` [ruby-core:120576] " Eregon (Benoit Daloze) via ruby-core
2025-01-09 15:55 ` [ruby-core:120581] " Dan0042 (Daniel DeLorme) via ruby-core
2025-12-16  2:43 ` [ruby-core:124220] [Ruby " matz (Yukihiro Matsumoto) via ruby-core
2025-12-16  9:42 ` [ruby-core:124229] " mame (Yusuke Endoh) via ruby-core
2025-12-16 10:16 ` [ruby-core:124232] " Eregon (Benoit Daloze) via ruby-core
2025-12-16 11:25 ` [ruby-core:124234] " vo.x (Vit Ondruch) via ruby-core
2025-12-16 11:26 ` [ruby-core:124235] " vo.x (Vit Ondruch) via ruby-core
2025-12-16 12:20 ` [ruby-core:124240] " Eregon (Benoit Daloze) via ruby-core
2025-12-24 13:36 ` [ruby-core:124355] " matz (Yukihiro Matsumoto) via ruby-core
2026-01-07  0:17 ` [ruby-core:124421] " mame (Yusuke Endoh) via ruby-core
2026-01-07 11:31 ` [ruby-core:124426] " Eregon (Benoit Daloze) via ruby-core
2026-01-07 11:54 ` [ruby-core:124430] " mame (Yusuke Endoh) via ruby-core
2026-01-07 12:07 ` [ruby-core:124431] " mame (Yusuke Endoh) via ruby-core
2026-01-07 12:44 ` [ruby-core:124433] " Eregon (Benoit Daloze) via ruby-core
2026-01-07 14:18 ` [ruby-core:124435] " mame (Yusuke Endoh) via ruby-core
2026-01-07 15:37 ` [ruby-core:124438] " Eregon (Benoit Daloze) via ruby-core
2026-01-08 22:01 ` [ruby-core:124460] " mame (Yusuke Endoh) via ruby-core
2026-01-09 14:46 ` [ruby-core:124464] " Eregon (Benoit Daloze) via ruby-core
2026-01-09 14:55 ` [ruby-core:124465] " Eregon (Benoit Daloze) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).