weighted_list_rank 0.1.1 → 0.1.3

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: 4056bebc06742afb336a7dd554e0147b782981a4cddb6b56a80239cccd9f6ae3
4
- data.tar.gz: 3e1932ffba58a189db05a444cd9eb44581776119ac1566b3ea2f853c7657cb5f
3
+ metadata.gz: a649927ba7b5ed331d9721b6a9ba7aa044017956b0aec6484649ee7c9d8d55e1
4
+ data.tar.gz: '01833e4d548f1df8c2428dcce387bf57652c91ea1bf53044420d8720e2137d10'
5
5
  SHA512:
6
- metadata.gz: 59e687f40b55f56ad37b478505f357065c1c0237453fd2a97de8b03f525a28365b4daee4ee3b36de7927f4fcfb448b590071c1b9f7776a6751fcaf975399e2ec
7
- data.tar.gz: 75b5e64e86f4de6168804682705b105bec73cb59ca6304afc1cf39deb5ca7ea988b257a9dca6f4bbc3e00ba56b8614986b5d128829eb762ddc90a9ff3ba388f2
6
+ metadata.gz: 4fec2c7d118e678ee0284e9db56e99125681f5d67268250a3e0db142ea76edf1e9dd58f9b0c53fdfdb3f560feb25e5a731fb33ad71164f0ab45e9ca601ec9be4
7
+ data.tar.gz: d24a0349aeec1813215a3b842a22729de2f90c144a75944872bf000e46008567fee30d8fccfb1b209051cf34d54a616c1faa5411ac2f135d9cfc2bc5eef7371e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.3] - 2024-02-03
4
+
5
+ - sprt the score_details by the highest score from each list first
6
+
7
+ ## [0.1.2] - 2024-02-03
8
+
9
+ - Added list weight to rank result
10
+ -
3
11
  ## [0.1.1] - 2024-02-03
4
12
 
5
13
  - Fixed Exponential strategy to just return the list weight if the item has a nil position
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- weighted_list_rank (0.1.0)
4
+ weighted_list_rank (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -22,7 +22,7 @@ module WeightedListRank
22
22
  items[item.id] ||= {}
23
23
  # Ensure the list_details array exists, then append the new score detail
24
24
  items[item.id][:list_details] ||= []
25
- items[item.id][:list_details] << {list_id: list.id, score: score}
25
+ items[item.id][:list_details] << {list_id: list.id, score: score, weight: list.weight}
26
26
 
27
27
  # Ensure the total_score is initialized, then add the score
28
28
  items[item.id][:total_score] ||= 0
@@ -34,7 +34,8 @@ module WeightedListRank
34
34
  sorted_items = items.map do |id, details|
35
35
  {
36
36
  id: id,
37
- score_details: details[:list_details],
37
+ # Sort the score_details array by score in descending order before including it
38
+ score_details: details[:list_details].sort_by { |detail| -detail[:score] },
38
39
  total_score: details[:total_score]
39
40
  }
40
41
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WeightedListRank
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
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.1.1
4
+ version: 0.1.3
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-02-03 00:00:00.000000000 Z
11
+ date: 2024-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop