weighted_list_rank 0.3.0 → 0.3.1

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: 02c97cc567dfd099a6f65066c534b3780d1a8ca7f8b6a2148d6410c348ed6db9
4
- data.tar.gz: 235f31a73f88b44485d5c5a0fae360d6f4fe2a417e380ddaccadfa214af4d5d6
3
+ metadata.gz: bf34a6c62fda7d3038b31da0d7c8d9ec0b9a86a1b0204308e44d950e599f95b7
4
+ data.tar.gz: 3ed6316fa225185f79afa58899f2b0d29c0abb072c7835492be8dc14b1151b39
5
5
  SHA512:
6
- metadata.gz: e908050bff4073ce084cc6b20a30992a52a08d93dc2732ae4e891605d2dc3c761166a79e90093ddb5b345ebe9da344c4ebe430fd9d9e1b780bccced0d4ee97fb
7
- data.tar.gz: 67fa8168ec949cbdcb3c1dc728d8461ae0a4bf51234cef9d251eaf10b63eb8ca617d55945a719ea297cfe24c42a1ab89c871f8f090af601c97ec21f22b0c2b6f
6
+ metadata.gz: ff08f7f218c00bd592e6c54a8862df527fb8c75cbfdf28ec4ccad44221c73b3fb699f590b0e8cb82c7b9e023e42f0fd285dab907a766864b88360cfb622dcdc2
7
+ data.tar.gz: 760b3d89d47fce1c4fa48899bdd9f58ee925bbe90937988028b1162f19b6afb4f157b37a7ff68b4964d6581f288834e9a065c372f68ca22bf0d31f572cda9806
data/.rubocop.yml CHANGED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.1] - 2024-05-026
4
+
5
+ - Fixed issue with lists with only a single item getting bonus points
6
+
3
7
  ## [0.3.0] - 2024-02-03
4
8
 
5
9
  - added bonus_pool_percentage feature to expoential
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/Gemfile.lock CHANGED
@@ -1,59 +1,61 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- weighted_list_rank (0.1.1)
4
+ weighted_list_rank (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.2)
10
- json (2.7.1)
10
+ json (2.7.2)
11
11
  language_server-protocol (3.17.0.3)
12
12
  lint_roller (1.1.0)
13
- minitest (5.21.2)
13
+ minitest (5.23.1)
14
14
  parallel (1.24.0)
15
- parser (3.3.0.5)
15
+ parser (3.3.1.0)
16
16
  ast (~> 2.4.1)
17
17
  racc
18
- racc (1.7.3)
18
+ racc (1.8.0)
19
19
  rainbow (3.1.1)
20
- rake (13.1.0)
21
- regexp_parser (2.9.0)
22
- rexml (3.2.6)
23
- rubocop (1.59.0)
20
+ rake (13.2.1)
21
+ regexp_parser (2.9.2)
22
+ rexml (3.2.8)
23
+ strscan (>= 3.0.9)
24
+ rubocop (1.63.5)
24
25
  json (~> 2.3)
25
26
  language_server-protocol (>= 3.17.0)
26
27
  parallel (~> 1.10)
27
- parser (>= 3.2.2.4)
28
+ parser (>= 3.3.0.2)
28
29
  rainbow (>= 2.2.2, < 4.0)
29
30
  regexp_parser (>= 1.8, < 3.0)
30
31
  rexml (>= 3.2.5, < 4.0)
31
- rubocop-ast (>= 1.30.0, < 2.0)
32
+ rubocop-ast (>= 1.31.1, < 2.0)
32
33
  ruby-progressbar (~> 1.7)
33
34
  unicode-display_width (>= 2.4.0, < 3.0)
34
- rubocop-ast (1.30.0)
35
- parser (>= 3.2.1.0)
36
- rubocop-minitest (0.34.5)
37
- rubocop (>= 1.39, < 2.0)
38
- rubocop-ast (>= 1.30.0, < 2.0)
39
- rubocop-performance (1.20.2)
35
+ rubocop-ast (1.31.3)
36
+ parser (>= 3.3.1.0)
37
+ rubocop-minitest (0.35.0)
38
+ rubocop (>= 1.61, < 2.0)
39
+ rubocop-ast (>= 1.31.1, < 2.0)
40
+ rubocop-performance (1.21.0)
40
41
  rubocop (>= 1.48.1, < 2.0)
