Replacing:
line = line.scrub if line =~ @split_regex
with
if line.scrub =~ @split_regex
seems to be working:
but I’m not sure if this is the right way to fix this.