ogs_katacheck 0.1.5 → 0.1.6

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: c92d299392ca4458d86bcc62e2caaff21685c32a5e3e879068eb8f5c940a894b
4
- data.tar.gz: 273ef4d65160c92bedc574a98b27c091de761147ccb2e9f60a4be96ae6cf294e
3
+ metadata.gz: efcf71b47a81e504adac1957eba94c7b6e51776a663c00b07816bfe69efa5178
4
+ data.tar.gz: 30c6b7ff2df94ee195cd534904b5e7da6dc288bd85aec03c1e48893daa233278
5
5
  SHA512:
6
- metadata.gz: fbdf7d43f212e20bfb0972717548625b0e57c26f52e951ce1c64ffb2a99ad8dcc5bd6f70070cdc3416f30acf273a2cd85b9436ec773f7e84c919b2258c768eb6
7
- data.tar.gz: 977f1cd671e47706fd97af56f5520bdd1a9165ca468f35768f221be84d658a21a0a54817a03d47acbaedf04782856e43b473b7ad57fc9f515bd1c4daf1caaf0f
6
+ metadata.gz: 44f2a9169e1d1da2ab56582d97e616035f01120ba18d890b8b433c993071c38aa0a6e66971edea630e13fdf180fb52b5e3c627e6207163b3090ac8c768251c93
7
+ data.tar.gz: 63be13d07b2df822864fed5c500c9645895449d3dc0a641d1f67ea09a3e54b40a93ba65dc49ec1cabbcd29bb4fdeb1ac435bd47e8473291c6d9b59de1848d842
@@ -16,4 +16,7 @@
16
16
  - bug fix
17
17
 
18
18
  ### 0.1.5
19
- - bug fix
19
+ - bug fix
20
+
21
+ ### 0.1.6
22
+ - fixes bug in the way percentages are calculated
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ogs_katacheck (0.1.5)
4
+ ogs_katacheck (0.1.6)
5
5
  faraday
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -6,7 +6,7 @@ It pulls game information from the OGS API and checks the user submitted moves a
6
6
 
7
7
  ## Installation
8
8
 
9
- **You will need to have Ruby installed on your machine to run this CLI.** If you are using a Mac, this should already be done for you. If on a Windows machine you can install it by following [these instructions](https://stackify.com/install-ruby-on-windows-everything-you-need-to-get-going/). You can verify that everything is installed properly by running `ruby -v` and `gem -v`, you should see versions for both after running these commands.
9
+ **You will need to have Ruby installed on your machine to run this CLI.** If you are using a Mac, this should already be done for you. If on a Windows machine you can install it by following [these instructions](https://stackify.com/install-ruby-on-windows-everything-you-need-to-get-going/). You can verify that everything is installed properly by running `ruby -v` and `gem -v`, you should see versions for both after running these commands.
10
10
 
11
11
  To install this Gem, open a terminal and run:
12
12
 
@@ -34,12 +34,6 @@ The tool will output the number of user submitted moves that match the top 4 mov
34
34
 
35
35
  ***Note:** A high percentage match in a game does not necessarily mean the user is cheating, but high percentage matches across many games will certainly warrant further investigation.*
36
36
 
37
- ## Development
38
-
39
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
40
-
41
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
42
-
43
37
  ## Contributing
44
38
 
45
39
  Bug reports and pull requests are welcome on GitHub at https://github.com/rubymineshaft/ogs_katacheck.
@@ -25,18 +25,21 @@ class FullReview
25
25
  end
26
26
 
27
27
  def self.destroy_all
28
- self.all.clear
28
+ self.all.clear
29
29
  end
30
30
 
31
31
  def calculate_percentages
32
- @black_tier_1[1] = @black_tier_1[0].to_f / @total_moves / 2 * 100
33
- @black_tier_2[1] = @black_tier_2[0].to_f / @total_moves / 2 * 100
34
- @black_tier_3[1] = @black_tier_3[0].to_f / @total_moves / 2 * 100
35
- @black_tier_4[1] = @black_tier_4[0].to_f / @total_moves / 2 * 100
36
- @white_tier_1[1] = @white_tier_1[0].to_f / @total_moves / 2 * 100
37
- @white_tier_2[1] = @white_tier_2[0].to_f / @total_moves / 2 * 100
38
- @white_tier_3[1] = @white_tier_3[0].to_f / @total_moves / 2 * 100
39
- @white_tier_4[1] = @white_tier_4[0].to_f / @total_moves / 2 * 100
32
+ white_moves = (@total_moves / 2.0).floor
33
+ black_moves = (@total_moves / 2.0).ceil
34
+
35
+ @black_tier_1[1] = @black_tier_1[0].to_f / black_moves * 100
36
+ @black_tier_2[1] = @black_tier_2[0].to_f / black_moves * 100
37
+ @black_tier_3[1] = @black_tier_3[0].to_f / black_moves * 100
38
+ @black_tier_4[1] = @black_tier_4[0].to_f / black_moves * 100
39
+ @white_tier_1[1] = @white_tier_1[0].to_f / white_moves * 100
40
+ @white_tier_2[1] = @white_tier_2[0].to_f / white_moves * 100
41
+ @white_tier_3[1] = @white_tier_3[0].to_f / white_moves * 100
42
+ @white_tier_4[1] = @white_tier_4[0].to_f / white_moves * 100
40
43
 
41
44
  @black_total[0] = @black_tier_1[0] + @black_tier_2[0] + @black_tier_3[0] + @black_tier_4[0]
42
45
  @white_total[0] = @white_tier_1[0] + @white_tier_2[0] + @white_tier_3[0] + @white_tier_4[0]
@@ -1,3 +1,3 @@
1
1
  module OGSKataCheck
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -27,3 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = ["ogs-katacheck", "katacheck"]
28
28
  spec.require_paths = ["lib"]
29
29
  end
30
+
31
+ # to release, bump version and run `bundle exec rake release`
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ogs_katacheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - RubyMineshaft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-23 00:00:00.000000000 Z
11
+ date: 2020-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday