ogs_katacheck 0.1.1 → 0.1.6

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: c71349f5dd8e74429e56af1b16a8f2a5d9738d4d5f91ac0ac838a356ca119be1
4
- data.tar.gz: 94a6f3d98e73634aa0f4064fcd4d8ad7d0710a8b0d8797b37ae8da0733f87529
3
+ metadata.gz: efcf71b47a81e504adac1957eba94c7b6e51776a663c00b07816bfe69efa5178
4
+ data.tar.gz: 30c6b7ff2df94ee195cd534904b5e7da6dc288bd85aec03c1e48893daa233278
5
5
  SHA512:
6
- metadata.gz: 2176a2caa81063dbae9e38139a6a586be97c9eabc29dd6b79c3130db81585abde1e9761c2825af5846287a60d25b1fbd8aa79a917f93ad632f44b218075db585
7
- data.tar.gz: ef0c4665c4c05ecd514c4d630460e2100459260116bd58baee63d1aa1e351b403f8688dc4b592878996f4fea1b6ba0d9a61d56149b8b96389578f053c8575755
6
+ metadata.gz: 44f2a9169e1d1da2ab56582d97e616035f01120ba18d890b8b433c993071c38aa0a6e66971edea630e13fdf180fb52b5e3c627e6207163b3090ac8c768251c93
7
+ data.tar.gz: 63be13d07b2df822864fed5c500c9645895449d3dc0a641d1f67ea09a3e54b40a93ba65dc49ec1cabbcd29bb4fdeb1ac435bd47e8473291c6d9b59de1848d842
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ .DS_Store
@@ -4,4 +4,19 @@
4
4
  - Added ability to check games against OGS full reviews.
5
5
 
6
6
  ### 0.1.1
7
- - add ogs-katacheck executable
7
+ - add `ogs-katacheck` executable
8
+
9
+ ### 0.1.2
10
+ - add `katacheck` executable
11
+
12
+ ### 0.1.3
13
+ - bug fix
14
+
15
+ ### 0.1.4
16
+ - bug fix
17
+
18
+ ### 0.1.5
19
+ - bug fix
20
+
21
+ ### 0.1.6
22
+ - fixes bug in the way percentages are calculated
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ogs_katacheck (0.1.1)
4
+ ogs_katacheck (0.1.6)
5
+ faraday
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
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 is already 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/).
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
 
@@ -18,19 +18,21 @@ After installing OGS KataCheck, you can run it by opening a terminal and typing:
18
18
 
19
19
  $ ogs-katacheck
20
20
 
21
+ or
22
+
23
+ $ katacheck
24
+
21
25
  You will be asked to enter a game ID. This can be simply copied and pasted from OGS.
22
26
 
23
27
  You will then be presented with a list of available OGS AI reviews. **Only full reviews** are useable with this tool. If you do not see a full review in the list, open the game in OGS and run a full review. Once the server has completed the review, re-run the tool.
24
28
 
25
- The tool will output the number of user submitted moves that match the top 4 moves suggested by the AI in the review. Obviously, `tier 1` and `tier 2` moves are most important to look at, but the overall percentages can also be helpful.
29
+ ![Review Selection](https://github.com/RubyMineshaft/ogs_katacheck/blob/main/images/reviews.png)
26
30
 
27
- ***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.*
28
-
29
- ## Development
31
+ The tool will output the number of user submitted moves that match the top 4 moves suggested by the AI in the review. Obviously, `tier 1` and `tier 2` moves are most important to look at, but the overall percentages can also be helpful.
30
32
 
31
- 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.
33
+ ![Output Example](https://github.com/RubyMineshaft/ogs_katacheck/blob/main/images/output.png)
32
34
 
33
- 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).
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.*
34
36
 
35
37
  ## Contributing
36
38
 
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'ogs_katacheck'
4
+
5
+ OGSKataCheck::CLI.new.call
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require './lib/ogs_katacheck'
3
+ require 'ogs_katacheck'
4
4
 
5
5
  OGSKataCheck::CLI.new.call
Binary file
Binary file
@@ -1,4 +1,3 @@
1
- require 'pry'
2
1
  require 'faraday'
3
2
  require 'json'
4
3
  require_relative "./ogs_katacheck/version"
@@ -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.1"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -22,7 +22,10 @@ Gem::Specification.new do |spec|
22
22
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
23
23
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
24
  end
25
+ spec.add_runtime_dependency "faraday"
25
26
  spec.bindir = "bin"
26
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.executables = ["ogs-katacheck", "katacheck"]
27
28
  spec.require_paths = ["lib"]
28
29
  end
30
+
31
+ # to release, bump version and run `bundle exec rake release`
metadata CHANGED
@@ -1,23 +1,40 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ogs_katacheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
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-22 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2020-10-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: This CLI gem is written for OGS team members in order to aid in investigating
14
28
  suspicions of botting.
15
29
  email:
16
30
  - rubymineshaft@online-go.com
17
- executables: []
31
+ executables:
32
+ - ogs-katacheck
33
+ - katacheck
18
34
  extensions: []
19
35
  extra_rdoc_files: []
20
36
  files:
37
+ - ".DS_Store"
21
38
  - ".gitignore"
22
39
  - CHANGELOG.md
23
40
  - Gemfile
@@ -25,8 +42,11 @@ files:
25
42
  - README.md
26
43
  - Rakefile
27
44
  - bin/console
45
+ - bin/katacheck
28
46
  - bin/ogs-katacheck
29
47
  - bin/setup
48
+ - images/output.png
49
+ - images/reviews.png
30
50
  - lib/ogs_katacheck.rb
31
51
  - lib/ogs_katacheck/cli.rb
32
52
  - lib/ogs_katacheck/full_review.rb