localshred/protobuf — pull request #95 by liveh2o (2013-06-14 22:21:36+00:00)
Title: Accept values that respond to `to_f` in FloatField.

The checking for acceptable FloatField values was verifying that values fell between -Infinity and Infinity. This worked for any number object, including BigDecimal in MRI 1.9.2 <= & JRuby. In MRI 1.9.3 >=, setting a BigDecimal raised a type error.

Since BigDecimal values pack the same way as Float values and their aren't min/max values for double/float fields in Protocol Buffers, a simple `respond_to?(:to_f)` call will suffice when checking for acceptable values.

I'm pulling into the 2.7 branch since 2.8 is currently out in beta.

Closes #90.