sciolyff 0.2.0 → 0.2.1

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: 557d9424fccd8e1ef1cf039ac09a7f775475ab041238ce73a1eca5ce0e2ad7a1
4
- data.tar.gz: 79c56f1488d33f5fa250c08216492da04dbfac9f980cf953673f3b3df48421a6
3
+ metadata.gz: f3cd6e98f70075a515863431f659b59fcc88f7ab9bd6d01ee46329cbc5bf4eb1
4
+ data.tar.gz: 966829031a03f79bac525757c2cef44ccc515829afb066bd04779ddf6e3fb596
5
5
  SHA512:
6
- metadata.gz: a85a02fcb51e980d635d63a612fde179217118a81385e157001d91d733dbeea359b5d35fa24d94317555ce10ea72c1e26e70c829b2dade87689d4afe1bbbec35
7
- data.tar.gz: 603d152c2efc7de191c050703add7803c4561c4c91b29a4ca5c9f893527b53d1259db11029508bf54d8410f4946b13925993370cd763eca998c6ed394d83d9fc
6
+ metadata.gz: 382ae2b2de24a1ed587d2e7c89273d55b2f5e84c26ca8d8a7f68e16d0eb15f5e612eff41f627fe83529a6458f4fd75867952c2461ce6043fc17f08ae7a555c3c
7
+ data.tar.gz: 24d865ebbff8545257810b9ede5f31d32cf232a8a69c52ff3f6e9c79f860af4ca32d6733a1c41039ff29f78d61e3e1fe67485663d76846f4c539069e775b9295
data/bin/sciolyff CHANGED
@@ -6,7 +6,7 @@ require 'yaml'
6
6
  require 'sciolyff'
7
7
 
8
8
  opts = Optimist.options do
9
- version 'sciolyff 0.2.0'
9
+ version 'sciolyff 0.2.1'
10
10
  banner <<~STRING
11
11
  Checks if a given file is in the Scioly File Format
12
12
 
@@ -39,6 +39,7 @@ module SciolyFF
39
39
  def test_each_penalty_has_valid_points
40
40
  @penalties.select { |p| p.instance_of? Hash }.each do |penalty|
41
41
  assert_instance_of Integer, penalty[:points]
42
+ assert penalty[:points] >= 0
42
43
  end
43
44
  end
44
45
 
data/lib/sciolyff.rb CHANGED
@@ -83,6 +83,12 @@ module SciolyFF
83
83
  + team_points_from_penalties(team_number)
84
84
  end
85
85
 
86
+ def team_points_from_penalties(team_number)
87
+ if @penalties_by_team.nil? || @penalties_by_team[team_number].nil? then 0
88
+ else @penalties_by_team[team_number][:points]
89
+ end
90
+ end
91
+
86
92
  def sort_teams_by_rank
87
93
  @teams_by_number
88
94
  .values
@@ -122,12 +128,6 @@ module SciolyFF
122
128
  .count { |p| p[:place] < placing[:place] }
123
129
  end
124
130
 
125
- def team_points_from_penalties(team_number)
126
- if @penalties_by_team.nil? || @penalties_by_team[team_number].nil? then 0
127
- else @penalties_by_team[team_number][:points]
128
- end
129
- end
130
-
131
131
  def break_tie(team_number_a, team_number_b)
132
132
  medal_counts(team_number_a)
133
133
  .zip(medal_counts(team_number_b))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sciolyff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Em Zhan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-15 00:00:00.000000000 Z
11
+ date: 2019-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest