So it looks like #each_line is the same thing as #lines (although for Ruby 2.0 compatibility, I suppose I should use the former).  I think I'd have to do:

so.stderr.each_line do |line|
case line.rstrip

instead of

so.stderr.split(/\r?\n/).each do |line|
case line