HF RL Explorer

duration strings: implement stub

duration strings: implement stub: a task in smol-software-harbor (Harbor dataset). Implement Duration.parse in lib/duration.rb : it returns the number of seconds in strings such as "1h30m" (5400), "90s" , "2d 4h" or "1d1h1m1s" . Numbers may have several digits and spaces between the parts are…

The task

Implement `Duration.parse` in `lib/duration.rb`: it returns the number of seconds in strings such as `"1h30m"` (5400), `"90s"`, `"2d 4h"` or `"1d1h1m1s"`. Numbers may have several digits and spaces between the parts are ignored; units are `d`, `h`, `m` and `s`. Run `for f in test/*_test.rb; do ruby -Ilib "$f" || exit…

Part of efederici/smol-software-harbor.