mperham/bayes_motel — pull request #3 by jmdeldin (2013-04-15 16:37:25+00:00)
Title: Fix #1: can't add a new key during iteration

In Ruby 1.8, you could insert into hashes while iterating, but since 1.9 uses ordered hashes, this results in a RuntimeError. The simple fix is to convert the hash to an array before iteration.

This change is from http://stackoverflow.com/a/11120147/73492, but it was never reported back to the project.