elo_rankable 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +4 -0
- data/README.md +2 -0
- data/elo_rankable.gemspec +2 -2
- data/lib/elo_rankable/has_elo_ranking.rb +1 -3
- data/lib/elo_rankable/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 86bcf51f66c5277158515c682315939854420e425ab2420444cfe741cb5983dd
|
|
4
|
+
data.tar.gz: 07fcf63227ace8f85b1252a516c1ddc78a5f7d9da898a14853d0101332f12ace
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8640709b92cfc951035ecfb9f7f5db0ffea2c4ac82555690011180f95d1e1dde1853dad35b441bff0daae01aee4793ee2d42a49c37041e108934461368e3a082
|
|
7
|
+
data.tar.gz: a5aaad2d630914ae6b509d579b61b6736b722c5f9c4a421e66674e79ee6d2414e3ab783cb610bf714bd3316aed9cb520715caf6ceb2db4e0d5badb062e949beb
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.0] - 2025-08-09
|
|
9
|
+
|
|
10
|
+
- Initial Gem release.
|
|
11
|
+
|
|
8
12
|
## [0.1.2] - 2025-08-08
|
|
9
13
|
|
|
10
14
|
### Added
|
data/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# elo_rankable
|
|
2
2
|
|
|
3
|
+
[](https://badge.fury.io/rb/elo_rankable)
|
|
4
|
+
|
|
3
5
|
A Ruby gem that adds Elo rating capabilities to any ActiveRecord model using a simple `has_elo_ranking` declaration. It stores ratings in a separate `EloRanking` model to keep your host model clean, and provides domain-style methods for updating rankings after matches.
|
|
4
6
|
|
|
5
7
|
## Features
|
data/elo_rankable.gemspec
CHANGED
|
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
spec.authors = ['Aberen']
|
|
9
9
|
spec.email = ['nijoergensen@gmail.com']
|
|
10
10
|
|
|
11
|
-
spec.summary = 'Add
|
|
12
|
-
spec.description = 'Adds
|
|
11
|
+
spec.summary = 'Add ELO rating capabilities to any ActiveRecord model'
|
|
12
|
+
spec.description = 'Adds ELO rating to any ActiveRecord model via has_elo_ranking. It stores ratings in a separate EloRanking model to keep your host model clean, and provides domain-style methods for updating rankings after matches.'
|
|
13
13
|
spec.homepage = 'https://github.com/Aberen/elo_rankable'
|
|
14
14
|
spec.license = 'MIT'
|
|
15
15
|
spec.required_ruby_version = '>= 2.7.0'
|
|
@@ -59,9 +59,7 @@ module EloRankable
|
|
|
59
59
|
raise ArgumentError, 'Opponent must respond to elo_ranking' unless other_player.respond_to?(:elo_ranking)
|
|
60
60
|
|
|
61
61
|
# Check if the opponent is destroyed/deleted
|
|
62
|
-
if other_player.respond_to?(:destroyed?) && other_player.destroyed?
|
|
63
|
-
raise ArgumentError, 'Cannot play against a destroyed record'
|
|
64
|
-
end
|
|
62
|
+
raise ArgumentError, 'Cannot play against a destroyed record' if other_player.respond_to?(:destroyed?) && other_player.destroyed?
|
|
65
63
|
|
|
66
64
|
# Get the elo_ranking once and validate it
|
|
67
65
|
opponent_ranking = other_player.elo_ranking
|
data/lib/elo_rankable/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: elo_rankable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aberen
|
|
@@ -50,7 +50,9 @@ dependencies:
|
|
|
50
50
|
- - "<"
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
52
|
version: '8.0'
|
|
53
|
-
description: Adds
|
|
53
|
+
description: Adds ELO rating to any ActiveRecord model via has_elo_ranking. It stores
|
|
54
|
+
ratings in a separate EloRanking model to keep your host model clean, and provides
|
|
55
|
+
domain-style methods for updating rankings after matches.
|
|
54
56
|
email:
|
|
55
57
|
- nijoergensen@gmail.com
|
|
56
58
|
executables: []
|
|
@@ -98,5 +100,5 @@ requirements: []
|
|
|
98
100
|
rubygems_version: 3.5.11
|
|
99
101
|
signing_key:
|
|
100
102
|
specification_version: 4
|
|
101
|
-
summary: Add
|
|
103
|
+
summary: Add ELO rating capabilities to any ActiveRecord model
|
|
102
104
|
test_files: []
|