(A cheesy homepage for Justin Collins)
Some changes for Ruby 1.9.1pre2

Here are a few things I have found so far while making kams compatible with Ruby 1.9.1:

  • Small eventmachine change needed as shown here.
  • require 'md5' changed to require 'digest/md5' and MD5 changed to Digest::MD5 (this works with 1.8.7, too.)
  • Any hashes which were defined not using => (i.e., {'a', '1', 'b', '2'} ) have to now use =>
  • One issue required some version checking: the Observable module in 1.8.7 uses an array, in 1.9.1 it uses a hash. This doesn’t matter much to me, except when Observable objects are marshalled and this goes along with them. What I have done for now is set it to an array or hash as appropriate when loading the objects (there is no content for it, in either case).
  • Array#to_s has changed. In 1.8.7, [].to_s => ””. In 1.9.1, [].to_s => “[]”. Somewhat annoying, but easy to handle.
  • Have to deal with Object#instance_variables and Object#instance_methods returning arrays of symbols instead of strings.
  • Ran into an issue with Mutex#try_lock. Asking about a solution now…

Update – No one answered my question about Mutex#try_lock, but someone fixed it anyway :)


blog comments powered by Disqus