inukshuk/bibtex-ruby — pull request #47 by JLimperg (2012-04-14 21:13:12+00:00)
Title: Fixes a bug where Entry#dup would not return exact copies

Entry#initialize_copy uses Entry#add to duplicate fields, which was
problematic because #add turned every argument into a `Value` object. Most
notably, `Names` objects were converted into `Value`s as well, losing
their extra functionality.

Hence, Entry#dup returned objects that didn't behave as their 'clones'
in certain situations, which it should not.

In order to resolve this problem, Entry#add now checks if its arguments
are subclasses of Value, in which case it adds them to Entry#fields
directly. That way, at least bibtex-ruby's standard classes are
preserved. It might also be appropriate, however, to drop #add from
Entry#initialize_copy entirely and operate on a lower level.