leaderboard 3.5.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjY2OTAyMGJjZTE2NmFiNjQyYTdjZjUyNmUwMGUzZDc4NGM1ZDY5NQ==
5
- data.tar.gz: !binary |-
6
- MDJhZTE4MTAwZTU0ZjM4OTUzNGJhY2ZjMGVmZTZlMzE0ZGNjNjY5Yw==
2
+ SHA1:
3
+ metadata.gz: 457a795959a19eb87e92f2e15df972997cf862c0
4
+ data.tar.gz: 46efa5becb8ddcada520c3ca5b37235c9d751507
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NmQ2ZThlMDBjNDA4YmNhOWZlM2JlOWMyMWZlMTYzN2ZlZmMyM2FiMWIzMTAx
10
- ODJhMzBhMjNkYzAzZGI5YTZmNWQ3YTRjM2RiYTFhMjRlMDkxNjU4M2NlMGI2
11
- ZDExOWJjMjliODdhMTY4NTBjYjUwNGNmNTYyNGYxZmU2MTg5MDc=
12
- data.tar.gz: !binary |-
13
- NTM4MTM3ZmNiYWYyMTE1MGRmMGJhZmQzNjIxNGM2NGI1MzM4NTg4NzM5YWRk
14
- MGVkNDg5N2U5ODY1M2IyNzVjYjNmZDYyODMzNGRjMzZlYjcwMzYxZDRkYjI2
15
- MjI4MzBkMDA4NDNlMTNmN2IwZjcyNWMyNzFmZDg1MzhhMWVlYWY=
6
+ metadata.gz: d1a7accf722c5fb0e1d1e24a897e173a88296694fdf94dabfc9289569a3543482c355c411365fab3ded182d91ba4ceb614708d21073205c54f31a0afbfb4d8f9
7
+ data.tar.gz: 0582a7737d0b07933f3665644c7436e90e2ed59684698bd0f4971dc061cd9b2aaa614024ca70636712364029fe29ee124fb64c2de3beb40e9424146e18e780c3
@@ -1 +1,3 @@
1
+ ruby-1.8.7
1
2
  ruby-1.9.3
3
+ ruby-2.0.0
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.6.0 (2014-02-15)
4
+
5
+ * Allow for customization of member_data namespace [#45](https://github.com/agoragames/leaderboard/pull/45)
6
+
3
7
  ## 3.5.0 (2014-01-24)
4
8
 
5
9
  * Allow for custom keys to be set for customizing the data returned from calls like `leaders` or `around_me` [#44](https://github.com/agoragames/leaderboard/pull/44)
@@ -51,7 +51,8 @@ DEFAULT_OPTIONS = {
51
51
  :member_key => :member,
52
52
  :rank_key => :rank,
53
53
  :score_key => :score,
54
- :member_data_key => :member_data
54
+ :member_data_key => :member_data,
55
+ :member_data_namespace => 'member_data'
55
56
  }
56
57
  ```
57
58
 
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ end
10
10
 
11
11
  task :default => :spec
12
12
 
13
- desc "Run the specs against Ruby 1.8.7 and 1.9.3"
13
+ desc "Run the specs against Ruby 1.8.7, 1.9.3, 2.0.0"
14
14
  task :test_rubies do
15
- system "rvm 1.8.7@leaderboard_gem,1.9.3@leaderboard_gem do rake spec"
15
+ system "rvm 1.8.7@leaderboard_gem,1.9.3@leaderboard_gem,2.0.0@leaderboard_gem do rake spec"
16
16
  end
@@ -14,7 +14,8 @@ class Leaderboard
14
14
  :member_key => :member,
15
15
  :rank_key => :rank,
16
16
  :score_key => :score,
17
- :member_data_key => :member_data
17
+ :member_data_key => :member_data,
18
+ :member_data_namespace => 'member_data'
18
19
  }
19
20
 
20
21
  # Default Redis host: localhost
@@ -78,6 +79,7 @@ class Leaderboard
78
79
  @rank_key = leaderboard_options[:rank_key]
79
80
  @score_key = leaderboard_options[:score_key]
80
81
  @member_data_key = leaderboard_options[:member_data_key]
82
+ @member_data_namespace = leaderboard_options[:member_data_namespace]
81
83
 
82
84
  @redis_connection = redis_options[:redis_connection]
83
85
  unless @redis_connection.nil?
@@ -972,7 +974,7 @@ class Leaderboard
972
974
  #
973
975
  # @return a key in the form of +leaderboard_name:member_data+
974
976
  def member_data_key(leaderboard_name)
975
- "#{leaderboard_name}:member_data"
977
+ "#{leaderboard_name}:#{@member_data_namespace}"
976
978
  end
977
979
 
978
980
  # Validate and return the page size. Returns the +DEFAULT_PAGE_SIZE+ if the page size is less than 1.
@@ -1,3 +1,3 @@
1
1
  class Leaderboard
2
- VERSION = '3.5.0'.freeze
2
+ VERSION = '3.6.0'.freeze
3
3
  end
@@ -759,4 +759,12 @@ describe 'Leaderboard' do
759
759
  leader[:member_data].should be_nil
760
760
  end
761
761
  end
762
+
763
+ it 'should allow you to change the :member_data_namespace option' do
764
+ @leaderboard = Leaderboard.new('name', {:member_data_namespace => 'md'}, {:host => "127.0.0.1", :db => 15})
765
+ rank_members_in_leaderboard
766
+
767
+ @redis_connection.exists("name:member_data").should be_false
768
+ @redis_connection.exists("name:md").should be_true
769
+ end
762
770
  end
@@ -2,6 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe 'Leaderboard::VERSION' do
4
4
  it 'should be the correct version' do
5
- Leaderboard::VERSION.should == '3.5.0'
5
+ Leaderboard::VERSION.should == '3.6.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leaderboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Czarnecki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-25 00:00:00.000000000 Z
11
+ date: 2014-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Leaderboards backed by Redis in Ruby
@@ -86,17 +86,17 @@ require_paths:
86
86
  - lib
87
87
  required_ruby_version: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ! '>='
89
+ - - '>='
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
98
  rubyforge_project: leaderboard
99
- rubygems_version: 2.2.0
99
+ rubygems_version: 2.1.11
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: Leaderboards backed by Redis in Ruby