weighted_list_rank 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3efeef897377d594e12ae8c6faee355301d88e737b7c5bf29a949bd1e340f268
4
- data.tar.gz: 7decd73970158dc3d7617cf361b358554251ed3cc2aaa5dba47dbf83d5501d43
3
+ metadata.gz: b5d85e4ccc5456ad1bce7763d39d34d4dc14f831806b9c9bcee94f0c4d926898
4
+ data.tar.gz: dcf0013d694ce996c21335ed6d56d29f7dad96c03376e9a49ede00ae634c980b
5
5
  SHA512:
6
- metadata.gz: 822ea0d168a09174a6ecfe4ba3b6a638c23ef10bb48d878e343d02d5ea420e314059df5285436aca8fa8e99c7ae7943711ee38fa26535b787bc51363913686ac
7
- data.tar.gz: ff30961a974e44a43c065c66ca5f212f69793422ab4e5f888ef7954692ff9d587105b6b888d86582571a60eadd8d4ce76fc95e88c8c8ab5f4ea5ec5bb7762fbd
6
+ metadata.gz: 6983978ad5b4b876e6e47100ec1134aa937606d5ba0a7bafcfd235c7a737b1f84063f7ee3b8bb19f1b56521cd7e6d53196fd15ef64c2f040b90ac8facf50354e
7
+ data.tar.gz: bc4fe3145c9f563c69fc13a718c65ba0696473a134b23fa46b960ffd0952c9a1ad775502e402f798661f758d9b63a745a3fa3dd953402e34e7ae854782da6d64
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.4.2] - 2024-07-01
4
+ - fixed bug where a score could be set to 0. the lowest a score can be now is 1
5
+
3
6
  ## [0.4.1] - 2024-06-30
4
7
  - add score_penalty to the list details hash
5
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- weighted_list_rank (0.4.1)
4
+ weighted_list_rank (0.4.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -61,7 +61,10 @@ module WeightedListRank
61
61
  end
62
62
 
63
63
  # Apply score penalty if it exists
64
- apply_penalty(score, item.score_penalty)
64
+ score = apply_penalty(score, item.score_penalty)
65
+
66
+ # Ensure the score is not less than 1
67
+ [score, 1].max
65
68
  end
66
69
 
67
70
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WeightedListRank
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weighted_list_rank
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Sherman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-30 00:00:00.000000000 Z
11
+ date: 2024-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop