All the code samples in ensure_index http://api.mongodb.org/ruby/current/Mongo/Collection.html#ensure_index-instance_method are missing a closing bracket.
{{Time t: @posts.ensure_index([['subject', Mongo::ASCENDING]) – calls create_index and
sets the 5 minute cache
Time t+2min : @posts.ensure_index([['subject', Mongo::ASCENDING]) – doesn't do anything
Time t+3min : @posts.ensure_index([['something_else', Mongo::ASCENDING]) – calls create_index
and sets 5 minute cache
Time t+10min : @posts.ensure_index([['subject', Mongo::ASCENDING]) – calls create_index and
resets the 5 minute counter}}