leaderboard 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +4 -0
- data/lib/leaderboard.rb +1 -1
- data/lib/leaderboard/version.rb +1 -1
- data/spec/leaderboard_spec.rb +12 -0
- data/spec/version_spec.rb +1 -1
- metadata +2 -2
data/CHANGELOG.markdown
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## leaderboard 3.0.1 (2012-12-19)
|
4
|
+
|
5
|
+
* Fixed a bug in `remove_member` that would remove all of the optional member data.
|
6
|
+
|
3
7
|
## leaderboard 3.0.0 (2012-12-03)
|
4
8
|
|
5
9
|
* Added `rank_member_if` and `rank_member_if_in` methods that allow you to rank a member in the leaderboard based on execution of a lambda.
|
data/lib/leaderboard.rb
CHANGED
@@ -255,7 +255,7 @@ class Leaderboard
|
|
255
255
|
def remove_member_from(leaderboard_name, member)
|
256
256
|
@redis_connection.multi do |transaction|
|
257
257
|
transaction.zrem(leaderboard_name, member)
|
258
|
-
transaction.
|
258
|
+
transaction.hdel(member_data_key(leaderboard_name), member)
|
259
259
|
end
|
260
260
|
end
|
261
261
|
|
data/lib/leaderboard/version.rb
CHANGED
data/spec/leaderboard_spec.rb
CHANGED
@@ -659,4 +659,16 @@ describe 'Leaderboard' do
|
|
659
659
|
@leaderboard.rank_member_if(highscore_check, 'david', 1338)
|
660
660
|
@leaderboard.score_for('david').should eql(1338.0)
|
661
661
|
end
|
662
|
+
|
663
|
+
it 'should not delete all the member data when calling remove_member' do
|
664
|
+
rank_members_in_leaderboard
|
665
|
+
|
666
|
+
@redis_connection.exists("name:member_data").should be_true
|
667
|
+
@redis_connection.hgetall("name:member_data").size.should be(5)
|
668
|
+
@leaderboard.total_members.should be(5)
|
669
|
+
@leaderboard.remove_member('member_1')
|
670
|
+
@redis_connection.exists("name:member_data").should be_true
|
671
|
+
@redis_connection.hgetall("name:member_data").size.should be(4)
|
672
|
+
@leaderboard.total_members.should be(4)
|
673
|
+
end
|
662
674
|
end
|
data/spec/version_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leaderboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|