file:test
test
Command line input:
ruby -pe 'gsub(/t([a-z])s/){"d"+$1.capitalize}' test
I am expecting output to be dEt
, but the actual output is:
#<Enumerator:0x00000001c78520>
I have no idea what happen. It works in irb when I do:
"test".gsub(/t([a-z])s/){"d"+$1.capitalize}
This turns out to be a Ruby bug.
I submitted a bug ticket 2 days ago, and they already resolved it.
Here is the link to the bug ticket (it is now a backport):
Backport #7157
Here is the new change log to the trunk:
Change log: see Oct 14
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With