Just a thought, feel free to insta-close as stupid. Currently you can do this: ``` def hello(who:) puts "Hello, #{who}" end opts = { who: 'world' } hello(who) ``` Or: ``` def hello(who:, **_extra_opts) # without e...kke (Kimmo Lehto)
> That is OpenStruct, an undefined key does not raise an exception. > ... Right, this behavior seems to be universal: ```ruby > { foo: :bar }[:foo] { 'hello' } => :bar > ... => 1 ``` > I haven't seen such behavior. > ... Hm...kke (Kimmo Lehto)
> Using partition looks reasonable, and it can accept regexes. It also has the problem of creating extra objects that you need to discard with `_` or assign and just leave unused. > ... more with time-based operations; and rack/sin...kke (Kimmo Lehto)
There seems to be no methods for getting a substring before or after a marker. Too often I see and have to resort to variations of: ``` ruby str[/(.+?);/, 1] str.split(';').first substr, _ = str.split(';', 2) str.sub(/.*;/, ''...kke (Kimmo Lehto)
Using ThreadsWait with Thread.report_on_exception is confusing. ThreadsWait spawns a new thread for waiting on a thread: ``` # thwait.rb:87 def join_nowait(*threads) threads.flatten! @threads.concat threads for...kke (Kimmo Lehto)
Perhaps `<%~` would be good as it resembles the squiggly heredoc `<<~EOB` I'll try to improve on your PoC. It seems to only work when the `<%|` is in the beginning of the line, for anything else it fails. I have yet to find a way t...kke (Kimmo Lehto)
Kernel.warn without arguments does not print an empty line to $stderr. This is inconsistent with `Kernel.puts` and it feels weird, because it does not act like a regular Ruby method would (if it was written in Ruby instead of C, it wo...kke (Kimmo Lehto)