killer_queen_scene_scoring 0.1.0 → 0.2.0

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: d33202ac0d276376a6f6a5b044ff7c7780599eba401c8046359390cca7b0677e
4
- data.tar.gz: e435962c1fd937190dc49cf950b5bfea1dd54d0aeab5f6431892330fe265ab9d
3
+ metadata.gz: b3fffddeed7587fbc19cab2322b80d85a218a26d6dc948b15db8a653fbb954c5
4
+ data.tar.gz: 75fd1ed1d095ed0ce199512a754fc987a2a42b0c7f362b4617b334c35beb4c30
5
5
  SHA512:
6
- metadata.gz: 9f0190a641d7e30c18d8c4a7d653d48360df7b45337ccc4266115192889c48509296374ebcb51f938108c6d4fc72f52f1d9bca88017fb93d4311247a1d41aba1
7
- data.tar.gz: b39af761fbb5a74829b228b7bdcae7d732a0e99fa5a9b8cdfa6aec7bf66e28f6faf71fef3411479f3458143c85d30f208960cfc538391111fa92b381ef8a4951
6
+ metadata.gz: f6ff2591b6f9bac96193317c02e70fc75c96fb191ed0cb93b93adc98e47f1eb0bd44430b3ac45589370983301ec82d02f47f73dda4b0db669f87c072dd6e1793
7
+ data.tar.gz: c4f1b932ce628944226b4fd48aabf7b1f15a93749eff8507635331b54ec169a22af1e5f6e3a0c2b65dc64affb1d7153200f555da2601b0ea5778d14041824114
data/README.md CHANGED
@@ -1,39 +1,110 @@
1
- # KillerQueenSceneScoring
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/killer_queen_scene_scoring`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'killer_queen_scene_scoring'
1
+ # Killer Queen Scene Scoring
2
+ [![Build status](https://travis-ci.com/acidhelm/killer_queen_scene_scoring.svg?branch=master)](https://travis-ci.com/acidhelm/killer_queen_scene_scoring)
3
+ [![Gem version](https://badge.fury.io/rb/killer_queen_scene_scoring.svg)](https://badge.fury.io/rb/killer_queen_scene_scoring)
4
+
5
+ This is an implementation of the scene-wide scoring system that was introduced
6
+ in Bumble Bash 3. The idea is outlined in
7
+ [this Facebook post](https://www.facebook.com/events/1788575457853671/permalink/1949400981771117)
8
+ in the BB3 group.
9
+
10
+ # The config file
11
+
12
+ The config file is a JSON file that contains information about the bracket.
13
+ The file is attached to the first match in the bracket. Challonge apparently
14
+ doesn't allow attachments with the `.json` extension, so you must use some
15
+ other extension like `.txt` for it to be accepted.
16
+
17
+ The config file has some parameters, a list of teams, and the players on those
18
+ teams. The parameters are:
19
+
20
+ ```json
21
+ {
22
+ "base_point_value": 0,
23
+ "next_bracket": null,
24
+ "max_players_to_count": 3,
25
+ "match_values": [ 1, 1, 1, 2, 2, 3, 3 ],
26
+ }
13
27
  ```
14
28
 
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install killer_queen_scene_scoring
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
29
+ `base_point_value`: This is a number that is added to the point values in the
30
+ `match_values` array. It is used in tournaments where some teams do not advance
31
+ to the final bracket. Set this to the number of teams that did not advance.
32
+ For example, if your tournament has 20 teams, and 12 play in the final bracket,
33
+ set `base_point_value` to 8 (20-12).
34
+ `next_bracket`: Set this to the slug or the Challonge ID of a bracket that
35
+ should be processed after the current bracket. Set it to `null` or omit it in
36
+ the config file of the last bracket in the tournament. If you set this to the
37
+ slug of a tournament that is owned by an organization, the string must be of the form
38
+ "org_name-bracket_name", for example, "kq-sf-GDC3" (which is owned by the "kq-sf"
39
+ organization).
40
+ `max_players_to_count`: The maximum number of players from a scene that can
41
+ contribute to that scene's score. All config files in a tournament must have
42
+ the same value for this field.
43
+ `match_values`: An array of integers. These are the points that are awarded
44
+ to the players on a team for reaching each match of the bracket. For example,
45
+ a team that reaches match 4 gets 2 points, since the 4th element in the array
46
+ is 2. The example above is for a
47
+ [four-team double-elimination bracket](https://challonge.com/tvtpeasf).
48
+ These numbers must currently be calculated by hand. However, once you calculate
49
+ them for a particular type of bracket (e.g., double-elimination with 12 teams),
50
+ you can reuse them for all future brackets of that same type.
51
+
52
+ Note that the last two values in the sample `match_values` are the same.
53
+ Those represent the two matches in the grand final. Those numbers are the
54
+ points awarded for _reaching_ a match, not _winning_ a match. Once a bracket is
55
+ complete, the team that won the grand final is awarded one additional point.
56
+
57
+ The config file also holds a list of teams and their players. After the
58
+ parameters, write a `teams` array that lists the teams, the names of their
59
+ players, and the scenes that the players represent.
60
+
61
+ ```json
62
+ {
63
+ /* parameters here */
64
+ "teams": [
65
+ {
66
+ "name": "Midwest Madness (CHI/MPLS/KC)",
67
+ "players": [
68
+ {
69
+ "name": "Alice",
70
+ "scene": "Chicago"
71
+ },
72
+ {
73
+ "name": "Bob",
74
+ "scene": "Chicago"
75
+ },
76
+ {
77
+ "name": "Charlie",
78
+ "scene": "Minneapolis"
79
+ },
80
+ {
81
+ "name": "Dani",
82
+ "scene": "Minneapolis"
83
+ },
84
+ {
85
+ "name": "Eve",
86
+ "scene": "Kansas City"
87
+ }
88
+ ]
89
+ },
90
+ /* other teams... */
91
+ ]
92
+ }
93
+ ```
30
94
 
31
- 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).
95
+ The team name in the config file must match the team's name in the
96
+ Challonge bracket, although the case of letters may differ. This means that
97
+ a team must have the same name in all the brackets in a tournament.
32
98
 
33
- ## Contributing
99
+ # Calculating scores
34
100
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/killer_queen_scene_scoring.
101
+ ```ruby
102
+ id = "tvtpeasf" # Replace this with your tournament's slug or ID
36
103
 
37
- ## License
104
+ t = KillerQueenSceneScoring::Tournament.new(id: id, api_key: your_api_key)
38
105
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
106
+ if t.load
107
+ t.calculate_points
108
+ puts t.scene_scores.sort
109
+ end
110
+ ```
@@ -9,6 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.version = KillerQueenSceneScoring::VERSION
10
10
  spec.authors = ["Michael Dunn"]
11
11
  spec.email = ["acidhelm@gmail.com"]
12
+ spec.required_ruby_version = "~> 2.6.0"
12
13
 
13
14
  spec.summary = "Scene-wide scoring for Killer Queen tournaments."
14
15
  spec.description = "Classes that implement scene-wide scoring for Killer Queen tournaments."
@@ -1,3 +1,3 @@
1
1
  module KillerQueenSceneScoring
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killer_queen_scene_scoring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Dunn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-15 00:00:00.000000000 Z
11
+ date: 2019-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -135,9 +135,9 @@ require_paths:
135
135
  - lib
136
136
  required_ruby_version: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - ">="
138
+ - - "~>"
139
139
  - !ruby/object:Gem::Version
140
- version: '0'
140
+ version: 2.6.0
141
141
  required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="