- Fixed an error with the
ranked_in_list
method when using certain options #62 - Added
total_scores
method #63
- More pipelining #58.
Also adds
members_data_for(...) and
members_data_for_in(...)` methods. - Guard against an out of bounds index in
member_at
- Fixes TieRankingLeaderboard doesn't rank if the score is 0 #53.
- Allow member data to be set in the
change_score_for(...)
method. - Add
:include_missing
option in leaderboard request options to change whether or not to include missing members in the result.
- Add
global_member_data
option that allows multiple leaderboards to share the same set of member_data. #51 - Add
top
helper method. #50.
- Add support for
change_score_for(...)
in theTieRankingLeaderboard
class.
- Add support for tie handling in leaderboards #46
- Allow for customization of member_data namespace #45
- Allow for custom keys to be set for customizing the data returned from calls like
leaders
oraround_me
#44
- Added
score_for_percentile
method to be able to calculate the score for a given percentile value in the leaderboard.
- Added
rank_member_across
method to be able to rank a member across multiple leaderboards at once.
- Added
remove_members_outside_rank
method to remove members from the leaderboard outside a given rank.
- Added
:members_only
option for various leaderboard requests.
- Fixed a data leak in
expire_leaderboard
andexpire_leaderboard_at
to also set expiration on the member data hash.
- Fixed a bug in
remove_member
that would remove all of the optional member data.
- Added
rank_member_if
andrank_member_if_in
methods that allow you to rank a member in the leaderboard based on execution of a lambda.
- No longer cast scores to a floating point automatically. If requesting a score for an unknown member in the leaderboard, return
nil
. Under the old behavior, anil
score gets returned as 0.0. This is misleading as 0.0 is a valid score.
- Removes
:use_zero_index_for_rank_option
as valid option for requesting data from the leaderboard. Original proposal - Optional member data is stored in a single hash. Original proposal
- Adds
:sort_by
as valid option for requesting data from the leaderboard. Original proposal - Removes
:with_scores
and:with_ranks
as valid options for requesting data from the leaderboard.
- Added
members_from_rank_range
andmembers_from_rank_range_in
methods to be able to retrieve members from a leaderboard in a given rank range.
- Added
all_leaders
andall_leaders_from
methods to retrieve all members from a leaderboard. You may also use the aliasesall_members
orall_members_from
.
- Added
expire_leaderboard(seconds)
to expire the leaderboard in a set number of seconds. - Added
expire_leaderboard_at(timestamp)
to expire the leaderboard at a specific UNIX timestamp. - Added optional
page_size
parameter to thetotal_pages
method.
- Fix for #17 - Leaderboard not compatible with redis 2.1.1. Redis'
zrangebyscore
andzrevrangebyscore
methods do not return scores by default. No need to pass the option in the initial call.
- Added
members_from_score_range
andmembers_from_score_range_in
methods. These will retrieve members from the leaderboard that fall within a given score range. - Add
member_at
andmember_at_in
methods. These will retrieve a given member from the leaderboard at the specified position. members
andmembers_in
are now aliases for theleaders
andleaders_in
methods.
- Added ability to store optional member data alongside the leaderboard data.
:with_member_data
is now a valid request option when retrieving leader data.
- Added accessor for
reverse
option so that you can set reverse after creating a leaderboard to see results in either highest-to-lowest or lowest-to-highest order.
- Added
rank_members(members_and_scores)
andrank_members_in(leaderboard_name, members_and_scores)
allowing you to pass in some variable number ofmember_name, score
and so on or an actual array of those data items. Use this method to do bulk insert of data, but be mindful of the amount of data you are inserting since a single transaction can get quite large.
- Added
page_for(member, page_size = DEFAULT_PAGE_SIZE)
andpage_for_in(leaderboard_name, member, page_size = DEFAULT_PAGE_SIZE)
calls to allow you to determine the page where a member falls in the leaderboard
- Added
:reverse => false
toLeaderboard::DEFAULT_OPTIONS
to support leaderboards sorted from lowest to highest score instead of highest to lowest score. (Thanks @siuying)
- Fix for checking to see if a member actually exists in the leaderboard for the
around_me
calls - Return appropriate
nil
in data returned for calls such aspercentile_for
andranked_in_list
for non-existent members
- Allow for only single options to be passed to
leaders
,around_me
andranked_in_list
methods - #4 - Added
percentile_for(member)
andpercentile_for_in(leaderboard_name, member)
methods to calculate percentile for a given member
- Change
add_member
torank_member
- #3 - Added
delete_leaderboard
anddelete_leaderboard_named
- #2 - Ability to pass in an existing Redis connection in initializer - #1
- Added transaction support for
score_and_rank_for
,leaders
,around_me
andranked_in_list
- Updated initializer to take a leaderboard name,
options
hash andredis_options
hash - Simplified
leaders
,around_me
andranked_in_list
to use anoptions
hash with defaults for the previously individual parameters
- Added
disconnect
method - Check for invalid page size when changing
- Updated Rakefile to run tests under ruby 1.8.7 and ruby 1.9.2
- Added
page_size
parameter tototal_pages_in
to allow for checking what if values in that scenario - Added
page_size
parameter toleaders
andaround_me
calls
- Minor bug fix
- Fixing issue using total_pages in leaderboard_in call
- Internal
massage_leader_data
method will now respectwith_scores
- Adding
XXX_to
,XXX_for
,XXX_in
andXXX_from
methods that will allow you to set the leaderboard name to interact with outside of creating a new object - Added
merge_leaderboards(destination, keys, options = {:aggregate => :min})
method to merge leaderboards given by keys with this leaderboard into destination - Added
intersect_leaderboards(destination, keys, options = {:aggregate => :min})
method to intersect leaderboards given by keys with this leaderboard into destination
redis_options
can be passed in the initializer to pass options for the connection to Redispage_size
is now settable outside of the initializercheck_member?(member)
: Check to see whether member is in the leaderboardscore_and_rank_for(member, use_zero_index_for_rank = false)
: Retrieve the score and rank for a member in a single callremove_members_in_score_range(min_score, max_score)
: Remove members from the leaderboard within a score range
- Initial release