Add example in Ruby + fix durability in JS

ping @mglukhovsky -- can you take a look at this?
Fix #265