footballdata-api 0.4.3 → 0.4.4

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: 6712b00c0f67e3c23fbdd0cd9f5436e9683dedc75fa53028cc72a07fa36437e2
4
- data.tar.gz: 8d9ae9147cba11203f2f9755ad1d0a79b52715dab2d03027bdc340a6e4e50d87
3
+ metadata.gz: b5bd4d077f49907b80638105f2152e677540431fee3cee6b9022c48c8a3daadd
4
+ data.tar.gz: fa80a496acc7e4d3bc2a4095543716c56cf5497b27b994dd173a468ba220b041
5
5
  SHA512:
6
- metadata.gz: b4a5f064656d889e36b352dcedfc77cd503c6f5f2f9ce8fc25a84ac3ece1ecb8acab941a3f21a647e1278f9f87b8e232e1958acca8138b50a6f073351c677856
7
- data.tar.gz: f9bdb77161614d3d381e187aad999f5f0ff67835b920bdd0d31ea553cdab89ab849489f59cb95c98f78088a79cb39a4e9f94d673914048f83b179b6a207dbbc5
6
+ metadata.gz: 51c7867e5767815a885c9ea7c45df6ae8305bcc74ac8d377ac96de8be9c9577441b5d5fb9c88d40f53af7b0ca1798673cf4c07149291dc6daaa53dd5632be384
7
+ data.tar.gz: 25a7b9227fe453551d5f76b9a1f0f09c255ffa75e6f3aaa36f7ad5791130ecd42474b0da8c1b5f2f11c915665e601c8749a1ae1ce5efa6920d935d32a403bef7
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 0.4.3
1
+ ### 0.4.4
2
2
 
3
3
  ### 0.0.1 / 2024-07-03
4
4
 
@@ -38,10 +38,9 @@ STAGES = {
38
38
 
39
39
 
40
40
 
41
- def self.team_autofill( name, teams: )
42
- ## note - no country for place holder teams
43
- return name if name == 'N.N.'
44
41
 
42
+
43
+ def self.find_team_country_code( name, teams: )
45
44
  ## add (fifa) country code e.g.
46
45
  ## Liverpool FC => Liverpool FC (ENG)
47
46
  ## or Liverpool FC => Liverpool FC (URU)
@@ -59,7 +58,7 @@ def self.team_autofill( name, teams: )
59
58
  exit 1
60
59
  end
61
60
 
62
- "#{name} (#{country.code})"
61
+ country.code
63
62
  end
64
63
 
65
64
 
@@ -196,13 +195,6 @@ matches.each do |m|
196
195
  teams[ team1 ] += 1
197
196
  teams[ team2 ] += 1
198
197
 
199
- ####
200
- # auto-add (fifa) country code if int'l club tournament
201
- if clubs_intl
202
- team1 = team_autofill( team1, teams: teams_by_name )
203
- team2 = team_autofill( team2, teams: teams_by_name )
204
- end
205
-
206
198
 
207
199
  ### mods - rename club names
208
200
  unless mods.nil? || mods.empty?
@@ -210,6 +202,22 @@ matches.each do |m|
210
202
  team2 = mods[ team2 ] if mods[ team2 ]
211
203
  end
212
204
 
205
+ ####
206
+ # auto-add (fifa) country code if int'l club tournament
207
+ if clubs_intl
208
+ ## note - use "original" name (not moded) for lookup
209
+ team1_org = m['homeTeam']['name']
210
+ team2_org = m['awayTeam']['name']
211
+ if team1_org ## note - ignore no team/placeholder (e.g. N.N)
212
+ country_code = find_team_country_code( team1_org, teams: teams_by_name )
213
+ team1 = "#{team1} (#{country_code})"
214
+ end
215
+ if team2_org ## note - ignore no team/placeholder (e.g. N.N)
216
+ country_code = find_team_country_code( team2_org, teams: teams_by_name )
217
+ team2 = "#{team2} (#{country_code})"
218
+ end
219
+ end
220
+
213
221
 
214
222
 
215
223
  comments = ''
@@ -12,6 +12,9 @@ module Footballdata
12
12
  'br.1' => {
13
13
  'América FC' => 'América Mineiro', # in year 2018 ??
14
14
  },
15
+ 'copa.l' => {
16
+ 'América FC' => 'América Mineiro', # in year 2022
17
+ },
15
18
  'pt.1' => {
16
19
  'Vitória SC' => 'Vitória Guimarães', ## avoid easy confusion with Vitória SC <=> Vitória FC
17
20
  'Vitória FC' => 'Vitória Setúbal',
@@ -2,7 +2,7 @@
2
2
  module FootballdataApi
3
3
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
4
4
  MINOR = 4
5
- PATCH = 3
5
+ PATCH = 4
6
6
  VERSION = [MAJOR,MINOR,PATCH].join('.')
7
7
 
8
8
  def self.version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: footballdata-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer