[#106341] [Ruby master Bug#18369] users.detect(:name, "Dorian") as shorthand for users.detect { |user| user.name == "Dorian" } — dorianmariefr <noreply@...>
Issue #18369 has been reported by dorianmariefr (Dorian Mari辿).
14 messages
2021/11/30
[#106351] [Ruby master Bug#18371] Release branches (release information in general) — "tenderlovemaking (Aaron Patterson)" <noreply@...>
Issue #18371 has been reported by tenderlovemaking (Aaron Patterson).
7 messages
2021/11/30
[ruby-core:106008] [Ruby master Bug#18296] Custom exception formatting should override `Exception#full_message`.
From:
"ioquatix (Samuel Williams)" <noreply@...>
Date:
2021-11-10 11:49:32 UTC
List:
ruby-core #106008
Issue #18296 has been reported by ioquatix (Samuel Williams).
----------------------------------------
Bug #18296: Custom exception formatting should override `Exception#full_message`.
https://bugs.ruby-lang.org/issues/18296
* Author: ioquatix (Samuel Williams)
* Status: Open
* Priority: Normal
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
After discussing with @eregon, we came to the conclusion that the current implementation of `did_you_mean` and `error_highlighter` could avoid many issues by using `Exception#full_message`.
We propose to introduce a more nuanced interface:
```ruby
class Exception
def full_message(highlight: bool, order: [:top or :bottom], **options)
# ...
end
end
module DidYouMean
class Formatter
def full_message(highlight:, did_you_mean: true/false, **options)
buffer = super(highlight: highlight, **options).dup
buffer << "extra stuff"
end
end
end
module ErrorHighlighter
class Formatter
def full_message(highlight:, error_highlighter: true/false, **options)
# same as above
end
end
end
```
Related issues:
- https://bugs.ruby-lang.org/issues/18170
- https://bugs.ruby-lang.org/issues/18194
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>