Bewildr and IronRuby 1.1.2

—UPDATE—

All better now. Bewildr 0.1.11 has just been released that works with IronRuby 1.1.1 and the new 1.1.2.

The problem was this: IronRuby 1.1.2 implements Ruby 1.9.2, while IronRuby 1.1.1 implemented ruby 1.8.6.  Calling .select on a hash in 1.8.6 resulted in a 2D array (daft), whereas doing the same in 1.9.2 returns a new hash. The fix was just to check what version of ruby is being run and if it’s 1.8.6, flatten the result of the .select method, and convert it to a hash. Nice and easy.If it’s 1.9.2, do nothing – it already does what I want.

This exercise also demonstrated the value of automated tests – put in the fix, run the tests in IronRuby 1.1.1. It still works. Flip to 1.1.2 and run the tests again… they all work too. Commit, tag, push the changes, push the new gem version. Done!

gem update bewildr

—Original Post—

Bewildr is not compatible with IronRuby 1.1.2.  I’ll be releasing an update shortly, but for now, stick with IronRuby 1.1.1.

If you’ve installed 1.1.2, you’ll get the following error:

undefined method `flatten' for {:id=>"my_button"}:Hash (NoMethodError)
./lib/bewildr/finder.rb:20:in `condition_for'
./lib/bewildr/element.rb:102:in `get'

I’m on it.

2 thoughts on “Bewildr and IronRuby 1.1.2

  1. Lawrence,

    No worries! I’m glad it was an easy fix – it’s just a shame that I only came across the ironruby update this evening…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>