irv 0.3.0 → 0.3.1

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: e1c7dab221fc890b8f1554931888a15424b0681ef69067c659b667f761ece99b
4
- data.tar.gz: 1c9586e673288fd6e05da683cd36221108feb9891d756325abde00950bf2d3f5
3
+ metadata.gz: dfd57ec8dac2bec1cd4013e868af058d3ed72756892bd27d3f6754d53a656d46
4
+ data.tar.gz: 9b28df1aa3ba19e1368f436ddcf8a9c5fcb2eeb039313c24b4b475f1f5685995
5
5
  SHA512:
6
- metadata.gz: 4d81a7d58cfd8c1b6c90ef749d31f0ff2d9ebfcb3d3a8ec3838f5d2b49b0f5fa123cbbc0667bef76a11e56f57c5bbef8d27e07b62636bdadc36f62fec21b03cf
7
- data.tar.gz: 0dfa531db816393e1de5b29231a3755d1e70d9cb989d4c1c96be81adf189dc300088a536b6ababef10e6cab3e3795e70e776aaa43330fcde4dac1e912690bb28
6
+ metadata.gz: c22afbebe3eeff2e89a0b86251948539d763b2b40daff33a72bd2d77b7243216e527be5d673a43b29ff1f230c1862b089d2642e0de406928b52fcbbdb9a94bb7
7
+ data.tar.gz: d3bdd5286d392b9ac62c45658c4d071b9e7240c1c1e746ee9881ce38401908d1a2f33638b0ec46bc029c634059fcc6d8852caa5074ca34ecced843770e59eaa5
@@ -0,0 +1,31 @@
1
+ name: RSpec and RuboCop
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: Checkout code
15
+ uses: actions/checkout@v2
16
+
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: 3.3
21
+
22
+ - name: Install dependencies
23
+ run: |
24
+ gem install bundler
25
+ bundle install --jobs 4 --retry 3
26
+
27
+ - name: Run RSpec tests
28
+ run: bundle exec rspec
29
+
30
+ - name: Run RuboCop
31
+ run: bundle exec rubocop
data/lib/irv/round.rb CHANGED
@@ -46,7 +46,7 @@ module Irv
46
46
  tallied_votes = []
47
47
  max_ranked_votes_count(votes).times do |n|
48
48
  nth_ranked_votes = votes.map { |vote| vote[n] }
49
- tallied_votes << @candidates.each_with_object({}) { |candidate, hash| hash[candidate.to_sym] = nth_ranked_votes.count(candidate) }
49
+ tallied_votes << @candidates.to_h { |c| [c.to_s.to_sym, nth_ranked_votes.count(c)] }
50
50
  end
51
51
  tallied_votes
52
52
  end
data/lib/irv/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Irv
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irv
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
  - highwide
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-09 00:00:00.000000000 Z
11
+ date: 2024-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -74,10 +74,10 @@ executables: []
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
+ - ".github/workflows/test.yaml"
77
78
  - ".gitignore"
78
79
  - ".rspec"
79
80
  - ".rubocop.yml"
80
- - ".travis.yml"
81
81
  - CODE_OF_CONDUCT.md
82
82
  - Gemfile
83
83
  - Gemfile.lock
data/.travis.yml DELETED
@@ -1,12 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.4
7
- - 2.5
8
- - 2.6
9
- before_install: gem install bundler -v 1.17.2
10
- script:
11
- - bundle exec rubocop
12
- - bundle exec rake spec