icu_tournament 1.11.0 → 1.12.0

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: c9f5ebb60437a28fd66022167c933153271bcd138c47503b3a6082f8ffb2c235
4
- data.tar.gz: e59666cca208d270d61b787625c356779003c289836bb613ecfa63542a12ff6f
3
+ metadata.gz: 7b23a98b5c094ea8262c5950c0caf436c003dacdec3bcdd9498fd2facdaf3a71
4
+ data.tar.gz: d0885ac4a095bd87f12807bc4aee729969372a3496dcf72239ecfef13a67e782
5
5
  SHA512:
6
- metadata.gz: 53991697d9454d160f34b4e30139f08965af76ed53833b671a15a927f829707fed16242dca1640acb878e7a6c90311fb43c985a4395776e37a38d7acd0cf083d
7
- data.tar.gz: b580e1fd42864b5fbc363a33f0efa44c380e05cba236d308b7d968663b04d1c81bd97fb847a300e71db154e3f5ae872f4b2c5654ebf4e455d65b7262adc873c7
6
+ metadata.gz: e6829bcc2c68fd3b5e202845e253e31f8d73e560b339ad19db97438e89525e6bc3821747ba843a1c58aa8dcda4a0e7e2fc1c0cc5d2929dc901511c1d1c461fac
7
+ data.tar.gz: 4ad015b1429a7e4888609437997d58ce616910e9e19c34c263bce48304d07751d721231e0c4da210c6d0cdf917d8b61a6258f4e53ef573ed32dd5ea8c6d17416
@@ -431,6 +431,19 @@ module ICU
431
431
  end
432
432
  end
433
433
 
434
+ def normalize_score(score)
435
+ if score == "H"
436
+ return "="
437
+ elsif score == "Z"
438
+ return "0"
439
+ elsif score == "U"
440
+ return "-"
441
+ elsif score == "F"
442
+ return 1
443
+ end
444
+ score
445
+ end
446
+
434
447
  def add_result(round, player, data, full_byes, half_byes)
435
448
  data.strip!
436
449
  if data.match(/^-?$/)
@@ -438,14 +451,14 @@ module ICU
438
451
  return 0.0
439
452
  end
440
453
  data = "#{data} -" if data.match(/^(\d+)? (w|b|-)$/)
441
- if data.match(/^(0{1,4}|[1-9]\d{0,3}) (w|b|-) (1|0|=|\+|-)$/)
454
+ if data.match(/^(0{1,4}|[1-9]\d{0,3}) (w|b|-) (H|F|Z|U|1|0|=|\+|-)$/)
442
455
  opponent = $1.to_i
443
456
  colour = $2
444
- score = $3
457
+ score = normalize_score $3
445
458
  elsif data.match(/- (1|0|=|\+|-)$/)
446
459
  opponent = 0
447
460
  colour = "-"
448
- score = $1
461
+ score = normalize_score $1
449
462
  else
450
463
  raise "invalid result '#{data}'"
451
464
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ICU
4
4
  class Tournament
5
- VERSION = "1.11.0"
5
+ VERSION = "1.12.0"
6
6
  end
7
7
  end
@@ -830,6 +830,13 @@ KRAUSE
830
830
  file = "#{@s}/armstrong_2012_with_bom.tab"
831
831
  expect { @p.parse_file!(file) }.not_to raise_error
832
832
  end
833
+
834
+ it "should handle Ulster Masters 2022 (H, Z, F for byes)" do
835
+ file = "#{@s}/UlsterMastersSeniors2022.tab"
836
+ expect { @p.parse_file!(file) }.not_to raise_error
837
+ end
838
+
839
+
833
840
  end
834
841
  end
835
842
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icu_tournament
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Orr
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-08-10 00:00:00.000000000 Z
12
+ date: 2022-11-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dbf
@@ -107,14 +107,14 @@ dependencies:
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '3.2'
110
+ version: '3.12'
111
111
  type: :development
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '3.2'
117
+ version: '3.12'
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: rdoc
120
120
  requirement: !ruby/object:Gem::Requirement
@@ -182,19 +182,19 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  - !ruby/object:Gem::Version
183
183
  version: '0'
184
184
  requirements: []
185
- rubygems_version: 3.0.1
185
+ rubygems_version: 3.0.3.1
186
186
  signing_key:
187
187
  specification_version: 4
188
188
  summary: For reading and writing files of chess tournament data.
189
189
  test_files:
190
+ - spec/tournament_spx_spec.rb
190
191
  - spec/team_spec.rb
192
+ - spec/spec_helper.rb
191
193
  - spec/player_spec.rb
192
194
  - spec/tournament_spec.rb
195
+ - spec/result_spec.rb
193
196
  - spec/tournament_fcsv_spec.rb
194
197
  - spec/tie_break_spec.rb
195
- - spec/tournament_spx_spec.rb
196
- - spec/result_spec.rb
197
198
  - spec/util_spec.rb
198
- - spec/spec_helper.rb
199
199
  - spec/tournament_sp_spec.rb
200
200
  - spec/tournament_krause_spec.rb