sportdb-readers 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,156 +0,0 @@
1
- # encoding: utf-8
2
-
3
- ###
4
- # to run use
5
- # ruby -I ./lib -I ./test test/test_match_reader_euro.rb
6
-
7
-
8
- require 'helper'
9
-
10
-
11
- class TestMatchReaderEuro < MiniTest::Test
12
-
13
- def setup
14
- SportDb.connect( adapter: 'sqlite3',
15
- database: ':memory:' )
16
- SportDb.create_all ## build schema
17
-
18
- ## turn on logging to console
19
- ActiveRecord::Base.logger = Logger.new(STDOUT)
20
- end
21
-
22
-
23
- def test_read
24
- txt = <<TXT
25
- = Euro 2016 # in France
26
-
27
-
28
- Group A | France Romania Albania Switzerland
29
- Group B | England Russia Wales Slovakia
30
- Group C | Germany Ukraine Poland Northern Ireland
31
- Group D | Spain Czech Republic Turkey Croatia
32
- Group E | Belgium Italy Ireland Sweden
33
- Group F | Portugal Iceland Austria Hungary
34
-
35
-
36
- #############################################
37
- # Group phase
38
-
39
- Matchday 1 | Jun/10 - Jun/14
40
- Matchday 2 | Jun/15 - Jun/18
41
- Matchday 3 | Jun/19 - Jun/22
42
-
43
-
44
- Group A:
45
-
46
- (1) Jun/10 21:00 France 2:1 Romania @ Stade de France, Saint-Denis
47
- (2) Jun/11 15:00 Albania 0:1 Switzerland @ Stade Bollaert-Delelis, Lens
48
-
49
- (14) Jun/15 18:00 Romania 1:1 Switzerland @ Parc des Princes, Paris
50
- (15) Jun/15 21:00 France 2:0 Albania @ Stade Vélodrome, Marseille
51
-
52
- (25) Jun/19 21:00 Romania 0:1 Albania @ Stade Pierre-Mauroy, Lille
53
- (26) Jun/19 21:00 Switzerland 0:0 France @ Parc Olympique Lyonnais, Lyon
54
-
55
-
56
- Group B:
57
-
58
- (3) Jun/11 18:00 Wales 2:1 Slovakia @ Nouveau Stade de Bordeaux, Bordeaux
59
- (4) Jun/11 21:00 England 1:1 Russia @ Stade Vélodrome, Marseille
60
-
61
- (13) Jun/15 15:00 Russia 1:2 Slovakia @ Stade Pierre-Mauroy, Lille
62
- (16) Jun/16 15:00 England 2:1 Wales @ Stade Bollaert-Delelis, Lens
63
-
64
- (27) Jun/20 21:00 Russia 0:3 Wales @ Stadium Municipal, Toulouse
65
- (28) Jun/20 21:00 Slovakia 0:0 England @ Stade Geoffroy-Guichard, Saint-Étienne
66
-
67
-
68
- Group C:
69
-
70
- (6) Jun/12 18:00 Poland 1:0 Northern Ireland @ Allianz Riviera, Nice
71
- (7) Jun/12 21:00 Germany 2:0 Ukraine @ Stade Pierre-Mauroy, Lille
72
-
73
- (17) Jun/16 18:00 Ukraine 0:2 Northern Ireland @ Parc Olympique Lyonnais, Lyon
74
- (18) Jun/16 21:00 Germany 0:0 Poland @ Stade de France, Saint-Denis
75
-
76
- (29) Jun/21 18:00 Northern Ireland 0:1 Germany @ Parc des Princes, Paris
77
- (30) Jun/21 18:00 Ukraine 0:1 Poland @ Stade Vélodrome, Marseille
78
-
79
-
80
- Group D:
81
-
82
- (5) Jun/12 15:00 Turkey 0:1 Croatia @ Parc des Princes, Paris
83
- (8) Jun/13 15:00 Spain 1:0 Czech Republic @ Stadium Municipal, Toulouse
84
-
85
- (20) Jun/17 18:00 Czech Republic 2:2 Croatia @ Stade Geoffroy-Guichard, Saint-Étienne
86
- (21) Jun/17 21:00 Spain 3:0 Turkey @ Allianz Riviera, Nice
87
-
88
- (31) Jun/21 21:00 Croatia 2:1 Spain @ Nouveau Stade de Bordeaux, Bordeaux
89
- (32) Jun/21 21:00 Czech Republic 0:2 Turkey @ Stade Bollaert-Delelis, Lens
90
-
91
-
92
- Group E:
93
-
94
- (10) Jun/13 21:00 Belgium 0:2 Italy @ Parc Olympique Lyonnais, Lyon
95
- (9) Jun/13 18:00 Ireland 1:1 Sweden @ Stade de France, Saint-Denis
96
-
97
- (19) Jun/17 15:00 Italy 1:0 Sweden @ Stadium Municipal, Toulouse
98
- (22) Jun/18 15:00 Belgium 3:0 Ireland @ Nouveau Stade de Bordeaux, Bordeaux
99
-
100
- (35) Jun/21 21:00 Italy 0:1 Ireland @ Stade Pierre-Mauroy, Lille
101
- (36) Jun/21 21:00 Sweden 0:1 Belgium @ Allianz Riviera, Nice
102
-
103
-
104
- Group F:
105
-
106
- (11) Jun/14 18:00 Austria 0:2 Hungary @ Nouveau Stade de Bordeaux, Bordeaux
107
- (12) Jun/14 21:00 Portugal 1:1 Iceland @ Stade Geoffroy-Guichard, Saint-Étienne
108
-
109
- (23) Jun/18 18:00 Iceland 1:1 Hungary @ Stade Vélodrome, Marseille
110
- (24) Jun/18 21:00 Portugal 0:0 Austria @ Parc des Princes, Paris
111
-
112
- (33) Jun/22 18:00 Hungary 3:3 Portugal @ Parc Olympique Lyonnais, Lyon
113
- (34) Jun/21 18:00 Iceland 2:1 Austria @ Stade de France, Saint-Denis
114
-
115
-
116
- #############################
117
- # Knockout phase
118
-
119
- Round of 16
120
-
121
- (37) Jun/25 15:00 Switzerland 1:1 0:0nV 4:5iE Poland @ Stade Geoffroy-Guichard, Saint-Étienne
122
- (38) Jun/25 18:00 Wales 1:0 Northern Ireland @ Parc des Princes, Paris
123
- (39) Jun/25 21:00 Croatia 0:0 0:1nV Portugal @ Stade Bollaert-Delelis, Lens
124
-
125
- (40) Jun/26 15:00 France 2:1 Ireland @ Parc Olympique Lyonnais, Lyon
126
- (41) Jun/26 18:00 Germany 3:0 Slovakia @ Stade Pierre-Mauroy, Lille
127
- (42) Jun/26 21:00 Hungary 0:4 Belgium @ Stadium Municipal, Toulouse
128
-
129
- (43) Jun/27 18:00 Italy 2:0 Spain @ Stade de France, Saint-Denis
130
- (44) Jun/27 21:00 England 1:2 Iceland @ Allianz Riviera, Nice
131
-
132
-
133
- Quarter-finals
134
-
135
- (45) Jun/30 21:00 Poland 1:1 0:0nV 3:5iE Portugal @ Stade Vélodrome, Marseille
136
- (46) Jul/01 21:00 Wales 3:1 Belgium @ Stade Pierre-Mauroy, Lille
137
- (47) Jul/02 21:00 Germany 1:1 0:0nV 6:5iE Italy @ Nouveau Stade de Bordeaux, Bordeaux
138
- (48) Jul/03 21:00 France 5:2 Iceland @ Stade de France, Saint-Denis
139
-
140
-
141
- Semi-finals
142
-
143
- (49) Jul/06 21:00 Portugal 2:0 Wales @ Parc Olympique Lyonnais, Lyon
144
- (50) Jul/07 21:00 Germany 0:2 France @ Stade Vélodrome, Marseille
145
-
146
-
147
- Final
148
-
149
- (51) Jul/10 21:00 Portugal 0:0 1:0nV France @ Stade de France, Saint-Denis
150
- TXT
151
-
152
- SportDb::MatchReader.parse( txt )
153
- end
154
- end # class TestMatchReaderEuro
155
-
156
-
@@ -1,97 +0,0 @@
1
- # encoding: utf-8
2
-
3
- ###
4
- # to run use
5
- # ruby -I ./lib -I ./test test/test_match_reader_mu.rb
6
-
7
-
8
- require 'helper'
9
-
10
-
11
- class TestMatchReaderMu < MiniTest::Test
12
-
13
- def setup
14
- SportDb.connect( adapter: 'sqlite3',
15
- database: ':memory:' )
16
- SportDb.create_all ## build schema
17
-
18
- ## turn on logging to console
19
- ActiveRecord::Base.logger = Logger.new(STDOUT)
20
- end
21
-
22
-
23
- def test_read_mauritius
24
- leagues_txt =<<TXT
25
- = Mauritius =
26
-
27
- 1 Mauritius Premier League
28
- cup Mauritius Cup
29
- TXT
30
-
31
-
32
- clubs_txt =<<TXT
33
- = Mauritius =
34
-
35
- Cercle de Joachim | Cercle de Joachim SC | Joachim
36
- Chamarel SC | Chamarel | Chamarel Sport Club
37
- Curepipe Starlight | Curepipe Starlight SC
38
- Entente Boulet Rouge | Entente Boulet Rouge SC | Entente Boulet Rouge-Riche Mare Rovers
39
- La Cure Sylvester | La Cure Sylvester SC | La Cure
40
- Pamplemousses | Pamplemousses SC
41
- Petite Rivière Noire | Petite Rivière Noire SC | Petite Rivière
42
- AS Port-Louis 2000 | ASPL 2000 | Port-Louis 2000 |Association Sportive Port-Louis 2000
43
- AS Quatre Bornes | ASQB | Quatre Bornes
44
- Rivière du Rempart | AS Rivière du Rempart
45
- Pointe-aux-Sables Mates
46
- Savanne SC | Savanne Sporting Club
47
- TXT
48
-
49
- recs = SportDb::Import::LeagueReader.parse( leagues_txt )
50
- SportDb::Import.catalog.leagues.add( recs )
51
-
52
- recs = SportDb::Import::ClubReader.parse( clubs_txt )
53
- SportDb::Import.catalog.clubs.add( recs )
54
-
55
- pp recs
56
-
57
- country = SportDb::Import.catalog.countries.find( 'Mauritius' )
58
- pp country
59
-
60
- clubs = SportDb::Import.catalog.clubs.match( 'Chamarel SC' )
61
- pp clubs
62
- club = SportDb::Import.catalog.clubs.find_by( name: 'Chamarel SC',
63
- country: country )
64
- pp club
65
-
66
- txt =<<TXT
67
- = Mauritius Premier League 2014/15 =
68
-
69
- Matchday 1
70
- [Wed Nov/5]
71
- Curepipe Starlight 1-3 Petite Rivière Noire
72
- AS Quatre Bornes 1-0 La Cure Sylvester
73
- Pamplemousses 0-1 Rivière du Rempart
74
- AS Port-Louis 2000 5-1 Entente Boulet Rouge
75
- Chamarel SC 2-3 Cercle de Joachim
76
-
77
- Matchday 2
78
- [Sun Nov/9]
79
- Curepipe Starlight 2-1 AS Quatre Bornes
80
- Entente Boulet Rouge 1-2 Chamarel SC
81
- Rivière du Rempart 1-1 AS Port-Louis 2000
82
- La Cure Sylvester 1-2 Pamplemousses
83
- Petite Rivière Noire 2-0 Cercle de Joachim
84
-
85
- Matchday 3
86
- [Wed Nov/12]
87
- AS Quatre Bornes 1-2 Petite Rivière Noire
88
- Pamplemousses 0-4 Curepipe Starlight
89
- Chamarel SC 1-1 Rivière du Rempart
90
- Cercle de Joachim 2-2 Entente Boulet Rouge
91
- AS Port-Louis 2000 1-0 La Cure Sylvester
92
- TXT
93
-
94
- SportDb::MatchReader.parse( txt )
95
- end # method test_read_mauritius
96
-
97
- end # class TestMatchReaderMu
data/test/test_read.rb DELETED
@@ -1,35 +0,0 @@
1
- # encoding: utf-8
2
-
3
- ###
4
- # to run use
5
- # ruby -I ./lib -I ./test test/test_read.rb
6
-
7
-
8
- require 'helper'
9
-
10
-
11
- class TestRead < MiniTest::Test
12
-
13
- def test_read
14
-
15
- SportDb.connect( adapter: 'sqlite3', database: ':memory:' )
16
- SportDb.create_all ## build schema
17
-
18
- ## turn on logging to console
19
- ActiveRecord::Base.logger = Logger.new(STDOUT)
20
-
21
-
22
- path = "../../../openfootball/england/2015-16/.conf.txt"
23
- # path = "../../../openfootball/england/2017-18/.conf.txt"
24
- # path = "../../../openfootball/england/2018-19/.conf.txt"
25
- # path = "../../../openfootball/england/2019-20/.conf.txt"
26
- SportDb.read( path )
27
- path = "../../../openfootball/england/2015-16/1-premierleague-i.txt"
28
- # path = "../../../openfootball/england/2017-18/1-premierleague-i.txt"
29
- # path = "../../../openfootball/england/2018-19/1-premierleague.txt"
30
- # path = "../../../openfootball/england/2019-20/1-premierleague.txt"
31
- SportDb.read( path )
32
- # path = "../../../openfootball/england/2017-18/1-premierleague-ii.txt"
33
- # SportDb.read( path )
34
- end # method test_read
35
- end # class TestReader
data/test/test_reader.rb DELETED
@@ -1,37 +0,0 @@
1
- # encoding: utf-8
2
-
3
- ###
4
- # to run use
5
- # ruby -I ./lib -I ./test test/test_reader.rb
6
-
7
-
8
- require 'helper'
9
-
10
-
11
- class TestReader < MiniTest::Test
12
-
13
- def setup
14
- SportDb.connect( adapter: 'sqlite3', database: ':memory:' )
15
- SportDb.create_all ## build schema
16
-
17
- ## turn on logging to console
18
- ActiveRecord::Base.logger = Logger.new(STDOUT)
19
- end
20
-
21
- def test_read
22
- # path = "../../../openfootball/austria/2018-19/.conf.txt"
23
- path = "../../../openfootball/england/2015-16/.conf.txt"
24
- # path = "../../../openfootball/england/2017-18/.conf.txt"
25
- # path = "../../../openfootball/england/2018-19/.conf.txt"
26
- # path = "../../../openfootball/england/2019-20/.conf.txt"
27
- recs = SportDb::ConfReader.read( path )
28
- # path = "../../../openfootball/austria/2018-19/1-bundesliga.txt"
29
- path = "../../../openfootball/england/2015-16/1-premierleague-i.txt"
30
- # path = "../../../openfootball/england/2017-18/1-premierleague-i.txt"
31
- # path = "../../../openfootball/england/2018-19/1-premierleague.txt"
32
- # path = "../../../openfootball/england/2019-20/1-premierleague.txt"
33
- recs = SportDb::MatchReader.read( path )
34
- # path = "../../../openfootball/england/2017-18/1-premierleague-ii.txt"
35
- #recs = SportDb::MatchReaderV2.read( path )
36
- end # method test_read
37
- end # class TestReader
@@ -1,187 +0,0 @@
1
- # encoding: utf-8
2
-
3
- ###
4
- # to run use
5
- # ruby -I ./lib -I ./test test/test_reader_champs.rb
6
-
7
-
8
- require 'helper'
9
-
10
-
11
- class TestReaderChamps < MiniTest::Test
12
-
13
- def setup
14
- SportDb.connect( adapter: 'sqlite3',
15
- database: ':memory:' )
16
- SportDb.create_all ## build schema
17
-
18
- ## turn on logging to console
19
- ActiveRecord::Base.logger = Logger.new(STDOUT)
20
- end
21
-
22
-
23
- def test_read
24
- txt =<<TXT
25
- = UEFA Champions League 2017/18
26
-
27
- Manchester United › ENG
28
- Liverpool › ENG
29
- Chelsea › ENG
30
- Manchester City › ENG
31
- Tottenham Hotspur › ENG
32
-
33
- Atlético Madrid › ESP
34
- Barcelona › ESP
35
- Sevilla › ESP
36
- Real Madrid › ESP
37
-
38
- Roma › ITA
39
- Juventus › ITA
40
- Napoli › ITA
41
-
42
- Bayern München › GER
43
- Borussia Dortmund › GER
44
- RB Leipzig › GER
45
-
46
- Benfica › POR
47
- Sporting CP › POR
48
- Porto › POR
49
-
50
- CSKA Moscow › RUS
51
- Spartak Moscow › RUS
52
-
53
- Paris Saint-Germain › FRA
54
- Basel › SUI
55
- Celtic › SCO
56
- Anderlecht › BEL
57
- Qarabağ › AZE
58
- Olympiacos › GRE
59
- Maribor › SVN
60
- Shakhtar Donetsk › UKR
61
- Feyenoord › NED
62
- Beşiktaş › TUR
63
- Monaco › MCO
64
- APOEL › CYP
65
- TXT
66
-
67
- SportDb::ConfReader.parse( txt )
68
-
69
-
70
- txt =<<TXT
71
- = UEFA Champions League 2017/18
72
-
73
- Round of 16 - 1st Leg
74
-
75
- [Tue Feb/13]
76
- 20.45 Juventus 2-2 Tottenham Hotspur @ Juventus Stadium, Turin
77
- [Higuaín 2', 9' (pen.); Kane 35' Eriksen 71']
78
- 20.45 Basel 0-4 Manchester City @ St. Jakob-Park, Basel
79
- [-; Gündoğan 14', 53' B. Silva 18' Agüero 23']
80
-
81
- [Wed Feb/14]
82
- 20.45 Porto 0-5 Liverpool @ Estádio do Dragão, Porto
83
- [-; Mané 25', 53', 85' Salah 29' Firmino 69']
84
- 20.45 Real Madrid 3-1 Paris Saint-Germain @ Santiago Bernabéu, Madrid
85
- [Ronaldo 45' (pen.), 83' Marcelo 86'; Rabiot 33']
86
-
87
- [Tue Feb/20]
88
- 20.45 Bayern München 5-0 Beşiktaş @ Allianz Arena, München
89
- [Müller 43', 66' Coman 53' Lewandowski 79', 88']
90
- 20.45 Chelsea 1-1 Barcelona @ Stamford Bridge, London
91
- [Willian 62'; Messi 75']
92
-
93
- [Wed Feb/21]
94
- 20.45 Shakhtar Donetsk 2-1 Roma @ Metalist Stadium, Kharkiv [†]
95
- [Ferreyra 52' Fred 71'; Ünder 41']
96
- 20.45 Sevilla 0-0 Manchester United @ Ramón Sánchez Pizjuán, Seville
97
-
98
-
99
- Round of 16 - 2nd Leg
100
-
101
- [Tue Mar/6]
102
- 20.45 Liverpool 0-0 Porto @ Anfield, Liverpool
103
- 20.45 Paris Saint-Germain 1-2 Real Madrid @ Parc des Princes, Paris
104
- [Cavani 71'; Ronaldo 51' Casemiro 80']
105
-
106
- [Wed Mar/7]
107
- 20.45 Manchester City 1-2 Basel @ City of Manchester Stadium, Manchester
108
- [Gabriel Jesus 8'; Elyounoussi 17' Lang 71']
109
- 20.45 Tottenham Hotspur 1-2 Juventus @ Wembley Stadium, London
110
- [Son Heung-min 39'; Higuaín 64' Dybala 67']
111
-
112
- [Tue Mar/13]
113
- 20.45 Roma 1-0 Shakhtar Donetsk @ Stadio Olimpico, Rome
114
- [Džeko 52']
115
- 20.45 Manchester United 1-2 Sevilla @ Old Trafford, Manchester
116
- [Lukaku 84'; Ben Yedder 74', 78']
117
-
118
- [Wed Mar/14]
119
- 20.45 Barcelona 3-0 Chelsea @ Camp Nou, Barcelona
120
- [Messi 3', 63' Dembélé 20']
121
- 18.00 Beşiktaş 1-3 Bayern München @ Vodafone Park, Istanbul
122
- [Vágner Love 59'; Thiago 18' Gönül 46' (o.g.) Wagner 84']
123
-
124
-
125
- Quarter-finals - 1st Leg
126
-
127
- [Tue Apr/3]
128
- 20.45 Juventus 0-3 Real Madrid @ Juventus Stadium, Turin
129
- [-; Ronaldo 3', 64' Marcelo 72']
130
- 20.45 Sevilla 1-2 Bayern München @ Ramón Sánchez Pizjuán, Seville
131
- [Sarabia 31'; Navas 37' (o.g.) Thiago 68']
132
-
133
- [Wed Apr/4]
134
- 20.45 Barcelona 4-1 Roma @ Camp Nou, Barcelona
135
- [De Rossi 38' (o.g.) Manolas 55' (o.g.) Piqué 59' L. Suárez 87'; Džeko 80']
136
- 20.45 Liverpool 3-0 Manchester City @ Anfield, Liverpool
137
- [Salah 12' Oxlade-Chamberlain 21' Mané 31']
138
-
139
-
140
- Quarter-finals - 2nd Leg
141
-
142
- [Tue Apr/10]
143
- 20.45 Roma 3-0 Barcelona @ Stadio Olimpico, Rome
144
- [Džeko 6' De Rossi 58' (pen.) Manolas 82']
145
- 20.45 Manchester City 1-2 Liverpool @ City of Manchester Stadium, Manchester
146
- [Gabriel Jesus 2'; Salah 56' Firmino 77']
147
-
148
- [Wed Apr/11]
149
- 20.45 Real Madrid 1-3 Juventus @ Santiago Bernabéu, Madrid
150
- [Ronaldo 90+8' (pen.); Mandžukić 2', 37' Matuidi 61']
151
- 20.45 Bayern München 0-0 Sevilla @ Allianz Arena, München
152
-
153
-
154
-
155
- Semi-finals - 1st Leg
156
-
157
- [Tue Apr/24]
158
- 20.45 Liverpool 5-2 Roma @ Anfield, Liverpool
159
- [Salah 36', 45+1' Mané 56' Firmino 61', 69'; Džeko 81' Perotti 85' (pen.)]
160
-
161
- [Wed Apr/25]
162
- 20.45 Bayern München 1-2 Real Madrid @ Allianz Arena, München
163
- [Kimmich 28'; Marcelo 44' Asensio 57']
164
-
165
-
166
- Semi-finals - 2nd Leg
167
-
168
- [Tue May/1]
169
- 20.45 Real Madrid 2-2 Bayern München @ Santiago Bernabéu, Madrid
170
- [Benzema 11', 46'; Kimmich 3' Rodríguez 63']
171
-
172
- [Wed May/2]
173
- 20.45 Roma 4-2 Liverpool @ Stadio Olimpico, Rome
174
- [Milner 15' (o.g.) Džeko 52' Nainggolan 86', 90+4' (pen.); Mané 9' Wijnaldum 25']
175
-
176
- Final
177
-
178
- [Sat May/26]
179
- 20.45 Real Madrid 3-1 Liverpool @ NSC Olimpiyskiy Stadium, Kiev
180
- [Benzema 51' Bale 64', 83'; Mané 55']
181
- TXT
182
-
183
- SportDb::MatchReader.parse( txt )
184
- end
185
-
186
-
187
- end # class TestReaderChamps