I don't do ruby but if you understand the principle you should be able to write it for yourself.
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.
Don't wait for the modal box to disappear ... Wait for any underlying element to become visible.
Catch any errors and discard them if they say that the modal box is still present.
--