General

Profile

Dan0042 (Daniel DeLorme)

  • Login: Dan0042
  • Registered on: 06/09/2016
  • Last sign in: 02/19/2026

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 16 27 43

Activity

02/13/2026

06:27 PM Ruby Feature #21858: `Kernel#Hash` considers `to_h` too
mame (Yusuke Endoh) wrote in #note-7:
> I said `Kernel#Hash` is a strict conversion method.
It's true that `Integer()` is a strict conversion method, but `Array()` and `String()` are notably more lenient, and I've always seen `Hash()...
Dan0042 (Daniel DeLorme)
02:32 PM Ruby Feature #21858: `Kernel#Hash` considers `to_h` too
> ```ruby
> ...
This is not really a behavior **change** but more like a backward-compatible behavior **addition/extension**
It's really in the same vein as adding a method:
```ruby
{a:1,b:2}.except(:b) #Ruby 2.7: undefined method ...
Dan0042 (Daniel DeLorme)
02:44 PM Ruby Feature #21800: `Dir.scan` to list directory entires with their type
I like the feature, but it would be nice to provide an example that is not simply to reimplement `Dir["**/*.rb"].size` with 16x the lines of code. Something that demonstrates how it's more versatile than globbing. Dan0042 (Daniel DeLorme)

02/02/2026

07:36 PM Ruby Feature #21858: `Kernel#Hash` considers `to_h` too
+1
Actually I think this is just an oversight. #to_h was added to Struct, Hash, NilClass in Ruby 2.0, and to Array, Enumerable in Ruby 2.1; previously there was just #to_hash. And `Hash()` remained unchanged instead of adapting to the n...
Dan0042 (Daniel DeLorme)

01/15/2026

07:59 PM Ruby Feature #13683: Add strict Enumerable#single
mame (Yusuke Endoh) wrote in #note-48:
> But no one seriously considered it because we can find no use case for it.
Uh, seriously? I gave an example in #note-16 and we have 11 other similar instances in our codebase. But none that ra...
Dan0042 (Daniel DeLorme)

01/14/2026

05:03 PM Ruby Feature #13683: Add strict Enumerable#single
@byroot it depends on the use case. Yes sometimes it's an assertion that should raise an error, but at other times we want to find the single element, and do something **only if** found, not raise an error.
@ufuk the same way you disamb...
Dan0042 (Daniel DeLorme)
02:13 PM Ruby Feature #13683: Add strict Enumerable#single
Please consider a method that returns nil instead of raising an exception. Exceptions should not be used for control flow.
Which one is better?
```ruby
#method returning nil
val = collection.one{ ... } #match or ni...
Dan0042 (Daniel DeLorme)

12/07/2025

09:57 PM Ruby Feature #21766: Pathname + FileUtils making sweet music together
Remember that `FileUtils` is loaded dynamically, so it would be something like
```ruby
class Pathname
def mkdir_p(...) = _fileutils(:mkdir_p, ...)
def ln(...) = _fileutils(:ln, ...)
def ln_s(...) = _fileutils(:ln_s, ...)
...
Dan0042 (Daniel DeLorme)

11/30/2025

03:52 AM Ruby Bug #21717: Cleanup fiber scheduler after fork
Ruby already has an API for this: `Process._fork`
If your Fiber scheduler needs to be reset after a fork, I would recommend hooking into this.
Dan0042 (Daniel DeLorme)

11/01/2025

01:23 AM Ruby Bug #21654: Set#new calls extra methods compared to previous versions
mame (Yusuke Endoh) wrote in #note-13:
> My concern is that the expectation to "if it's at all possible to raise early" is a slippery slope with no clear boundary.
I don't think it's slippery at all. There's a very clear difference betw...
Dan0042 (Daniel DeLorme)

Also available in: Atom