[#68137] improve semantics of manpages — "Anthony J. Bentley" <anthony@...>
Hi,
1 message
2015/02/17
[#68144] Re: Future of test suites for Ruby — Anthony Crumley <anthony.crumley@...>
FYI...
4 messages
2015/02/17
[#68343] [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault? — ruby@...
Issue #10916 has been reported by why do i need this acct just to create a bug report.
5 messages
2015/02/27
[#68373] Re: [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault?
— "Martin J. Dürst" <duerst@...>
2015/03/02
> * Author: why do i need this acct just to create a bug report
[#68358] [Ruby trunk - Bug #10902] require("enumerator") scans LOAD_PATH 2x on every invocation — [email protected]
Issue #10902 has been updated by Aman Gupta.
3 messages
2015/02/28
[ruby-core:67986] [ruby-trunk - Bug #10561] Improve function of Thread::Backtrace::Location #path and #absolute_path
From:
yorickpeterse@...
Date:
2015-02-03 22:27:27 UTC
List:
ruby-core #67986
Issue #10561 has been updated by Yorick Peterse.
Nobu: I talked about this with Koichi today after noticing you added tests for
path/absolute_path after my talk at FOSDEM. Since these tests assert that path
returns the full path I'd like to know which one is correct.
Is it this:
caller_locations[0].path # => "example.rb"
Or is this the correct way:
caller_locations[0].path # => "/home/some-user/example.rb"
If the last example is correct, is it perhaps an idea to add "basename" to
Thread::Location::Backtrace, which would return _just_ the filename, and make
path an alias to absolute_path? So:
caller_locations[0].path # => "/home/some-user/example.rb"
caller_locations[0].absolute_path # => "/home/some-user/example.rb"
caller_locations[0].basename # => "example.rb"
----------------------------------------
Bug #10561: Improve function of Thread::Backtrace::Location #path and #absolute_path
https://bugs.ruby-lang.org/issues/10561#change-51373
* Author: Sam Saffron
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: 2.2.0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
I was working on this issue in Rails and hit an area where Backtrace Location can be improved
https://github.com/rails/rails/pull/17782
1. It is undefined in the documentation how #absolute_path should operate when #path is invalid (in case of instance eval)
2. There are a few conditions where #path and #absolute_path can return nil, this forces extra protection code when parsing paths to check for nil. (for example getting filename)
Suggestions:
1. Instead of returning Qnil from location_path and location_absolute_path on invalid conditions, return the string "(unknown)" which is easier to parse and sticks out better in a big backtrace. There is precedent here with the string "(eval)"
2. If path is invalid have absolute_path return "(unknown)", define that in the documentation
3. (possible) add an additional method on caller_location called #filename so people stop parsing filename from #path and #absolute_path
4. Evaluate if it makes sense to have #path and #absolute_path in the API as both methods can return full paths so the semantic difference is subtle.
--
https://bugs.ruby-lang.org/