sportdb-writers 0.1.0 → 0.1.2
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 +8 -9
- data/Rakefile +2 -4
- data/bin/fbgen +183 -0
- data/bin/fbtxt +52 -0
- data/config/leagues_america.csv +6 -0
- data/config/leagues_europe.csv +85 -0
- data/config/leagues_world.csv +4 -0
- data/config/openfootball.csv +52 -0
- data/lib/sportdb/writers/github.rb +26 -138
- data/lib/sportdb/writers/github_config.rb +97 -0
- data/lib/sportdb/writers/league_config.rb +83 -0
- data/lib/sportdb/writers/txt_writer.rb +8 -1
- data/lib/sportdb/writers/version.rb +4 -5
- data/lib/sportdb/writers/write.rb +11 -8
- data/lib/sportdb/writers.rb +51 -21
- metadata +15 -28
- data/lib/sportdb/leagues/leagues_at.rb +0 -35
- data/lib/sportdb/leagues/leagues_de.rb +0 -21
- data/lib/sportdb/leagues/leagues_eng.rb +0 -58
- data/lib/sportdb/leagues/leagues_es.rb +0 -15
- data/lib/sportdb/leagues/leagues_europe.rb +0 -178
- data/lib/sportdb/leagues/leagues_it.rb +0 -16
- data/lib/sportdb/leagues/leagues_mx.rb +0 -23
- data/lib/sportdb/leagues/leagues_south_america.rb +0 -17
- data/lib/sportdb/leagues/leagues_world.rb +0 -14
@@ -1,178 +0,0 @@
|
|
1
|
-
module Writer
|
2
|
-
|
3
|
-
LEAGUES.merge!(
|
4
|
-
|
5
|
-
########################
|
6
|
-
# France
|
7
|
-
'fr.1' => { name: 'French Ligue 1',
|
8
|
-
basename: '1-ligue1',
|
9
|
-
},
|
10
|
-
'fr.2' => { name: 'French Ligue 2',
|
11
|
-
basename: '2-ligue2',
|
12
|
-
},
|
13
|
-
|
14
|
-
'hu.1' => { name: 'Hungarian NB I',
|
15
|
-
basename: '1-nbi',
|
16
|
-
},
|
17
|
-
'gr.1' => { name: 'Super League Greece',
|
18
|
-
basename: '1-superleague',
|
19
|
-
stages: ->(season) {
|
20
|
-
if season.start_year >= 2019 # new league system starting with 2015/16 season
|
21
|
-
[['Regular Season'],
|
22
|
-
['Playoffs - Championship',
|
23
|
-
'Playoffs - Relegation']]
|
24
|
-
elsif [2017,2018].include?( season.start_year ) ## 2017/18, 2018/19
|
25
|
-
nil
|
26
|
-
elsif [2013,2014,2015,2016].include?( season.start_year )
|
27
|
-
[['Regular Season'],
|
28
|
-
['Playoffs']]
|
29
|
-
elsif season.start_year == 2012
|
30
|
-
[['Regular Season'],
|
31
|
-
['Playoffs',
|
32
|
-
'Match 6th Place']]
|
33
|
-
elsif [2010,2011].include?( season.start_year )
|
34
|
-
[['Regular Season'],
|
35
|
-
['Playoffs']]
|
36
|
-
else
|
37
|
-
nil
|
38
|
-
end
|
39
|
-
},
|
40
|
-
},
|
41
|
-
|
42
|
-
'pt.1' => { name: 'Portuguese Primeira Liga',
|
43
|
-
basename: '1-primeiraliga',
|
44
|
-
},
|
45
|
-
'pt.2' => { name: 'Portuguese Segunda Liga',
|
46
|
-
basename: '2-segundaliga',
|
47
|
-
},
|
48
|
-
|
49
|
-
'ch.1' => { name: 'Swiss Super League',
|
50
|
-
basename: '1-superleague',
|
51
|
-
},
|
52
|
-
'ch.2' => { name: 'Swiss Challenge League',
|
53
|
-
basename: '2-challengeleague',
|
54
|
-
},
|
55
|
-
'tr.1' => { name: 'Turkish Süper Lig',
|
56
|
-
basename: '1-superlig',
|
57
|
-
},
|
58
|
-
'tr.2' => { name: 'Turkish 1. Lig',
|
59
|
-
basename: '2-lig1',
|
60
|
-
},
|
61
|
-
|
62
|
-
|
63
|
-
'is.1' => { name: 'Iceland Urvalsdeild',
|
64
|
-
basename: '1-urvalsdeild',
|
65
|
-
},
|
66
|
-
'sco.1' => { name: 'Scottish Premiership',
|
67
|
-
basename: '1-premiership',
|
68
|
-
stages: [['Regular Season'],
|
69
|
-
['Playoffs - Championship',
|
70
|
-
'Playoffs - Relegation' ]]
|
71
|
-
},
|
72
|
-
'ie.1' => { name: 'Irish Premier Division',
|
73
|
-
basename: '1-premierdivision',
|
74
|
-
},
|
75
|
-
|
76
|
-
'fi.1' => { name: 'Finland Veikkausliiga', ## note: make optional!!! override here (otherwise (re)use "regular" lookup "canonical" name from league!!!)
|
77
|
-
basename: '1-veikkausliiga',
|
78
|
-
stages: [['Regular Season'],
|
79
|
-
['Playoffs - Championship',
|
80
|
-
'Playoffs - Challenger',
|
81
|
-
'Europa League Finals' ]]
|
82
|
-
},
|
83
|
-
'se.1' => { name: 'Sweden Allsvenskan',
|
84
|
-
basename: '1-allsvenskan',
|
85
|
-
},
|
86
|
-
'se.2' => { name: 'Sweden Superettan',
|
87
|
-
basename: '2-superettan',
|
88
|
-
},
|
89
|
-
'no.1' => { name: 'Norwegian Eliteserien',
|
90
|
-
basename: '1-eliteserien',
|
91
|
-
},
|
92
|
-
'dk.1' => { name: 'Denmark Superligaen',
|
93
|
-
basename: '1-superligaen',
|
94
|
-
stages: [['Regular Season'],
|
95
|
-
['Playoffs - Championship',
|
96
|
-
'Playoffs - Relegation',
|
97
|
-
'Europa League Finals']]
|
98
|
-
},
|
99
|
-
|
100
|
-
'lu.1' => { name: 'Luxembourger First Division',
|
101
|
-
basename: '1-nationaldivision',
|
102
|
-
},
|
103
|
-
'be.1' => { name: 'Belgian First Division A',
|
104
|
-
basename: '1-firstdivisiona',
|
105
|
-
stages: [['Regular Season'],
|
106
|
-
['Playoffs - Championship',
|
107
|
-
'Playoffs - Europa League',
|
108
|
-
'Playoffs - Europa League - Finals']]
|
109
|
-
},
|
110
|
-
'nl.1' => { name: 'Dutch Eredivisie',
|
111
|
-
basename: '1-eredivisie',
|
112
|
-
},
|
113
|
-
'cz.1' => { name: 'Czech First League',
|
114
|
-
basename: '1-firstleague',
|
115
|
-
stages: [['Regular Season'],
|
116
|
-
['Playoffs - Championship',
|
117
|
-
'Europa League Play-off',
|
118
|
-
'Playoffs - Relegation'
|
119
|
-
]]
|
120
|
-
},
|
121
|
-
'sk.1' => { name: 'Slovakia First League',
|
122
|
-
basename: '1-superliga',
|
123
|
-
stages: [['Regular Season'],
|
124
|
-
['Playoffs - Championship',
|
125
|
-
'Playoffs - Relegation',
|
126
|
-
'Europa League Finals']]
|
127
|
-
},
|
128
|
-
'hr.1' => { name: 'Croatia 1. HNL',
|
129
|
-
basename: '1-hnl',
|
130
|
-
},
|
131
|
-
'pl.1' => { name: 'Poland Ekstraklasa',
|
132
|
-
basename: '1-ekstraklasa',
|
133
|
-
stages: [['Regular Season'],
|
134
|
-
['Playoffs - Championship',
|
135
|
-
'Playoffs - Relegation']]
|
136
|
-
},
|
137
|
-
|
138
|
-
'ro.1' => { name: 'Romanian Liga 1',
|
139
|
-
basename: '1-liga1',
|
140
|
-
stages: ->(season) {
|
141
|
-
if season.start_year >= 2015 # new league system starting with 2015/16 season
|
142
|
-
[['Regular Season'],
|
143
|
-
['Playoffs - Championship',
|
144
|
-
'Playoffs - Relegation']]
|
145
|
-
else
|
146
|
-
nil
|
147
|
-
end
|
148
|
-
},
|
149
|
-
},
|
150
|
-
|
151
|
-
'ua.1' => { name: 'Ukraine Premier League',
|
152
|
-
basename: '1-premierleague',
|
153
|
-
stages: [['Regular Season'],
|
154
|
-
['Playoffs - Championship',
|
155
|
-
'Playoffs - Relegation',
|
156
|
-
'Europa League Finals']]
|
157
|
-
},
|
158
|
-
|
159
|
-
|
160
|
-
'ru.1' => { name: 'Russian Premier League',
|
161
|
-
basename: '1-premierliga',
|
162
|
-
stages: ->(season) {
|
163
|
-
if season.start_year == 2011 # 2011/12 - new (transition) league system during season switch from calendar year to academic
|
164
|
-
[['Regular Season'],
|
165
|
-
['Playoffs - Championship',
|
166
|
-
'Playoffs - Relegation']]
|
167
|
-
else
|
168
|
-
nil
|
169
|
-
end
|
170
|
-
},
|
171
|
-
},
|
172
|
-
'ru.2' => { name: 'Russian 1. Division',
|
173
|
-
basename: '2-division1',
|
174
|
-
},
|
175
|
-
)
|
176
|
-
|
177
|
-
|
178
|
-
end # module Writer
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module Writer
|
2
|
-
|
3
|
-
LEAGUES.merge!(
|
4
|
-
|
5
|
-
##############################
|
6
|
-
# Mexico
|
7
|
-
#
|
8
|
-
# - Viertelfinale
|
9
|
-
# - Halbfinale
|
10
|
-
# - Finale
|
11
|
-
|
12
|
-
'mx.1' => { name: 'Liga MX',
|
13
|
-
basename: '1-ligamx', ## note: gets "overwritten" by stages (see below)
|
14
|
-
stages: [{basename: '1-apertura', names: ['Apertura']},
|
15
|
-
{basename: '1-apertura_liguilla', names: ['Apertura - Liguilla']},
|
16
|
-
{basename: '1-clausura', names: ['Clausura']},
|
17
|
-
{basename: '1-clausura_liguilla', names: ['Clausura - Liguilla']},
|
18
|
-
],
|
19
|
-
},
|
20
|
-
)
|
21
|
-
|
22
|
-
|
23
|
-
end # module Writer
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Writer
|
2
|
-
|
3
|
-
|
4
|
-
LEAGUES.merge!(
|
5
|
-
'ar.1' => { name: 'Argentina Primera Division',
|
6
|
-
basename: '1-primeradivision',
|
7
|
-
},
|
8
|
-
|
9
|
-
############################
|
10
|
-
# Brazil
|
11
|
-
'br.1' => { name: 'Brasileiro Série A', ## league name
|
12
|
-
basename: '1-seriea',
|
13
|
-
},
|
14
|
-
)
|
15
|
-
|
16
|
-
|
17
|
-
end # module Writer
|