ruby gem for getting the frequency of an item in a sorted array in log time