[ruby-core:95895] [Ruby master Feature#16101] Proc#to_s returns "... file:line" instead of "...@file:line"
From:
zn@...
Date:
2019-11-20 10:17:40 UTC
List:
ruby-core #95895
Issue #16101 has been updated by znz (Kazuhiro NISHIYAMA).
Status changed from Assigned to Closed
https://github.com/seattlerb/minitest/pull/798 is closed.
----------------------------------------
Feature #16101: Proc#to_s returns "... file:line" instead of "...@file:line"
https://bugs.ruby-lang.org/issues/16101#change-82734
* Author: ko1 (Koichi Sasada)
* Status: Closed
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* Target version:
----------------------------------------
In [Feature #14145],
https://bugs.ruby-lang.org/issues/14145#note-25
> I think (a space) is better, and it's what we use for Method#inspect in TruffleRuby.
> My motivation is that selection by double-clicking in the terminal just works with a space,
> but fails with @ and results in 0x00007f850b8f9458@-e when double-clicking on the filename (-e here).
> I find it also easier to read.
I try to introduce this change (`@` -> ` `).
# Compatibility issue
Someone can depend on this string format. In fact, rubygems requires this patch.
```
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index b230ce7bed..554cfc4509 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -370,7 +370,7 @@ def run_post_build_hooks # :nodoc:
if hook.call(self) == false
FileUtils.rm_rf gem_dir
- location = " at #{$1}" if hook.inspect =~ /@(.*:\d+)/
+ location = " at #{$1}" if hook.inspect =~ / (.*:\d+)/
message = "post-build hook#{location} failed for #{spec.full_name}"
raise Gem::InstallError, message
```
But I think we shouldn't use this string, but use `source_location` method.
I'll commit it. and if you have an issue, pls re-open it.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>