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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef2f0385ffa82f1a5e8b5d225e0e76252685f622f1cfe80f32894d76de088a33
4
- data.tar.gz: de145551fe657a328ef79b41e67493a580ee6b1a6b266b775443b231b243173d
3
+ metadata.gz: 86bcf51f66c5277158515c682315939854420e425ab2420444cfe741cb5983dd
4
+ data.tar.gz: 07fcf63227ace8f85b1252a516c1ddc78a5f7d9da898a14853d0101332f12ace
5
5
  SHA512:
6
- metadata.gz: ba1215784c8f619cf9a1094478faa86bc5fb18050e8e5a1b0e790db5d30e8f552416b1719579c5815452945e926e7dc1df8c498e0035f97193c70afa3f2aeb78
7
- data.tar.gz: 4ec3e6164342ad4854da73b420bed52fa210e572e9de9b002fda7014f1e239ef30b842e18ce9f545b4313582cc5a8d201ad42ca20b4022722b0ddb96531d17a1
6
+ metadata.gz: 8640709b92cfc951035ecfb9f7f5db0ffea2c4ac82555690011180f95d1e1dde1853dad35b441bff0daae01aee4793ee2d42a49c37041e108934461368e3a082
7
+ data.tar.gz: a5aaad2d630914ae6b509d579b61b6736b722c5f9c4a421e66674e79ee6d2414e3ab783cb610bf714bd3316aed9cb520715caf6ceb2db4e0d5badb062e949beb
data/.rubocop.yml CHANGED
@@ -16,6 +16,9 @@ Metrics/CyclomaticComplexity:
16
16
  Metrics/PerceivedComplexity:
17
17
  Max: 10
18
18
 
19
+ Layout/LineLength:
20
+ Max: 250
21
+
19
22
  Metrics/BlockLength:
20
23
  Exclude:
21
24
  - 'spec/**/*'
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
+ [![Gem Version](https://badge.fury.io/rb/elo_rankable.svg?icon=si%3Arubygems)](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 Elo rating capabilities to any ActiveRecord model'
12
- spec.description = 'Adds Elo rating to any ActiveRecord model via has_elo_ranking.'
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EloRankable
4
- VERSION = '0.1.2'
4
+ VERSION = '0.2.0'
5
5
  end
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.1.2
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 Elo rating to any ActiveRecord model via has_elo_ranking.
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 Elo rating capabilities to any ActiveRecord model
103
+ summary: Add ELO rating capabilities to any ActiveRecord model
102
104
  test_files: []