Not necessary in this PR, but I think it would be cleaner and safer to do the io in a block

    io_for(args) do |io|
      io.write output
    end