localshred/protobuf — pull request #117 by localshred (2013-09-06 16:35:24+00:00)
Title: Dup string value when encoding if it is frozen

String#encode! will raise a RuntimeError if the string instance is frozen.

The normal string setter for required or optional string fields already dups
the incoming string to avoid reference issues. However when the field is a
repeated string field the assigned array is dup'ed, but ruby keeps any
string's frozen state.

The fix is simply to dup any string value when we go to encode if it is
frozen.