sportdb-writers 0.2.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Manifest.txt +1 -8
- data/README.md +0 -1
- data/Rakefile +0 -1
- data/config/leagues.csv +423 -0
- data/lib/sportdb/writers/txt_writer.rb +32 -28
- data/lib/sportdb/writers/version.rb +2 -2
- data/lib/sportdb/writers.rb +1 -81
- metadata +3 -25
- data/bin/fbup +0 -13
- data/config/leagues_america.csv +0 -16
- data/config/leagues_europe.csv +0 -104
- data/config/leagues_world.csv +0 -8
- data/config/openfootball.csv +0 -67
- data/lib/sportdb/fbup/github.rb +0 -83
- data/lib/sportdb/fbup/github_config.rb +0 -97
- data/lib/sportdb/fbup/main.rb +0 -162
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8f8ed0e95799a14767c7ee6a1d66e5f13160b6845c5a0c7cf9f7b200ddbf48a
|
4
|
+
data.tar.gz: 298302af01c42832b4f46a87f5f189fbd3fcd86a63162410d732f8310171f2cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 271d38df12f342e760889a50e4302f5b981326daee680779da0f855213ca2c82c6489f7a8ee5072083f8f47f5877a620ae6957b2388614bd50af6f11860c23f8
|
7
|
+
data.tar.gz: d7da046a9f7c9378f2a77464a4f833b7ad4c7a4afc3f28a68385ecc288da70dc5d619282d985aea913dc4e9f1de578efc1073aac8c65b61ef7c70df2aee19826
|
data/CHANGELOG.md
CHANGED
data/Manifest.txt
CHANGED
@@ -4,16 +4,9 @@ README.md
|
|
4
4
|
Rakefile
|
5
5
|
bin/fbgen
|
6
6
|
bin/fbtxt
|
7
|
-
|
8
|
-
config/leagues_america.csv
|
9
|
-
config/leagues_europe.csv
|
10
|
-
config/leagues_world.csv
|
11
|
-
config/openfootball.csv
|
7
|
+
config/leagues.csv
|
12
8
|
lib/sportdb/fbgen/main.rb
|
13
9
|
lib/sportdb/fbtxt/main.rb
|
14
|
-
lib/sportdb/fbup/github.rb
|
15
|
-
lib/sportdb/fbup/github_config.rb
|
16
|
-
lib/sportdb/fbup/main.rb
|
17
10
|
lib/sportdb/writers.rb
|
18
11
|
lib/sportdb/writers/goals.rb
|
19
12
|
lib/sportdb/writers/league_config.rb
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
* bugs :: [github.com/sportdb/sport.db/issues](https://github.com/sportdb/sport.db/issues)
|
5
5
|
* gem :: [rubygems.org/gems/sportdb-writers](https://rubygems.org/gems/sportdb-writers)
|
6
6
|
* rdoc :: [rubydoc.info/gems/sportdb-writers](http://rubydoc.info/gems/sportdb-writers)
|
7
|
-
* forum :: [groups.google.com/group/opensport](https://groups.google.com/group/opensport)
|
8
7
|
|
9
8
|
|
10
9
|
|
data/Rakefile
CHANGED
data/config/leagues.csv
ADDED
@@ -0,0 +1,423 @@
|
|
1
|
+
key,name,basename,start_season,end_season
|
2
|
+
caf.cl,CAF Champions League,cl,,
|
3
|
+
caf.conf,CAF Confederations Cup,cafconfederationscup,,
|
4
|
+
afl,African Football League,afl,,
|
5
|
+
eg.1,Egypt Premiership,1-premiership,,
|
6
|
+
eg.cup,Egypt Cup,cup,,
|
7
|
+
eg.super,Egypt Supercup,supercup,,
|
8
|
+
tn.1,Tunisia Ligue 1,ligue1,,
|
9
|
+
ma.1,Morocco Botola,1-botola,,
|
10
|
+
dz.1,Algeria Ligue 1,1-ligue1,,
|
11
|
+
za.1,South Africa Premier League,premierleague,,
|
12
|
+
za.2,South Africa National First Division,nationalfirstdivision,,
|
13
|
+
za.cup,South Africa Cup,cup,,
|
14
|
+
za.cup.l,South Africa Knockout,knockout,,
|
15
|
+
ng.1,Nigeria Professional League,professionalleague,,
|
16
|
+
ke.1,Kenya Premier League,premierleague,,
|
17
|
+
zm.1,Zambia Super League,superleague,,
|
18
|
+
gh.1,Ghana Premier League,premierleague,,
|
19
|
+
ug.1,Uganda Super League,superleague,,
|
20
|
+
zw.1,Zimbabwe Premier Soccer League,premiersoccerleague,,
|
21
|
+
bi.1,Burundi 1. Liga,1liga,,
|
22
|
+
ao.1,Angola Girabola,girabola,,
|
23
|
+
tz.1,Tanzania Premier League,premierleague,,
|
24
|
+
mu.1,Mauritius Premier League,premierleague,,
|
25
|
+
mu.cup,Mauritius Cup,cup,,
|
26
|
+
mu.cup.rep,Mauritius Republic Cup,republiccup,,
|
27
|
+
asia.cl,AFC Champions League,afcchampionsleague,,
|
28
|
+
asia.cup,AFC Cup,afccup,,
|
29
|
+
jp.1,Japan J. League,1-jleague,,
|
30
|
+
jp.2,Japan J. League 2,jleague2,,
|
31
|
+
jp.cup,Japan Emperor's Cup,emperorscup,,
|
32
|
+
jp.cup.l,Japan J. League Cup,jleaguecup,,
|
33
|
+
kr.1,South Korea K-League,kleague,,
|
34
|
+
kr.2,South Korea K-League 2,kleague2,,
|
35
|
+
kr.cup,South Korea Cup,cup,,
|
36
|
+
sg.1,Singapore Premier League,premierleague,,
|
37
|
+
th.1,Thailand Premier League,premierleague,,
|
38
|
+
my.1,Malaysia Super League,superleague,,
|
39
|
+
mm.1,Myanmar National League,nationalleague,,
|
40
|
+
id.1,Indonesia Super League,superleague,,
|
41
|
+
in.1.i,India I-League,ileague,,
|
42
|
+
in.1.ii,India Super League,superleague,,
|
43
|
+
tw.1,Taiwan Premier League,premierleague,,
|
44
|
+
cn.1,China Super League,1-superleague,,
|
45
|
+
kz.1,Kazakhstan Premier League A,1-premierleague,,
|
46
|
+
tm.1,Turkmenistan 1. Liga,1liga,,
|
47
|
+
uz.1,Uzbekistan Super League,superleague,,
|
48
|
+
tj.1,Tajikistan Higher League,higherleague,,
|
49
|
+
tj.super,Tajikistan Super Cup,supercup,,
|
50
|
+
vn.1,Vietnam V. League 1,vleague1,,
|
51
|
+
vn.cup,Vietnam Cup,cup,,
|
52
|
+
jm.1,Jamaica Premier League,premierleague,,
|
53
|
+
cr.1,Costa Rica Primera División,primeradivision,,
|
54
|
+
cr.2,Costa Rica Segunda División,segundadivision,,
|
55
|
+
hn.1,Honduras Primera División,primeradivision,,
|
56
|
+
sv.1,El Salvador Primera División,primeradivision,,
|
57
|
+
gt.1,Guatemala Liga Nacional,liganacional,,
|
58
|
+
ni.1,Nicaragua Primera División,primeradivision,,
|
59
|
+
at.1,Österr. Bundesliga,1-bundesliga,,
|
60
|
+
at.2,Österr. 2. Liga,2-liga2,2018/19,
|
61
|
+
at.2,Österr. Erste Liga,2-liga1,,2017/18
|
62
|
+
at.3.o,Österr. Regionalliga Ost,3-regionalliga-ost,,
|
63
|
+
at.3.m,Österr. Regionalliga Mitte,3-regionalliga-mitte,,
|
64
|
+
at.3.sbg,Österr. Regionalliga Salzburg,regionalligasalzburg,,
|
65
|
+
at.3.t,Österr. Regionalliga Tirol,regionalligatirol,,
|
66
|
+
at.3.v,Österr. Regionalliga Vorarlberg,regionalligavorarlberg,,
|
67
|
+
at.3.w,Österr. Regionalliga West,regionalligawest,,
|
68
|
+
at.cup,ÖFB Cup,cup,,
|
69
|
+
at.4.ost.w,Österr. Wiener Stadtliga,wienerstadtliga,,
|
70
|
+
at.4.ost.n,Österr. Landesliga Niederösterreich,landesliganiederosterreich,,
|
71
|
+
at.4.ost.b,Österr. Landesliga Burgenland,landesligaburgenland,,
|
72
|
+
at.4.mitte.st,Österr. Steirische Landesliga,steirischelandesliga,,
|
73
|
+
at.4.mitte.o,Österr. Landesliga Oberösterreich,landesligaoberosterreich,,
|
74
|
+
at.4.mitte.k,Österr. Kärtner Liga,kartnerliga,,
|
75
|
+
at.4.west.s,Österr. Salzburger Liga,salzburgerliga,,
|
76
|
+
at.4.west.t,Österr. Tiroler Liga,tirolerliga,,
|
77
|
+
at.4.west.v,Österr. Vorarlberg Liga,vorarlbergliga,,
|
78
|
+
at.5.n.ost,Österr. 2. Landesliga Ost (NÖ),2landesligaostno,,
|
79
|
+
at.5.n.west,Österr. 2. Landesliga West (NÖ),2landesligawestno,,
|
80
|
+
at.6.n.ost.sso,Österr. Gebietsliga Süd/Südost (NÖ),gebietsligasudsudostno,,
|
81
|
+
at.6.n.ost.nnw,Österr. Gebietsliga Nord/Nordwest (NÖ),gebietsliganordnordwestno,,
|
82
|
+
at.6.n.west.w,Österr. Gebietsliga West (NÖ),gebietsligawestno,,
|
83
|
+
at.6.n.west.nww,Österr. Gebietsliga Nordwest/Waldviertel (NÖ),gebietsliganordwestwaldviertelno,,
|
84
|
+
at.7.n.ost.sso.s,Österr. 1. Klasse Süd (NÖ),1klassesudno,,
|
85
|
+
at.7.n.ost.sso.o,Österr. 1. Klasse Ost (NÖ),1klasseostno,,
|
86
|
+
at.7.n.ost.nnw.n,Österr. 1. Klasse Nord (NÖ),1klassenordno,,
|
87
|
+
at.7.n.ost.nnw.nw,Österr. 1. Klasse Nordwest (NÖ),1klassenordwestno,,
|
88
|
+
at.7.n.west.w.w,Österr. 1. Klasse West (NÖ),1klassewestno,,
|
89
|
+
at.7.n.west.w.wm,Österr. 1. Klasse West-Mitte (NÖ),1klassewestmitteno,,
|
90
|
+
at.7.n.west.nww.nwm,Österr. 1. Klasse Nordwest-Mitte (NÖ),1klassenordwestmitteno,,
|
91
|
+
at.7.n.west.nww.w,Österr. 1. Klasse Waldviertel (NÖ),1klassewaldviertelno,,
|
92
|
+
at.8.n.steinfeld,Österr. 2. Klasse Steinfeld (NÖ),2klassesteinfeldno,,
|
93
|
+
at.8.n.wechsel,Österr. 2. Klasse Wechsel (NÖ),2klassewechselno,,
|
94
|
+
at.8.n.triestingtal,Österr. 2. Klasse Triestingtal (NÖ),2klassetriestingtalno,,
|
95
|
+
at.8.n.ostmitte,Österr. 2. Klasse Ost/Mitte (NÖ),2klasseostmitteno,,
|
96
|
+
at.8.n.ost,Österr. 2. Klasse Ost (NÖ),2klasseostno,,
|
97
|
+
at.8.n.weinviertel.n,Österr. 2. Klasse Weinviertel Nord (NÖ),2klasseweinviertelnordno,,
|
98
|
+
at.8.n.weinviertel.s,Österr. 2. Klasse Weinviertel Süd (NÖ),2klasseweinviertelsudno,,
|
99
|
+
at.8.n.marchfeld,Österr. 2. Klasse Marchfeld (NÖ),2klassemarchfeldno,,
|
100
|
+
at.8.n.donau,Österr. 2. Klasse Donau (NÖ),2klassedonauno,,
|
101
|
+
at.8.n.pulkautal,Österr. 2. Klasse Pulkautal (NÖ),2klassepulkautalno,,
|
102
|
+
at.8.n.ybbstal,Österr. 2. Klasse Ybbstal (NÖ),2klasseybbstalno,,
|
103
|
+
at.8.n.yspertal,Österr. 2. Klasse Yspertal (NÖ),2klasseyspertalno,,
|
104
|
+
at.8.n.alpenvorland,Österr. 2. Klasse Alpenvorland (NÖ),2klassealpenvorlandno,,
|
105
|
+
at.8.n.traisental,Österr. 2. Klasse Traisental (NÖ),2klassetraisentalno,,
|
106
|
+
at.8.n.wachau,Österr. 2. Klasse Wachau (NÖ),2klassewachauno,,
|
107
|
+
at.8.n.schmidatal,Österr. 2. Klasse Schmidatal (NÖ),2klasseschmidatalno,,
|
108
|
+
at.8.n.waldviertelthayatal,Österr. 2. Klasse Waldviertel Thayatal (NÖ),2klassewaldviertelthayatalno,,
|
109
|
+
at.8.n.waldviertel.s,Österr. 2. Klasse Waldviertel/Süd (NÖ),2klassewaldviertelsudno,,
|
110
|
+
at.9.n.hornerwald,Österr. 3. Klasse Hornerwald (NÖ),3klassehornerwaldno,,
|
111
|
+
at.9.n.mistelbach,Österr. 3. Klasse Mistelbach (NÖ),3klassemistelbachno,,
|
112
|
+
eng.2,English Championship,2-championship,2004/05,
|
113
|
+
eng.2,English Division One,2-division1,1992/93,2003/04
|
114
|
+
eng.1,English Division One,1-division1,1892/93,1991/92
|
115
|
+
eng.1,English Football League,1-footballleague,1888/89,1891/92
|
116
|
+
eng.3,English League One,3-league1,2004/05,
|
117
|
+
eng.3,English Division Two,3-division2,1992/93,2003/04
|
118
|
+
eng.2,English Division Two,2-division2,1892/93,1991/92
|
119
|
+
eng.4,English League Two,4-league2,2004/05,
|
120
|
+
eng.4,English Division Three,4-division3,1992/93,2003/04
|
121
|
+
eng.3,English Division Three,3-division3,,1991/92
|
122
|
+
eng.1,English Premier League,1-premierleague,1992/93,
|
123
|
+
eng.5,English National League,5-nationalleague,1992/93,
|
124
|
+
eng.3.a,English Division Three (North),3a-division3_north,,
|
125
|
+
eng.3.b,English Division Three (South),3b-division3_south,,
|
126
|
+
eng.cup,English FA Cup,facup,,
|
127
|
+
eng.super,English FA Community Shield,facommunityshield,,
|
128
|
+
eng.cup.l,English EFL Cup,eflcup,,
|
129
|
+
eng.cup.t,English EFL Trophy,efltrophy,,
|
130
|
+
eng.cup.t.ii,English FA Trophy,fatrophy,,
|
131
|
+
de.1,Deutsche Bundesliga,1-bundesliga,,
|
132
|
+
de.2,Deutsche 2. Bundesliga,2-bundesliga2,,
|
133
|
+
de.3,Deutsche 3. Liga,3-liga3,,
|
134
|
+
de.cup,DFB Pokal,cup,,
|
135
|
+
de.super,Deutsche Supercup,super,,
|
136
|
+
de.4.nord,Deutsche Regionalliga Nord,4-regionalliga-nord,,
|
137
|
+
de.4.nordost,Deutsche Regionalliga Nordost,4-regionalliga-nordost,,
|
138
|
+
de.4.west,Deutsche Regionalliga West,4-regionalliga-west,,
|
139
|
+
de.4.suedwest,Deutsche Regionalliga Südwest,4-regionalliga-suedwest,,
|
140
|
+
de.4.bayern,Deutsche Regionalliga Bayern,4-regionalliga-bayern,,
|
141
|
+
de.5.nord.sh,Deutsche Schleswig-Holstein-Liga,schleswigholsteinliga,,
|
142
|
+
de.5.nord.hh,Deutsche Oberliga Hamburg,oberligahamburg,,
|
143
|
+
de.5.nord.hb,Deutsche Bremen-Liga,bremenliga,,
|
144
|
+
de.5.nord.ni,Deutsche Oberliga Niedersachsen,oberliganiedersachsen,,
|
145
|
+
de.5.nordost.n,Deutsche Oberliga Nordost (Nord),oberliganordostnord,,
|
146
|
+
de.5.nordost.s,Deutsche Oberliga Nordost (Süd),oberliganordostsud,,
|
147
|
+
de.5.west.niederrhein,Deutsche Oberliga Niederrhein,oberliganiederrhein,,
|
148
|
+
de.5.west.mittelrhein,Deutsche Mittelrheinliga,mittelrheinliga,,
|
149
|
+
de.5.west.westfalen,Deutsche Oberliga Westfalen,oberligawestfalen,,
|
150
|
+
de.5.suedwest.rp.sl,Deutsche Oberliga Rheinland-Pfalz/Saar,oberligarheinlandpfalzsaar,,
|
151
|
+
de.5.suedwest.he,Deutsche Hessenliga,hessenliga,,
|
152
|
+
de.5.suedwest.bw,Deutsche Oberliga Baden-Württemberg,oberligabadenwurttemberg,,
|
153
|
+
de.5.by.n,Deutsche Bayernliga (Nord),bayernliganord,,
|
154
|
+
de.5.by.s,Deutsche Bayernliga (Süd),bayernligasud,,
|
155
|
+
uefa.cl,UEFA Champions League,cl,1992/93,
|
156
|
+
uefa.cl.quali,UEFA Champions League - Quali,uefachampionsleaguequali,1992/93,
|
157
|
+
euro.champs,European Champion Clubs' Cup,champs,1955/56,1991/92
|
158
|
+
euro.cup,European Cup Winners' Cup,cupwinners,1960/61,1998/99
|
159
|
+
uefa.el,UEFA Europa League,el,2009/10,
|
160
|
+
uefa.el.quali,UEFA Europa League - Quali,uefaeuropaleaguequali,2009/10,
|
161
|
+
uefa.cup,UEFA Cup,cup,1971/72,2008/09
|
162
|
+
uefa.conf,UEFA Conference League,conf,2021/22,
|
163
|
+
uefa.conf.quali,UEFA Conference League - Quali,uefaconferenceleaguequali,2021/22,
|
164
|
+
uefa.super,UEFA Super Cup,super,1972,
|
165
|
+
atl.cup,Atlantic Cup,atlanticcup,,
|
166
|
+
czsk.super,Czechoslovak Supercup,czechoslovaksupercup,,
|
167
|
+
sco.1,Scottish Premiership,1-premiership,,
|
168
|
+
sco.2,Scottish Championship,championship,,
|
169
|
+
sco.3,Scottish League One,leagueone,,
|
170
|
+
sco.4,Scottish League Two,leaguetwo,,
|
171
|
+
sco.cup.l,Scottish League Cup,leaguecup,,
|
172
|
+
sco.cup.fa,Scottish FA Cup,facup,,
|
173
|
+
sco.cup.cc,Scottish Challenge Cup,challengecup,,
|
174
|
+
wal.1,Welsh Premier League,1-premierleague,,
|
175
|
+
nir.1,Northern Irish Premiership,1-premiership,,
|
176
|
+
nir.2,Northern Irish Championship,championship,,
|
177
|
+
nir.cup.l,Northern Irish League Cup,leaguecup,,
|
178
|
+
nir.cup,Northern Irish Irish Cup,irishcup,,
|
179
|
+
nir.super,Northern Irish NIFL Charity Shield,niflcharityshield,,
|
180
|
+
ie.1,Irish Premier Division,1-premierdivision,,
|
181
|
+
ie.2,Irish First Division,firstdivision,,
|
182
|
+
ie.cup.l,Irish League Cup,leaguecup,,
|
183
|
+
ie.super,Irish Supercup,supercup,,
|
184
|
+
ie.cup,Irish FAI Cup,faicup,,
|
185
|
+
is.1,Iceland Urvalsdeild,1-urvalsdeild,,
|
186
|
+
is.2,Iceland 1. Deild,1deild,,
|
187
|
+
is.3,Iceland 2. Delid,2delid,,
|
188
|
+
is.cup,Iceland Cup,cup,,
|
189
|
+
is.cup.l,Iceland League Cup,leaguecup,,
|
190
|
+
is.super,Iceland Super Cup,supercup,,
|
191
|
+
fo.1,Faroe Islands Premier Division,1-premierdivision,,
|
192
|
+
es.1,Primera División de España,1-liga,,
|
193
|
+
es.2,Segunda División de España,2-liga2,,
|
194
|
+
es.3,Spain Segunda División B,segundadivisionb,,
|
195
|
+
es.cup,Copa del Rey de España,cup,,
|
196
|
+
es.super,Spain Supercopa,supercopa,,
|
197
|
+
pt.1,Portuguese Primeira Liga,1-primeiraliga,,
|
198
|
+
pt.2,Portuguese Segunda Liga,2-segundaliga,,
|
199
|
+
pt.cup,Portuguese Taça de Portugal,tacadeportugal,,
|
200
|
+
pt.cup.l,Portuguese Taça da Liga,tacadaliga,,
|
201
|
+
pt.super,Portuguese Supercup,supercup,,
|
202
|
+
gi.1,Gibraltar Premier League A,1-premierleague,,
|
203
|
+
ad.1,Andorra Premier Division,1-premierdisvision,,
|
204
|
+
fr.1,French Ligue 1,1-ligue1,,
|
205
|
+
fr.2,French Ligue 2,2-ligue2,,
|
206
|
+
fr.3,French National,national,,
|
207
|
+
fr.cup,French Coupe de France,cup,,
|
208
|
+
fr.cup.l,French Coupe de la Ligue,coupedelaligue,,
|
209
|
+
fr.super,French Trophée des Champions,tropheedeschampions,,
|
210
|
+
it.1,Italian Serie A,1-seriea,,
|
211
|
+
it.2,Italian Serie B,2-serieb,,
|
212
|
+
it.3.a,Italian Serie C (North & Central West),seriecnorthcentralwest,,
|
213
|
+
it.3.b,Italian Serie C (North & Central East),seriecnorthcentraleast,,
|
214
|
+
it.3.c,Italian Serie C (South),seriecsouth,,
|
215
|
+
it.cup,Coppa Italia,cup,,
|
216
|
+
it.cup.c,Italian Coppa Italia Serie C,coppaitaliaseriec,,
|
217
|
+
it.super,Italian Supercoppa Italiana,supercoppaitaliana,,
|
218
|
+
sm.1,San Marinese Championship,1-championship,,
|
219
|
+
tr.1,Turkish Süper Lig,1-superlig,,
|
220
|
+
tr.2,Turkish 1. Lig,2-lig1,,
|
221
|
+
tr.3.b,Turkish 2. Lig - Beya,2ligbeya,,
|
222
|
+
tr.3.ki,Turkish 2. Lig - Kirmizi,2ligkirmizi,,
|
223
|
+
tr.3.playoffs,Turkish 2. Lig - Play Offs,2ligplayoffs,,
|
224
|
+
tr.cup,Türkiye Kupasi,turkiyekupasi,,
|
225
|
+
tr.super,Turkish Süper Kupa,superkupa,,
|
226
|
+
gr.1,Greek Super League,1-superleague,,
|
227
|
+
gr.2,Greek Super League 2,superleague2,,
|
228
|
+
gr.cup,Greek Greek Cup,greekcup,,
|
229
|
+
cy.1,Cyprus First Division,1-firstdivision,,
|
230
|
+
cy.cup,Cyprus Cypriot Cup,cypriotcup,,
|
231
|
+
mt.1,Malta Premier League,1-premierleague,,
|
232
|
+
mt.cup,Malta Cup,cup,,
|
233
|
+
dk.1,Denmark Superligaen,1-superligaen,,
|
234
|
+
dk.2,Denmark 1. Division,1division,,
|
235
|
+
dk.cup,Denmark Landspokalturneringen,landspokalturneringen,,
|
236
|
+
no.1,Norway Eliteserien,1-eliteserien,,
|
237
|
+
no.2,Norway 1. Division,1division,,
|
238
|
+
no.3,Norway 2. Division,2division,,
|
239
|
+
no.cup,Norway Norwegian Football Cup,norwegianfootballcup,,
|
240
|
+
se.1,Sweden Allsvenskan,1-allsvenskan,,
|
241
|
+
se.2,Sweden Superettan,2-superettan,,
|
242
|
+
se.3.s,Sweden Div 1 Södra,div1sodra,,
|
243
|
+
se.3.n,Sweden Div 1 Norra,div1norra,,
|
244
|
+
se.cup,Sweden Cup,cup,,
|
245
|
+
fi.1,Finland Veikkausliiga,1-veikkausliiga,,
|
246
|
+
fi.2,Finland Ykkonen,ykkonen,,
|
247
|
+
fi.3,Finland Kakkonen,kakkonen,,
|
248
|
+
fi.4.a,Finland Kakkonen Group A,kakkonengroupa,,
|
249
|
+
fi.cup,Finland Cup,cup,,
|
250
|
+
nl.1,Netherlands Eredivisie,1-eredivisie,,
|
251
|
+
nl.1.comeback,Netherlands Eredivisie Comeback Tournament,eredivisiecomebacktournament,,
|
252
|
+
nl.2,Netherlands Eerste Divisie,eerstedivisie,,
|
253
|
+
nl.cup,Netherlands Cup,cup,,
|
254
|
+
nl.super,Netherlands Johan Cruijff Schaal,johancruijffschaal,,
|
255
|
+
nl.po,Netherlands Promotion/Relegation Playoffs,promotionrelegationplayoffs,,
|
256
|
+
be.1,Belgium First Division A,1-firstdivisiona,,
|
257
|
+
be.2,Belgium First Division B,firstdivisionb,,
|
258
|
+
be.cup,Beker van Belgie,bekervanbelgie,,
|
259
|
+
be.super,Belgium Supercup,supercup,,
|
260
|
+
lu.1,Luxembourg National Division,1-nationaldivision,,
|
261
|
+
pl.1,Poland Ekstraklasa,1-ekstraklasa,,
|
262
|
+
pl.2,Poland I Liga,iliga,,
|
263
|
+
pl.3,Poland II Liga,iiliga,,
|
264
|
+
pl.cup,Poland Cup,cup,,
|
265
|
+
pl.super,Poland Supercup,supercup,,
|
266
|
+
hu.1,Hungarian Nemzeti Bajnokság I,1-nbi,,
|
267
|
+
hu.2,Hungarian Nemzeti Bajnokság II,2-nbii,,
|
268
|
+
hu.cup,Hungarian Cup,cup,,
|
269
|
+
cz.1,Czech Republic First League,1-firstleague,,
|
270
|
+
cz.2,Czech Republic 1. Division,1division,,
|
271
|
+
cz.cup,Czech Republic Cup,cup,,
|
272
|
+
ch.1,Swiss Super League,1-superleague,,
|
273
|
+
ch.2,Swiss Challenge League,2-challengeleague,,
|
274
|
+
ch.3,Swiss Promotion League,promotionleague,,
|
275
|
+
ch.cup,Swiss Cup,cup,,
|
276
|
+
li.cup,Liechtensteiner Pokal,cup,,
|
277
|
+
sk.1,Slovakia First League,1-liga1,,
|
278
|
+
sk.2,Slovakia Second League,secondleague,,
|
279
|
+
sk.cup,Slovakia Cup,cup,,
|
280
|
+
si.1,Slovenia First League,1-firstleague,,
|
281
|
+
si.2,Slovenia Second League,secondleague,,
|
282
|
+
si.cup,Slovenia Cup,cup,,
|
283
|
+
hr.1,Croatia HNL,1-hnl,,
|
284
|
+
hr.2,Croatia Prva NL,prvanl,,
|
285
|
+
hr.3,Croatia Druga NL,druganl,,
|
286
|
+
hr.cup,Croatia Cup,cup,,
|
287
|
+
hr.super,Croatia Supercup,supercup,,
|
288
|
+
ba.1,Bosnia and Herzegovina Premier Liga,1-premierliga,,
|
289
|
+
ba.cup,Bosnia and Herzegovina Cup,cup,,
|
290
|
+
rs.1,Serbia Super League,1-superleague,,
|
291
|
+
rs.cup,Serbia Cup,cup,,
|
292
|
+
kos.1,Kosovo Superliga A,1-superliga,,
|
293
|
+
al.1,Albania Super League,1-superleague,,
|
294
|
+
md.1,Moldova First Division,1-firstdivision,,
|
295
|
+
me.1,Montenegro First League,1-firstleague,,
|
296
|
+
me.cup,Montenegro Cup,cup,,
|
297
|
+
mk.1,North Macedonia First League,1-firstleague,,
|
298
|
+
ro.1,Romania Liga 1,1-liga1,,
|
299
|
+
ro.2,Romania Liga 2,liga2,,
|
300
|
+
ro.3.a,Romania Liga 3 - Seria 1,liga3seria1,,
|
301
|
+
ro.cup,Romania Cup,cup,,
|
302
|
+
ro.super,Romania Supercup,supercup,,
|
303
|
+
bg.1,Bulgaria Premier League,1-premierleague,,
|
304
|
+
bg.cup,Bulgaria Cup,cup,,
|
305
|
+
bg.super,Bulgaria Supercup,supercup,,
|
306
|
+
lv.1,Latvia Higher League,1-higherleague,,
|
307
|
+
lt.1,Lithuania First Division,1-firstdivision,,
|
308
|
+
ee.1,Estonia Meistriliiga,1-meistriliiga,,
|
309
|
+
ee.cup,Estonia Cup,cup,,
|
310
|
+
ru.1,Russia Premier League,1-premierliga,,
|
311
|
+
ru.2,Russia 1. Division,2-division1,,
|
312
|
+
ru.cup,Russia Cup,cup,,
|
313
|
+
ru.super,Russia Supercup,supercup,,
|
314
|
+
ua.1,Ukraine Premier League,1-premierleague,,
|
315
|
+
ua.cup,Ukraine Cup,cup,,
|
316
|
+
ua.super,Ukraine Supercup,supercup,,
|
317
|
+
by.1,Belarus Premier League,1-premierleague,,
|
318
|
+
by.2,Belarus Pervaya Liga,pervayaliga,,
|
319
|
+
by.3,Belarus Vtoraya Liga,vtorayaliga,,
|
320
|
+
by.cup,Belarus Cup,cup,,
|
321
|
+
by.res,Belarus Reserve Liga,reserveliga,,
|
322
|
+
am.1,Armenia Premier League,1-premierleague,,
|
323
|
+
az.1,Azerbaijan Premier League A,1-premierleague,,
|
324
|
+
ge.1,Georgia Premier League A,1-premierleague,,
|
325
|
+
world,World Cup,cup,,
|
326
|
+
world.quali.europe,World Cup Quali Europe,worldcupqualieurope,,
|
327
|
+
world.quali.northamerica,World Cup Quali North/Central America and Caribbean,worldcupqualinorthcentralamericaandcaribbean,,
|
328
|
+
world.quali.southamerica,World Cup Quali South America,worldcupqualisouthamerica,,
|
329
|
+
world.quali.africa,World Cup Quali Africa,worldcupqualiafrica,,
|
330
|
+
world.quali.asia,World Cup Quali Asia (w/ Australia),worldcupqualiasiawaustralia,,
|
331
|
+
world.quali.pacific,World Cup Quali South Pacific,worldcupqualisouthpacific,,
|
332
|
+
world.quali.playoffs,World Cup Quali Intercontinental Playoffs,worldcupqualiintercontinentalplayoffs,,
|
333
|
+
world.confed,Confederations Cup,confederationscup,,
|
334
|
+
euro,Euro,euro,1960,
|
335
|
+
euro.quali,Euro Quali,euroquali,,
|
336
|
+
uefa.nl,UEFA Nations League,nl,2018/19,
|
337
|
+
uefa.nl.a,UEFA Nations League A,nla,2018/19,
|
338
|
+
uefa.nl.b,UEFA Nations League B,nlb,2018/19,
|
339
|
+
uefa.nl.c,UEFA Nations League C,nlc,2018/19,
|
340
|
+
southamerica,Copa América,copaamerica,,
|
341
|
+
northamerica,Gold Cup,goldcup,,
|
342
|
+
asia,Asian Cup,asiancup,,
|
343
|
+
africa,Africa Cup of Nations,africacupofnations,,
|
344
|
+
paficic,South Pacific Nations Cup,southpacificnationscup,,
|
345
|
+
world.club,Club World Cup,clubworldcup,,
|
346
|
+
il.1,Israel Premier League,1-premierleague,,
|
347
|
+
il.2,Israel National League,nationalleague,,
|
348
|
+
il.cup,Israel League Cup National,leaguecupnational,,
|
349
|
+
il.cup.lp,Israel League Cup Premier,leaguecuppremier,,
|
350
|
+
il.super,Israel Supercup,supercup,,
|
351
|
+
ps.1.i,Palestine West Bank Premier League,westbankpremierleague,,
|
352
|
+
ps.1.ii,Palestine Gaza Strip Premier League,gazastrippremierleague,,
|
353
|
+
ps.cup.gaza,Palestine Gaza Strip Cup,gazastripcup,,
|
354
|
+
sa.1,Saudi Arabia Saudi Professional League,saudiprofessionalleague,,
|
355
|
+
sa.cup,Saudi Arabia King Cup,kingcup,,
|
356
|
+
sa.super,Saudi Arabia Super Cup,supercup,,
|
357
|
+
qa.1,Qatar Stars League,starsleague,,
|
358
|
+
ir.1,Iran Pro League,proleague,,
|
359
|
+
bh.1,Bahrain Premier League,premierleague,,
|
360
|
+
om.cup,Oman Sultan Cup,sultancup,,
|
361
|
+
concacaf.cl,CONCACAF Champions League,concacafchampionsleague,,
|
362
|
+
concacaf.l,CONCACAF League,concacafleague,,
|
363
|
+
usmx.cup,US & Mexican Leagues Cup,usmexicanleaguescup,,
|
364
|
+
ca.1,Canada Premier League,premierleague,,
|
365
|
+
us.1,Major League Soccer,majorleaguesoccer,,
|
366
|
+
us.mls.back,MLS is Back Tournament,mlsisbacktournament,,
|
367
|
+
us.2,United Soccer League Championship,unitedsoccerleaguechampionship,,
|
368
|
+
us.3,United Soccer League One,unitedsoccerleagueone,,
|
369
|
+
us.4,United Soccer League Two,unitedsoccerleaguetwo,,
|
370
|
+
us.cup,US Open Cup,usopencup,,
|
371
|
+
us.ncaa,United States NCAA Men's Soccer,ncaamenssoccer,,
|
372
|
+
mx.1,Liga MX,1-ligamx,,
|
373
|
+
mx.2,Liga de Expansión MX,2-ligaexpansionmx,2020/21,
|
374
|
+
mx.2,Ascenso MX,2-ascensomx,,2019/20
|
375
|
+
mx.copa,Mexico Copa MX,copamx,,
|
376
|
+
au.1,Australia A-League,aleague,,
|
377
|
+
au.2.qpr,Australia Queensland Premier,queenslandpremier,,
|
378
|
+
au.cup,Australia FFA Cup,ffacup,,
|
379
|
+
ar.1,Argentina Primera Division,1-primeradivision,,
|
380
|
+
ar.2,Argentina Primera B Nacional,primerabnacional,,
|
381
|
+
ar.3.metro,Argentina Primera B Metropolitana,primerabmetropolitana,,
|
382
|
+
ar.3.fed,Argentina Torneo Federal A,torneofederala,,
|
383
|
+
ar.4.metro,Argentina Primera C Metropolitana,primeracmetropolitana,,
|
384
|
+
ar.4.fed,Argentina Torneo Federal B,torneofederalb,,
|
385
|
+
ar.5.metro,Argentina Primera D Metropolitana,primeradmetropolitana,,
|
386
|
+
ar.5.fed,Argentina Torneo Federal C,torneofederalc,,
|
387
|
+
ar.copa,Argentina Copa Argentina,copaargentina,,
|
388
|
+
ar.copa.l,Argentina Copa Superliga,copasuperliga,,
|
389
|
+
ar.super,Argentina Supercopa Argentina,supercopaargentina,,
|
390
|
+
br.1,Brasileiro Série A,1-seriea,,
|
391
|
+
br.2,Brasileiro Série B,2-serieb,,
|
392
|
+
br.3,Brasileiro Série C,3-seriec,,
|
393
|
+
br.4,Brasileiro Série D,4-seried,,
|
394
|
+
br.copa,Copa do Brasil,cup,,
|
395
|
+
br.league,Brazil Primeira Liga,primeiraliga,,
|
396
|
+
br.rs,Campeonato Gaúcho,gauchao,,
|
397
|
+
br.rs.2,Brazil Divisão de Acesso Gaúcha,divisaodeacessogaucha,,
|
398
|
+
br.rs.3,Brazil Terceirona,terceirona,,
|
399
|
+
br.sp,Campeonato Paulista,paulistao,,
|
400
|
+
br.rj,Campeonato Carioca,carioca,,
|
401
|
+
br.mg,Campeonato Mineiro,mineiro,,
|
402
|
+
br.paranaense,Campeonato Paranaense,paranaense,,
|
403
|
+
copa.l,Copa Libertadores,libertadores,,
|
404
|
+
copa.s,Copa Sudamericana,sudamericana,,
|
405
|
+
recopa,Recopa Sudamericana,recopasudamericana,,
|
406
|
+
py.1,Paraguay Primera Division,primeradivision,,
|
407
|
+
pe.1,Peru Primera Division,primeradivision,,
|
408
|
+
pe.2,Peru Segunda Division,segundadivision,,
|
409
|
+
pe.copa.bic,Peru Copa Bicentenario 2019,copabicentenario2019,,
|
410
|
+
bo.1,Bolivia Bolivian Primera División,bolivianprimeradivision,,
|
411
|
+
cl.1,Chile Primera Divison,primeradivison,,
|
412
|
+
cl.2,Chile Primera B,primerab,,
|
413
|
+
cl.copa,Copa Chile,copachile,,
|
414
|
+
co.1,Colombia Primera A,1-primeraa,,
|
415
|
+
co.2,Colombia Primera B,primerab,,
|
416
|
+
co.copa,Copa Colombia,copacolombia,,
|
417
|
+
co.super,Colombia Super Cup,supercup,,
|
418
|
+
uy.1,Uruguay Primera División,primeradivision,,
|
419
|
+
uy.copa,Uruguay Cup,cup,,
|
420
|
+
ec.1,Ecuador Serie A,seriea,,
|
421
|
+
ec.2,Ecuador Serie B,serieb,,
|
422
|
+
ve.1,Venezuela Primera División,primeradivision,,
|
423
|
+
ve.copa,Copa Venezuela,copavenezuela,,
|
@@ -68,16 +68,19 @@ def self.build( matches, rounds: true )
|
|
68
68
|
buf = String.new
|
69
69
|
# e.g. 13 April – 25 September 2024
|
70
70
|
# or 16 August 2024 – 25 May 2025
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
71
|
+
## note - date is optional!!
|
72
|
+
if stats['date']['start_date']
|
73
|
+
buf << "# Date "
|
74
|
+
start_date = stats['date']['start_date']
|
75
|
+
end_date = stats['date']['end_date']
|
76
|
+
if start_date.year != end_date.year
|
77
|
+
buf << "#{start_date.strftime('%a %b/%-d %Y')} - #{end_date.strftime('%a %b/%-d %Y')}"
|
78
|
+
else
|
79
|
+
buf << "#{start_date.strftime('%a %b/%-d')} - #{end_date.strftime('%a %b/%-d %Y')}"
|
80
|
+
end
|
81
|
+
buf << " (#{end_date.jd-start_date.jd}d)" ## add days
|
82
|
+
buf << "\n"
|
78
83
|
end
|
79
|
-
buf << " (#{end_date.jd-start_date.jd}d)" ## add days
|
80
|
-
buf << "\n"
|
81
84
|
|
82
85
|
buf << "# Teams #{stats['teams'].size}\n"
|
83
86
|
buf << "# Matches #{matches.size}\n"
|
@@ -159,14 +162,18 @@ def self._build_batch( matches, rounds: true )
|
|
159
162
|
|
160
163
|
buf << (round_translations[match.round] || match.round)
|
161
164
|
end
|
162
|
-
|
165
|
+
## note - reset last_date & last_time on every new round header
|
166
|
+
last_date = nil
|
167
|
+
last_time = nil
|
168
|
+
|
169
|
+
buf << "\n"
|
163
170
|
end
|
164
171
|
end
|
165
172
|
|
166
173
|
|
167
174
|
date = if match.date.is_a?( String )
|
168
175
|
Date.strptime( match.date, '%Y-%m-%d' )
|
169
|
-
else ## assume it's already a date (object)
|
176
|
+
else ## assume it's already a date (object) or nil!!!!
|
170
177
|
match.date
|
171
178
|
end
|
172
179
|
|
@@ -177,25 +184,22 @@ def self._build_batch( matches, rounds: true )
|
|
177
184
|
end
|
178
185
|
|
179
186
|
|
180
|
-
|
187
|
+
## note - date might be NIL!!!!!
|
188
|
+
date_yyyymmdd = date ? date.strftime( '%Y-%m-%d' ) : nil
|
181
189
|
|
182
190
|
## note: time is OPTIONAL for now
|
183
191
|
## note: use 17.00 and NOT 17:00 for now
|
184
192
|
time_hhmm = time ? time.strftime( '%H.%M' ) : nil
|
185
193
|
|
186
194
|
|
187
|
-
if
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
buf << "[#{format_date.call( date )}]\n"
|
196
|
-
last_time = nil
|
197
|
-
end
|
198
|
-
end
|
195
|
+
if date_yyyymmdd
|
196
|
+
if date_yyyymmdd != last_date
|
197
|
+
## note: add an extra leading blank line (if no round headings printed)
|
198
|
+
buf << "\n" unless rounds
|
199
|
+
buf << "[#{format_date.call( date )}]\n"
|
200
|
+
last_time = nil
|
201
|
+
end
|
202
|
+
end
|
199
203
|
|
200
204
|
|
201
205
|
## allow strings and structs for team names
|
@@ -207,17 +211,16 @@ def self._build_batch( matches, rounds: true )
|
|
207
211
|
line << ' '
|
208
212
|
|
209
213
|
if time
|
210
|
-
if last_time
|
214
|
+
if last_time != time_hhmm
|
211
215
|
line << "%5s" % time_hhmm
|
212
216
|
else
|
213
217
|
line << ' '
|
214
218
|
end
|
215
219
|
line << ' '
|
216
220
|
else
|
217
|
-
|
221
|
+
line << ' '
|
218
222
|
end
|
219
223
|
|
220
|
-
|
221
224
|
line << "%-23s" % team1 ## note: use %-s for left-align
|
222
225
|
|
223
226
|
line << " #{format_score.call( match )} " ## note: separate by at least two spaces for now
|
@@ -237,7 +240,8 @@ def self._build_batch( matches, rounds: true )
|
|
237
240
|
when Status::REPLAY
|
238
241
|
line << '[replay]'
|
239
242
|
when Status::POSTPONED
|
240
|
-
|
243
|
+
line << '[postponed]'
|
244
|
+
## was -- note: add NOTHING for postponed for now
|
241
245
|
else
|
242
246
|
puts "!! WARN - unknown match status >#{match.status}<:"
|
243
247
|
pp match
|
data/lib/sportdb/writers.rb
CHANGED
@@ -33,9 +33,7 @@ require_relative 'writers/league_config'
|
|
33
33
|
module Writer
|
34
34
|
LEAGUES = SportDb::LeagueConfig.new
|
35
35
|
|
36
|
-
['
|
37
|
-
'leagues_america',
|
38
|
-
'leagues_world'
|
36
|
+
['leagues',
|
39
37
|
].each do |name|
|
40
38
|
recs = read_csv( "#{SportDb::Module::Writers.root}/config/#{name}.csv" )
|
41
39
|
LEAGUES.add( recs )
|
@@ -56,83 +54,5 @@ require_relative 'fbgen/main'
|
|
56
54
|
|
57
55
|
|
58
56
|
|
59
|
-
########################
|
60
|
-
# push & pull github scripts
|
61
|
-
require 'gitti' ## note - requires git machinery
|
62
|
-
|
63
|
-
require_relative 'fbup/github_config'
|
64
|
-
require_relative 'fbup/github' ## github helpers/update machinery
|
65
|
-
|
66
|
-
|
67
|
-
module Fbup
|
68
|
-
class GitHubSync
|
69
|
-
REPOS = GitHubConfig.new
|
70
|
-
recs = read_csv( "#{SportDb::Module::Writers.root}/config/openfootball.csv" )
|
71
|
-
REPOS.add( recs )
|
72
|
-
|
73
|
-
## todo/check: find a better name for helper?
|
74
|
-
## note: datasets of format
|
75
|
-
##
|
76
|
-
## DATASETS = [
|
77
|
-
## ['it.1', %w[2020/21 2019/20]],
|
78
|
-
## ['it.2', %w[2019/20]],
|
79
|
-
## ['es.1', %w[2019/20]],
|
80
|
-
## ['es.2', %w[2019/20]],
|
81
|
-
## ]
|
82
|
-
|
83
|
-
def self.find_repos( datasets )
|
84
|
-
repos = []
|
85
|
-
datasets.each do |dataset|
|
86
|
-
league_key = dataset[0]
|
87
|
-
repo = REPOS[ league_key ]
|
88
|
-
## pp repo
|
89
|
-
if repo.nil?
|
90
|
-
puts "!! ERROR - no repo config/path found for league >#{league_key}<; sorry"
|
91
|
-
exit 1
|
92
|
-
end
|
93
|
-
|
94
|
-
repos << "#{repo['owner']}/#{repo['name']}"
|
95
|
-
end
|
96
|
-
|
97
|
-
pp repos
|
98
|
-
repos.uniq ## note: remove duplicates (e.g. europe or world or such)
|
99
|
-
end
|
100
|
-
end # class GitHubSync
|
101
|
-
end # module Fbup
|
102
|
-
|
103
|
-
|
104
|
-
require_relative 'fbup/main'
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
###
|
109
|
-
## todo/fix: move more code into tool class or such? - why? why not?
|
110
|
-
|
111
|
-
## todo/check: find a better name for helper?
|
112
|
-
## find_all_datasets, filter_datatsets - add alias(es???
|
113
|
-
## queries (lik ARGV) e.g. ['at'] or ['eng', 'de'] etc. list of strings
|
114
|
-
def filter_datasets( datasets, queries=[] )
|
115
|
-
## find all matching leagues (that is, league keys)
|
116
|
-
if queries.empty? ## no filter - get all league keys
|
117
|
-
datasets
|
118
|
-
else
|
119
|
-
datasets.find_all do |dataset|
|
120
|
-
found = false
|
121
|
-
## note: normalize league key (remove dot and downcase)
|
122
|
-
league_key = dataset[0].gsub( '.', '' )
|
123
|
-
queries.each do |query|
|
124
|
-
q = query.gsub( '.', '' ).downcase
|
125
|
-
if league_key.start_with?( q )
|
126
|
-
found = true
|
127
|
-
break
|
128
|
-
end
|
129
|
-
end
|
130
|
-
found
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
|
136
|
-
|
137
57
|
|
138
58
|
puts SportDb::Module::Writers.banner # say hello
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportdb-writers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: football-timezones
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: gitti
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rdoc
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,7 +78,6 @@ email: gerald.bauer@gmail.com
|
|
92
78
|
executables:
|
93
79
|
- fbgen
|
94
80
|
- fbtxt
|
95
|
-
- fbup
|
96
81
|
extensions: []
|
97
82
|
extra_rdoc_files:
|
98
83
|
- CHANGELOG.md
|
@@ -105,16 +90,9 @@ files:
|
|
105
90
|
- Rakefile
|
106
91
|
- bin/fbgen
|
107
92
|
- bin/fbtxt
|
108
|
-
-
|
109
|
-
- config/leagues_america.csv
|
110
|
-
- config/leagues_europe.csv
|
111
|
-
- config/leagues_world.csv
|
112
|
-
- config/openfootball.csv
|
93
|
+
- config/leagues.csv
|
113
94
|
- lib/sportdb/fbgen/main.rb
|
114
95
|
- lib/sportdb/fbtxt/main.rb
|
115
|
-
- lib/sportdb/fbup/github.rb
|
116
|
-
- lib/sportdb/fbup/github_config.rb
|
117
|
-
- lib/sportdb/fbup/main.rb
|
118
96
|
- lib/sportdb/writers.rb
|
119
97
|
- lib/sportdb/writers/goals.rb
|
120
98
|
- lib/sportdb/writers/league_config.rb
|
data/bin/fbup
DELETED
data/config/leagues_america.csv
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
key, name, basename, start_season, end_season, comments
|
2
|
-
|
3
|
-
ar.1, Argentina Primera Division, 1-primeradivision,,,
|
4
|
-
br.1, Brasileiro Série A, 1-seriea,,,
|
5
|
-
br.2, Brasileiro Série B, 1-serieb,,,
|
6
|
-
|
7
|
-
copa.l, Copa Libertadores, libertadores,,,
|
8
|
-
copa.s, Copa Sudamericana, sudamericana,,,
|
9
|
-
|
10
|
-
|
11
|
-
mx.1, Liga MX, 1-ligamx,,,
|
12
|
-
mx.2, Liga de Expansión MX, 2-ligaexpansionmx, 2020/21,,
|
13
|
-
mx.2, Ascenso MX, 2-ascensomx, ,2019/20,
|
14
|
-
|
15
|
-
|
16
|
-
|
data/config/leagues_europe.csv
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
key, name, basename, start_season, end_season, comments
|
2
|
-
|
3
|
-
at.1, Österr. Bundesliga, 1-bundesliga,,,
|
4
|
-
at.2, Österr. 2. Liga, 2-liga2, 2018/19,,
|
5
|
-
at.2, Österr. Erste Liga, 2-liga1, , 2017/18,
|
6
|
-
at.3.o, Österr. Regionalliga Ost, 3-regionalliga-ost,,,
|
7
|
-
at.cup, ÖFB Cup, cup,,,
|
8
|
-
|
9
|
-
|
10
|
-
de.1, Deutsche Bundesliga, 1-bundesliga,,,
|
11
|
-
de.2, Deutsche 2. Bundesliga, 2-bundesliga2,,,
|
12
|
-
de.3, Deutsche 3. Liga, 3-liga3,,,
|
13
|
-
de.4.bayern, Deutsche Regionalliga Bayern, 4-regionalliga-bayern,,,
|
14
|
-
de.4.n, Deutsche Regionalliga Nord, 4-regionalliga-nord,,,
|
15
|
-
de.4.no, Deutsche Regionalliga Nordost, 4-regionalliga-nordost,,,
|
16
|
-
de.4.w, Deutsche Regionalliga West, 4-regionalliga-west,,,
|
17
|
-
de.4.sw, Deutsche Regionalliga Südwest, 4-regionalliga-suedwest,,,
|
18
|
-
de.cup, DFB Pokal, cup,,,
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
it.1, Italian Serie A, 1-seriea,,,
|
23
|
-
it.2, Italian Serie B, 2-serieb,,,
|
24
|
-
|
25
|
-
es.1, Primera División de España, 1-liga,,,
|
26
|
-
es.2, Segunda División de España, 2-liga2,,,
|
27
|
-
|
28
|
-
fr.1, French Ligue 1, 1-ligue1,,,
|
29
|
-
fr.2, French Ligue 2, 2-ligue2,,,
|
30
|
-
|
31
|
-
|
32
|
-
eng.1, English Premier League, 1-premierleague, 1992/93,,
|
33
|
-
eng.1, English Division One, 1-division1, 1892/93, 1991/92, ## start of division 1 & 2
|
34
|
-
eng.1, English Football League, 1-footballleague, 1888/89, 1891/92, ## single league (no divisions)
|
35
|
-
|
36
|
-
eng.2, English Championship, 2-championship, 2004/05,, ## rebranding divsion 1 => championship
|
37
|
-
eng.2, English Division One, 2-division1, 1992/93, 2003/04, ## start of premier league
|
38
|
-
eng.2, English Division Two, 2-division2, 1892/93, 1991/92, ## or use English Football League Second Division ???
|
39
|
-
|
40
|
-
eng.3, English League One, 3-league1,,,
|
41
|
-
eng.4, English League Two, 4-league2,,,
|
42
|
-
eng.5, English National League, 5-nationalleague,,,
|
43
|
-
eng.cup, English FA Cup, facup,,,
|
44
|
-
|
45
|
-
|
46
|
-
hu.1, Hungarian NB I, 1-nbi,,,
|
47
|
-
|
48
|
-
gr.1, Super League Greece, 1-superleague,,,
|
49
|
-
|
50
|
-
pt.1, Portuguese Primeira Liga, 1-primeiraliga,,,
|
51
|
-
pt.2, Portuguese Segunda Liga, 2-segundaliga,,,
|
52
|
-
|
53
|
-
ch.1, Swiss Super League, 1-superleague,,,
|
54
|
-
ch.2, Swiss Challenge League, 2-challengeleague,,,
|
55
|
-
ch.cup, Swiss Cup, cup,,,
|
56
|
-
|
57
|
-
|
58
|
-
tr.1, Turkish Süper Lig, 1-superlig,,,
|
59
|
-
tr.2, Turkish 1. Lig, 2-lig1,,,
|
60
|
-
|
61
|
-
is.1, Iceland Urvalsdeild, 1-urvalsdeild,,,
|
62
|
-
|
63
|
-
sco.1, Scottish Premiership, 1-premiership,,,
|
64
|
-
|
65
|
-
ie.1, Irish Premier Division, 1-premierdivision,,,
|
66
|
-
|
67
|
-
fi.1, Finland Veikkausliiga, 1-veikkausliiga,,,
|
68
|
-
|
69
|
-
se.1, Sweden Allsvenskan, 1-allsvenskan,,,
|
70
|
-
se.2, Sweden Superettan, 2-superettan,,,
|
71
|
-
|
72
|
-
no.1, Norwegian Eliteserien, 1-eliteserien,,,
|
73
|
-
dk.1, Denmark Superligaen, 1-superligaen,,,
|
74
|
-
|
75
|
-
lu.1, Luxembourger First Division, 1-nationaldivision,,,
|
76
|
-
|
77
|
-
be.1, Belgian First Division A, 1-firstdivisiona,,,
|
78
|
-
|
79
|
-
nl.1, Dutch Eredivisie, 1-eredivisie,,,
|
80
|
-
|
81
|
-
cz.1, Czech First League, 1-firstleague,,,
|
82
|
-
sk.1, Slovakia First League, 1-superliga,,,
|
83
|
-
hr.1, Croatia 1. HNL, 1-hnl,,,
|
84
|
-
|
85
|
-
pl.1, Poland Ekstraklasa, 1-ekstraklasa,,,
|
86
|
-
|
87
|
-
ro.1, Romanian Liga 1, 1-liga1,,,
|
88
|
-
|
89
|
-
ua.1, Ukraine Premier League, 1-premierleague,,,
|
90
|
-
|
91
|
-
ru.1, Russian Premier League, 1-premierliga,,,
|
92
|
-
ru.2, Russian 1. Division, 2-division1,,,
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
## use uefa.1 - why? why not?
|
97
|
-
## uefa.2,
|
98
|
-
## uefa.3
|
99
|
-
uefa.cl, UEFA Champions League, cl,,, ### use champs or such?
|
100
|
-
uefa.el, UEFA Europa League, el,,, ### use europa
|
101
|
-
uefa.conf, UEFA Conference League, conf,,, ### use con (conf - confusion with config files?)
|
102
|
-
|
103
|
-
uefa.nl, UEFA Nations League, nl,,,
|
104
|
-
euro, Euro, euro,,,
|
data/config/leagues_world.csv
DELETED
data/config/openfootball.csv
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
key, path
|
2
|
-
|
3
|
-
at, austria
|
4
|
-
|
5
|
-
de, deutschland
|
6
|
-
eng, england
|
7
|
-
es, espana
|
8
|
-
it, italy
|
9
|
-
|
10
|
-
fr, europe/france
|
11
|
-
|
12
|
-
hu, europe/hungary
|
13
|
-
gr, europe/greece
|
14
|
-
pt, europe/portugal
|
15
|
-
|
16
|
-
ch, europe/switzerland
|
17
|
-
|
18
|
-
tr, europe/turkey
|
19
|
-
|
20
|
-
is, europe/iceland
|
21
|
-
sco, europe/scotland
|
22
|
-
ie, europe/ireland
|
23
|
-
|
24
|
-
fi, europe/finland
|
25
|
-
se, europe/sweden
|
26
|
-
no, europe/norway
|
27
|
-
dk, europe/denmark
|
28
|
-
|
29
|
-
lu, europe/luxembourg
|
30
|
-
be, europe/belgium
|
31
|
-
nl, europe/netherlands
|
32
|
-
cz, europe/czech-republic
|
33
|
-
|
34
|
-
sk, europe/slovakia
|
35
|
-
hr, europe/croatia
|
36
|
-
pl, europe/poland
|
37
|
-
|
38
|
-
ro, europe/romania
|
39
|
-
|
40
|
-
ua, europe/ukraine
|
41
|
-
|
42
|
-
ru, europe/russia
|
43
|
-
|
44
|
-
|
45
|
-
uefa.cl, europe-champions-league
|
46
|
-
uefa.el, europe-champions-league
|
47
|
-
uefa.conf, europe-champions-league
|
48
|
-
|
49
|
-
euro, euro
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
mx, mexico
|
54
|
-
|
55
|
-
|
56
|
-
ar, south-america/argentina
|
57
|
-
br, south-america/brazil
|
58
|
-
|
59
|
-
copa.l, south-america/copa-libertadores
|
60
|
-
copa.s, south-america/copa-libertadores
|
61
|
-
|
62
|
-
|
63
|
-
cn, world/asia/china
|
64
|
-
jp, world/asia/japan
|
65
|
-
|
66
|
-
|
67
|
-
world, worldcup
|
data/lib/sportdb/fbup/github.rb
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
|
2
|
-
module Fbup
|
3
|
-
|
4
|
-
###
|
5
|
-
## todo/fix:
|
6
|
-
## add -i/--interactive flag
|
7
|
-
## will prompt yes/no before git operations (with consequences)!!!
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
class GitHubSync
|
12
|
-
|
13
|
-
########
|
14
|
-
## (auto)default to Writer.config.out_dir - why? why not?
|
15
|
-
##
|
16
|
-
## note - is monotree (that is, requires openfootball/england etc.
|
17
|
-
## for repo pathspecs)
|
18
|
-
def self.root() @root || "/sports"; end
|
19
|
-
def self.root=( dir ) @root = dir; end
|
20
|
-
## use root_dir (alias) - why? why not?
|
21
|
-
|
22
|
-
|
23
|
-
def initialize( repos )
|
24
|
-
@repos = repos
|
25
|
-
end
|
26
|
-
|
27
|
-
|
28
|
-
def git_push_if_changes
|
29
|
-
message = "auto-update week #{Date.today.cweek}" ## add /#{Date.today.cday - why? why not?
|
30
|
-
puts message
|
31
|
-
|
32
|
-
@repos.each do |pathspec|
|
33
|
-
_git_push_if_changes( pathspec, message: message )
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def git_fast_forward_if_clean
|
38
|
-
@repos.each do |pathspec|
|
39
|
-
_git_fast_forward_if_clean( pathspec )
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
## todo/fix: rename to something like
|
46
|
-
## git_(auto_)commit_and_push_if_changes/if_dirty()
|
47
|
-
|
48
|
-
def _git_push_if_changes( pathspec, message: )
|
49
|
-
path = "#{self.class.root}/#{pathspec}"
|
50
|
-
|
51
|
-
Gitti::GitProject.open( path ) do |proj|
|
52
|
-
puts ''
|
53
|
-
puts "###########################################"
|
54
|
-
puts "## trying to commit & push repo in path >#{path}<"
|
55
|
-
puts "Dir.getwd: #{Dir.getwd}"
|
56
|
-
output = proj.changes
|
57
|
-
if output.empty?
|
58
|
-
puts "no changes found; skipping commit & push"
|
59
|
-
else
|
60
|
-
proj.add( '.' )
|
61
|
-
proj.commit( message )
|
62
|
-
proj.push
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
|
68
|
-
def _git_fast_forward_if_clean( pathspec )
|
69
|
-
path = "#{self.class.root}/#{pathspec}"
|
70
|
-
|
71
|
-
Gitti::GitProject.open( path ) do |proj|
|
72
|
-
output = proj.changes
|
73
|
-
unless output.empty?
|
74
|
-
puts "FAIL - cannot git pull (fast-forward) - working tree has changes:"
|
75
|
-
puts output
|
76
|
-
exit 1
|
77
|
-
end
|
78
|
-
|
79
|
-
proj.fast_forward
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end # class GitHub
|
83
|
-
end # module Fbup
|
@@ -1,97 +0,0 @@
|
|
1
|
-
|
2
|
-
module Fbup
|
3
|
-
class GitHubConfig
|
4
|
-
|
5
|
-
## map leagues to repo+path
|
6
|
-
## e.g. fr.1 => europe/france
|
7
|
-
## eng..1 => england
|
8
|
-
##
|
9
|
-
## for other than openfootball (default)
|
10
|
-
## use @
|
11
|
-
## e.g. myorg@austria
|
12
|
-
## austria@myorg ??
|
13
|
-
##
|
14
|
-
## myorg@europe/france
|
15
|
-
## europe/france@myorg
|
16
|
-
|
17
|
-
|
18
|
-
def self.read( path )
|
19
|
-
recs = read_csv( path )
|
20
|
-
new( recs )
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize( recs=nil )
|
24
|
-
@table = {}
|
25
|
-
add( recs ) if recs
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
def add( recs )
|
30
|
-
recs.each do |rec|
|
31
|
-
path = rec['path'] ## use pathspec - why? why not?
|
32
|
-
## or repospec or such
|
33
|
-
|
34
|
-
## auto-expand to openfootball as default org if no @ specified
|
35
|
-
owner, path = if path.index( '@')
|
36
|
-
path.split( '@', 2 )
|
37
|
-
else
|
38
|
-
['openfootball', path ]
|
39
|
-
end
|
40
|
-
name, path = path.split( '/', 2 )
|
41
|
-
|
42
|
-
|
43
|
-
## openfootball@europe/france
|
44
|
-
## =>
|
45
|
-
## owner: openfootball
|
46
|
-
## name: europe
|
47
|
-
## path: france
|
48
|
-
##
|
49
|
-
## openfootball@austria
|
50
|
-
## =>
|
51
|
-
## owner: openfootball
|
52
|
-
## name: austria
|
53
|
-
## path: nil
|
54
|
-
@table[ rec['key'] ] = { 'owner' => owner, ## (required)
|
55
|
-
'name' => name, ## (required)
|
56
|
-
'path' => path ## extra/inner/inside/local path (optional)
|
57
|
-
}
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
|
62
|
-
##
|
63
|
-
## todo/fix:
|
64
|
-
## make key lookup more flexible
|
65
|
-
## auto-add more variants!!!
|
66
|
-
## e.g. at.1 AT1, AT or such
|
67
|
-
##
|
68
|
-
|
69
|
-
## find (full) record by key
|
70
|
-
def find( key )
|
71
|
-
key = key.to_s.downcase
|
72
|
-
|
73
|
-
## first check for 1:1 match
|
74
|
-
rec = @table[key]
|
75
|
-
if rec.nil?
|
76
|
-
## try match by (country / first) code
|
77
|
-
## split by .
|
78
|
-
key, _ = key.split( '.' )
|
79
|
-
rec = @table[key]
|
80
|
-
end
|
81
|
-
|
82
|
-
rec
|
83
|
-
end
|
84
|
-
alias_method :[], :find ## keep alias - why? why not?
|
85
|
-
|
86
|
-
|
87
|
-
def find_repo( key )
|
88
|
-
rec = _find( key )
|
89
|
-
|
90
|
-
rec ? "#{rec['owner']}/#{rec['name']}" : nil
|
91
|
-
end
|
92
|
-
|
93
|
-
end # class GitHubConfig
|
94
|
-
end # module Fbup
|
95
|
-
|
96
|
-
|
97
|
-
|
data/lib/sportdb/fbup/main.rb
DELETED
@@ -1,162 +0,0 @@
|
|
1
|
-
|
2
|
-
module Fbup
|
3
|
-
def self.main( args=ARGV )
|
4
|
-
|
5
|
-
opts = {
|
6
|
-
source_path: [],
|
7
|
-
push: false,
|
8
|
-
ffwd: false,
|
9
|
-
dry: false, ## dry run (no write)
|
10
|
-
test: true, ## sets push & ffwd to false
|
11
|
-
debug: true,
|
12
|
-
file: nil,
|
13
|
-
test_dir: './o',
|
14
|
-
}
|
15
|
-
|
16
|
-
|
17
|
-
parser = OptionParser.new do |parser|
|
18
|
-
parser.banner = "Usage: #{$PROGRAM_NAME} [options] [args]"
|
19
|
-
|
20
|
-
parser.on( "-p", "--[no-]push",
|
21
|
-
"fast forward sync and commit & push changes to git repo - default is (#{opts[:push]})" ) do |push|
|
22
|
-
opts[:push] = push
|
23
|
-
if opts[:push] ## note: autoset ffwd too if push == true
|
24
|
-
opts[:ffwd] = true
|
25
|
-
opts[:test] = false
|
26
|
-
end
|
27
|
-
end
|
28
|
-
## todo/check - add a --ffwd flag too - why? why not?
|
29
|
-
|
30
|
-
parser.on( "-t", "--test",
|
31
|
-
"test run; writing output to #{opts[:test_dir]} - default is #{opts[:test]}" ) do |test|
|
32
|
-
opts[:test] = true
|
33
|
-
opts[:push] = false
|
34
|
-
opts[:ffwd] = false
|
35
|
-
end
|
36
|
-
parser.on( "--dry",
|
37
|
-
"dry run; do NOT write - default is (#{opts[:dry]})" ) do |dry|
|
38
|
-
opts[:dry] = dry
|
39
|
-
opts[:push] = false ### autoset push & ffwd - why? why not?
|
40
|
-
opts[:ffwd] = false
|
41
|
-
end
|
42
|
-
|
43
|
-
parser.on( "-q", "--quiet",
|
44
|
-
"less debug output/messages - default is (#{!opts[:debug]})" ) do |debug|
|
45
|
-
opts[:debug] = false
|
46
|
-
end
|
47
|
-
|
48
|
-
parser.on( "-I DIR", "--include DIR",
|
49
|
-
"add directory to (source) search path - default is (#{opts[:source_path].join(',')})") do |dir|
|
50
|
-
opts[:source_path] += path
|
51
|
-
end
|
52
|
-
|
53
|
-
parser.on( "-f FILE", "--file FILE",
|
54
|
-
"read leagues (and seasons) via .csv file") do |file|
|
55
|
-
opts[:file] = file
|
56
|
-
end
|
57
|
-
end
|
58
|
-
parser.parse!( args )
|
59
|
-
|
60
|
-
|
61
|
-
if opts[:source_path].empty? &&
|
62
|
-
File.exist?( '/sports/cache.api.fbdat') &&
|
63
|
-
File.exist?( '/sports/cache.wfb' )
|
64
|
-
opts[:source_path] << '/sports/cache.api.fbdat'
|
65
|
-
opts[:source_path] << '/sports/cache.wfb'
|
66
|
-
end
|
67
|
-
|
68
|
-
if opts[:source_path].empty?
|
69
|
-
opts[:source_path] = ['.'] ## use ./ as default
|
70
|
-
end
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
puts "OPTS:"
|
75
|
-
p opts
|
76
|
-
puts "ARGV:"
|
77
|
-
p args
|
78
|
-
|
79
|
-
|
80
|
-
datasets = if opts[:file]
|
81
|
-
read_datasets( opts[:file] )
|
82
|
-
else
|
83
|
-
parse_datasets_args( args )
|
84
|
-
end
|
85
|
-
|
86
|
-
puts "datasets:"
|
87
|
-
pp datasets
|
88
|
-
|
89
|
-
|
90
|
-
source_path = opts[:source_path]
|
91
|
-
|
92
|
-
root_dir = if opts[:test]
|
93
|
-
opts[:test_dir]
|
94
|
-
else
|
95
|
-
GitHubSync.root # e.g. "/sports"
|
96
|
-
end
|
97
|
-
|
98
|
-
puts " (output) root_dir: >#{root_dir}<"
|
99
|
-
|
100
|
-
repos = GitHubSync.find_repos( datasets )
|
101
|
-
puts " #{repos.size} repo(s):"
|
102
|
-
pp repos
|
103
|
-
sync = GitHubSync.new( repos )
|
104
|
-
|
105
|
-
puts " sync:"
|
106
|
-
pp sync
|
107
|
-
|
108
|
-
|
109
|
-
sync.git_fast_forward_if_clean if opts[:ffwd]
|
110
|
-
|
111
|
-
### step 0 - validate and fill-in seasons etc.
|
112
|
-
## reuse from Fbgen tool
|
113
|
-
Fbgen.validate_datasets!( datasets, source_path: source_path )
|
114
|
-
|
115
|
-
|
116
|
-
datasets.each do |league_key, seasons|
|
117
|
-
puts "==> gen #{league_key} - #{seasons.size} seasons(s)..."
|
118
|
-
|
119
|
-
league_info = Writer::LEAGUES[ league_key ]
|
120
|
-
pp league_info
|
121
|
-
|
122
|
-
seasons.each do |season|
|
123
|
-
filename = "#{season.to_path}/#{league_key}.csv"
|
124
|
-
path = Fbgen.find_file( filename, path: source_path )
|
125
|
-
|
126
|
-
### get matches
|
127
|
-
puts " ---> reading matches in #{path} ..."
|
128
|
-
matches = SportDb::CsvMatchParser.read( path )
|
129
|
-
puts " #{matches.size} matches"
|
130
|
-
|
131
|
-
## build
|
132
|
-
txt = SportDb::TxtMatchWriter.build( matches )
|
133
|
-
puts txt if opts[:debug]
|
134
|
-
|
135
|
-
league_name = league_info[ :name ] # e.g. Brasileiro Série A
|
136
|
-
basename = league_info[ :basename] #.e.g 1-seriea
|
137
|
-
|
138
|
-
league_name = league_name.call( season ) if league_name.is_a?( Proc ) ## is proc/func - name depends on season
|
139
|
-
basename = basename.call( season ) if basename.is_a?( Proc ) ## is proc/func - name depends on season
|
140
|
-
|
141
|
-
buf = String.new
|
142
|
-
buf << "= #{league_name} #{season}\n\n"
|
143
|
-
buf << txt
|
144
|
-
|
145
|
-
repo = GitHubSync::REPOS[ league_key ]
|
146
|
-
repo_path = "#{repo['owner']}/#{repo['name']}"
|
147
|
-
repo_path << "/#{repo['path']}" if repo['path'] ## note: do NOT forget to add optional extra path!!!
|
148
|
-
|
149
|
-
outpath = "#{root_dir}/#{repo_path}/#{season.to_path}/#{basename}.txt"
|
150
|
-
|
151
|
-
if opts[:dry]
|
152
|
-
puts " (dry) writing to >#{outpath}<..."
|
153
|
-
else
|
154
|
-
write_text( outpath, buf )
|
155
|
-
end
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
sync.git_push_if_changes if opts[:push]
|
160
|
-
|
161
|
-
end # method self.main
|
162
|
-
end # module Fbgen
|