`each_with_object` is a Ruby 1.9 method, here re-implemented in core_ext.rb in case it's missing (for older Ruby versions). Using `returning` is bad in combination with Ruby on Rails because each usage of the method will emit a Rails deprecation warning. This might be considered an Active Support bug, but it's better to avoid using `returning` altogether and use `tap` from Ruby 1.8.7, also re-implemented here in case it's missing. Since existing usages or `returning` were better suited for `each_with_object` than `tap`, they were rewritten using the former instead.
… consistent Enumberable behavior for Cursor
Also, remove broken defined? check from objectid.rb and object_id.rb - it was never doing anything since we require those files at the top of cbson.c.
This is necessary for use under em-synchrony, which uses Fibers instead of Threads and EventMachine instead of blocking sockets.
… a hash