41
- rubocop-ast (>= 1.30.0, < 2.0)
42
+ rubocop-ast (>= 1.31.1, < 2.0)
42
43
  rubocop-rake (0.6.0)
43
44
  rubocop (~> 1.0)
44
45
  ruby-progressbar (1.13.0)
45
- standard (1.33.0)
46
+ standard (1.36.0)
46
47
  language_server-protocol (~> 3.17.0.2)
47
48
  lint_roller (~> 1.0)
48
- rubocop (~> 1.59.0)
49
+ rubocop (~> 1.63.0)
49
50
  standard-custom (~> 1.0.0)
50
- standard-performance (~> 1.3)
51
+ standard-performance (~> 1.4)
51
52
  standard-custom (1.0.2)
52
53
  lint_roller (~> 1.0)
53
54
  rubocop (~> 1.50)
54
- standard-performance (1.3.1)
55
+ standard-performance (1.4.0)
55
56
  lint_roller (~> 1.1)
56
- rubocop-performance (~> 1.20.2)
57
+ rubocop-performance (~> 1.21.0)
58
+ strscan (3.1.0)
57
59
  unicode-display_width (2.5.0)
58
60
 
59
61
  PLATFORMS
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -43,7 +43,7 @@ module WeightedListRank
43
43
  # and the bonus pool percentage.
44
44
  def calculate_score(list, item)
45
45
  # Return the list weight if there are no positions
46
- return list.weight if item.position.nil?
46
+ return list.weight if item.position.nil? || list.items.count == 1
47
47
 
48
48
  num_items = list.items.count
49
49
  total_bonus_pool = list.weight * bonus_pool_percentage
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WeightedListRank
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
File without changes
File without changes
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.3.0
4
+ version: 0.3.1
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-04 00:00:00.000000000 Z
11
+ date: 2024-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -89,7 +89,6 @@ files:
89
89
  - lib/weighted_list_rank/strategy.rb
90
90
  - lib/weighted_list_rank/version.rb
91
91
  - sig/weighted_list_rank.rbs
92
- - weighted_list_rank.gemspec
93
92
  homepage: https://github.com/ssherman/weighted_list_rank
94
93
  licenses:
95
94
  - MIT
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/weighted_list_rank/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "weighted_list_rank"
7
- spec.version = WeightedListRank::VERSION
8
- spec.authors = ["Shane Sherman"]
9
- spec.email = ["shane.sherman@gmail.com"]
10
-
11
- spec.summary = "generate ranks of items from weighted lists"
12
- spec.description = "generate ranks of items from weighted lists"
13
- spec.homepage = "https://github.com/ssherman/weighted_list_rank"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.6.0"
16
-
17
- # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
18
-
19
- spec.metadata["homepage_uri"] = spec.homepage
20
- spec.metadata["source_code_uri"] = "https://github.com/ssherman/weighted_list_rank"
21
- spec.metadata["changelog_uri"] = "https://github.com/ssherman/weighted_list_rank/CHANGELOG.md"
22
-
23
- # Specify which files should be added to the gem when it is released.
24
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
- spec.files = Dir.chdir(__dir__) do
26
- `git ls-files -z`.split("\x0").reject do |f|
27
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
28
- end
29
- end
30
- spec.bindir = "exe"
31
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
- spec.require_paths = ["lib"]
33
-
34
- # Uncomment to register a new dependency of your gem
35
- # spec.add_dependency "example-gem", "~> 1.0"
36
- spec.add_development_dependency "rubocop", "~> 1.0"
37
- spec.add_development_dependency "standard", "~> 1.0"
38
- spec.add_development_dependency "rubocop-minitest", "~> 0.3"
39
- spec.add_development_dependency "rubocop-rake", "~> 0.6"
40
- # For more information and examples about making a new gem, check out our
41
- # guide at: https://bundler.io/guides/creating_gem.html
42
- end