sportdb 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/db/euro/2012.rb CHANGED
@@ -14,153 +14,12 @@ euro = Event.create!( league: League.find_by_key!('euro'),
14
14
  start_at: Time.cet( '2012-06-07 17:00' ),
15
15
  team3: false )
16
16
 
17
- pol = Team.find_by_key!( 'pol' )
18
- gre = Team.find_by_key!( 'gre' )
19
- rus = Team.find_by_key!( 'rus' )
20
- cze = Team.find_by_key!( 'cze' )
21
-
22
- ned = Team.find_by_key!( 'ned' )
23
- den = Team.find_by_key!( 'den' )
24
- ger = Team.find_by_key!( 'ger' )
25
- por = Team.find_by_key!( 'por' )
26
-
27
- esp = Team.find_by_key!( 'esp' )
28
- ita = Team.find_by_key!( 'ita' )
29
- irl = Team.find_by_key!( 'irl' )
30
- cro = Team.find_by_key!( 'cro' )
31
-
32
- ukr = Team.find_by_key!( 'ukr' )
33
- swe = Team.find_by_key!( 'swe' )
34
- fra = Team.find_by_key!( 'fra' )
35
- eng = Team.find_by_key!( 'eng' )
36
-
37
-
38
- euro.teams << pol
39
- euro.teams << gre
40
- euro.teams << rus
41
- euro.teams << cze
42
- euro.teams << ned
43
- euro.teams << den
44
- euro.teams << ger
45
- euro.teams << por
46
- euro.teams << esp
47
- euro.teams << ita
48
- euro.teams << irl
49
- euro.teams << cro
50
- euro.teams << ukr
51
- euro.teams << swe
52
- euro.teams << fra
53
- euro.teams << eng
54
-
55
-
56
-
57
- euroa = Group.create!( event: euro, pos: 1, title: 'Gruppe A' )
58
- eurob = Group.create!( event: euro, pos: 2, title: 'Gruppe B' )
59
- euroc = Group.create!( event: euro, pos: 3, title: 'Gruppe C' )
60
- eurod = Group.create!( event: euro, pos: 4, title: 'Gruppe D' )
61
-
62
- #################################
63
- # Gruppe A
64
-
65
- euroa.teams << pol
66
- euroa.teams << gre
67
- euroa.teams << rus
68
- euroa.teams << cze
69
-
70
-
71
- #################################
72
- # Gruppe B
73
-
74
- eurob.teams << ned
75
- eurob.teams << den
76
- eurob.teams << ger
77
- eurob.teams << por
78
-
79
-
80
- #################################3
81
- # Gruppe C
82
-
83
- euroc.teams << esp
84
- euroc.teams << ita
85
- euroc.teams << irl
86
- euroc.teams << cro
87
-
88
- #################################3
89
- # Gruppe D
90
-
91
- eurod.teams << ukr
92
- eurod.teams << swe
93
- eurod.teams << fra
94
- eurod.teams << eng
95
-
96
-
97
- euro_round1 = Round.create!( event: euro, pos: 1, title: 'Vorrunde 1. Spieltag', start_at: Time.cet( '2012-06-08' ), title2: '8.-11. Juni' )
98
- euro_round2 = Round.create!( event: euro, pos: 2, title: 'Vorrunde 2. Spieltag', start_at: Time.cet( '2012-06-12' ), title2: '12.-15. Juni' )
99
- euro_round3 = Round.create!( event: euro, pos: 3, title: 'Vorrunde 3. Spieltag', start_at: Time.cet( '2012-06-16' ), title2: '16.-19. Juni' )
100
-
101
-
102
-
103
- games_euro_round1 = [
104
- [ 1, pol, [1,1], gre, Time.cet('2012-06-08 18:00'), euroa ],
105
- [ 2, rus, [4,1], cze, Time.cet('2012-06-08 20:45'), euroa ],
106
- [ 3, ned, [0,1], den, Time.cet('2012-06-09 18:00'), eurob ],
107
- [ 4, ger, [1,0], por, Time.cet('2012-06-09 20:45'), eurob ],
108
- [ 5, esp, [1,1], ita, Time.cet('2012-06-10 18:00'), euroc ],
109
- [ 6, irl, [1,3], cro, Time.cet('2012-06-10 20:45'), euroc ],
110
- [ 7, fra, [1,1], eng, Time.cet('2012-06-11 18:00'), eurod ],
111
- [ 8, ukr, [2,1], swe, Time.cet('2012-06-11 20:45'), eurod ]
112
- ]
113
-
114
- games_euro_round2 = [
115
- [ 9, gre, [1,2], cze, Time.cet('2012-06-12 18:00'), euroa ],
116
- [ 10, pol, [1,1], rus, Time.cet('2012-06-12 20:45'), euroa ],
117
- [ 11, den, [2,3], por, Time.cet('2012-06-13 18:00'), eurob ],
118
- [ 12, ned, [1,2], ger, Time.cet('2012-06-13 20:45'), eurob ],
119
- [ 13, ita, [1,1], cro, Time.cet('2012-06-14 18:00'), euroc ],
120
- [ 14, esp, [4,0], irl, Time.cet('2012-06-14 20:45'), euroc ],
121
- [ 15, swe, [2,3], eng, Time.cet('2012-06-15 20:45'), eurod ],
122
- [ 16, ukr, [0,2], fra, Time.cet('2012-06-15 18:00'), eurod ]
123
- ]
124
-
125
- games_euro_round3 = [
126
- [ 17, cze, [1,0], pol, Time.cet('2012-06-16 20:45'), euroa ],
127
- [ 18, gre, [1,0], rus, Time.cet('2012-06-16 20:45'), euroa ],
128
- [ 19, por, [2,1], ned, Time.cet('2012-06-17 20:45'), eurob ],
129
- [ 20, den, [1,2], ger, Time.cet('2012-06-17 20:45'), eurob ],
130
- [ 21, cro, [0,1], esp, Time.cet('2012-06-18 20:45'), euroc ],
131
- [ 22, ita, [2,0], irl, Time.cet('2012-06-18 20:45'), euroc ],
132
- [ 23, eng, [1,0], ukr, Time.cet('2012-06-19 20:45'), eurod ],
133
- [ 24, swe, [2,0], fra, Time.cet('2012-06-19 20:45'), eurod ]
134
- ]
135
-
136
- Game.create_from_ary!( games_euro_round1, euro_round1 )
137
- Game.create_from_ary!( games_euro_round2, euro_round2 )
138
- Game.create_from_ary!( games_euro_round3, euro_round3 )
139
-
140
-
141
-
142
- euro8 = Round.create!( event: euro, pos: 4, title: 'Viertelfinale', start_at: Time.cet( '2012-06-21' ) )
143
- euro4 = Round.create!( event: euro, pos: 5, title: 'Halbfinale', start_at: Time.cet( '2012-06-27' ) )
144
- euro1 = Round.create!( event: euro, pos: 6, title: 'Finale', start_at: Time.cet( '2012-07-01' ) )
145
-
146
-
147
- games_euro8 = [
148
- [ 25, cze, [0,1], por, Time.cet('2012-06-21 20:45') ],
149
- [ 26, ger, [4,2], gre, Time.cet('2012-06-22 20:45') ],
150
- [ 27, esp, [2,0], fra, Time.cet('2012-06-23 20:45') ],
151
- [ 28, eng, [0,0,0,0,2,4], ita, Time.cet('2012-06-24 20:45') ]]
152
-
153
- games_euro4 = [
154
- [ 29, por, [0,0,0,0,2,4], esp, Time.cet('2012-06-27 20:45') ],
155
- [ 30, ger, [1,2], ita, Time.cet('2012-06-28 20:45') ]]
156
-
157
- games_euro1 = [
158
- [ 31, esp, [4,0], ita, Time.cet('2012-07-01 20:45') ]]
159
-
160
-
161
- Game.create_knockouts_from_ary!( games_euro8, euro8 )
162
- Game.create_knockouts_from_ary!( games_euro4, euro4 )
163
- Game.create_knockouts_from_ary!( games_euro1, euro1 )
17
+ euro.add_teams_from_ary!([
18
+ 'pol', 'gre', 'rus', 'cze',
19
+ 'ned', 'den', 'ger', 'por',
20
+ 'esp', 'ita', 'irl', 'cro',
21
+ 'ukr', 'swe', 'fra', 'eng'
22
+ ])
164
23
 
165
24
  ## The End
166
25
  #################
data/db/euro/2012.txt ADDED
@@ -0,0 +1,114 @@
1
+ #################################
2
+ ## Euro 2012
3
+
4
+ ############
5
+ # Groups
6
+ #
7
+
8
+ Gruppe A | POL GRE RUS CZE
9
+ Gruppe B | NED DEN GER POR
10
+ Gruppe C | ESP ITA IRL CRO
11
+ Gruppe D | UKR SWE FRA ENG
12
+
13
+
14
+
15
+ ##################
16
+ ## Gruppenphase / Group stage
17
+
18
+
19
+ #############
20
+ # Gruppe A
21
+
22
+ 1. Runde / Vorrunde / Gruppe A
23
+
24
+ (1) POL 1:1 GRE 2012-06-08 18:00
25
+ (2) RUS 4:1 CZE 2012-06-08 20:45
26
+
27
+ 2. Runde / Vorrunde / Gruppe A
28
+
29
+ (9) GRE 1:2 CZE 2012-06-12 18:00
30
+ (10) POL 1:1 RUS 2012-06-12 20:45
31
+
32
+ 3. Runde / Vorrunde / Gruppe A
33
+
34
+ (17) CZE 1:0 POL 2012-06-16 20:45
35
+ (18) GRE 1:0 RUS 2012-06-16 20:45
36
+
37
+
38
+ #############
39
+ # Gruppe B
40
+
41
+ 1. Runde / Vorrunde / Gruppe B
42
+
43
+ (3) NED 0:1 DEN 2012-06-09 18:00
44
+ (4) GER 1:0 POR 2012-06-09 20:45
45
+
46
+ 2. Runde / Vorrunde / Gruppe B
47
+
48
+ (11) DEN 2:3 POR 2012-06-13 18:00
49
+ (12) NED 1:2 GER 2012-06-13 20:45
50
+
51
+ 3. Runde / Vorrunde / Gruppe B
52
+
53
+ (19) POR 2:1 NED 2012-06-17 20:45
54
+ (20) DEN 1:2 GER 2012-06-17 20:45
55
+
56
+
57
+ #############
58
+ # Gruppe C
59
+
60
+ 1. Runde / Vorrunde / Gruppe C
61
+
62
+ (5) ESP 1:1 ITA 2012-06-10 18:00
63
+ (6) IRL 1:3 CRO 2012-06-10 20:45
64
+
65
+ 2. Runde / Vorrunde / Gruppe C
66
+
67
+ (13) ITA 1:1 CRO 2012-06-14 18:00
68
+ (14) ESP 4:0 IRL 2012-06-14 20:45
69
+
70
+ 3. Runde / Vorrunde / Gruppe C
71
+
72
+ (21) CRO 0:1 ESP 2012-06-18 20:45
73
+ (22) ITA 2:0 IRL 2012-06-18 20:45
74
+
75
+ ###############
76
+ # Gruppe D
77
+
78
+ 1. Runde / Vorrunde / Gruppe D
79
+
80
+ (7) FRA 1:1 ENG 2012-06-11 18:00
81
+ (8) UKR 2:1 SWE 2012-06-11 20:45
82
+
83
+ 2. Runde / Vorrunde / Gruppe D
84
+
85
+ (15) SWE 2:3 ENG 2012-06-15 20:45
86
+ (16) UKR 0:2 FRA 2012-06-15 18:00
87
+
88
+ 3. Runde / Vorrunde / Gruppe D
89
+
90
+ (23) ENG 1:0 UKR 2012-06-19 20:45
91
+ (24) SWE 2:0 FRA 2012-06-19 20:45
92
+
93
+
94
+
95
+ #################
96
+ # Finalrunde / Knockout phase
97
+
98
+ 4. Runde // Viertelfinale / Quarter-finals
99
+
100
+ (25) CZE 0:1 POR 2012-06-21 20:45
101
+ (26) GER 4:2 GRE 2012-06-22 20:45
102
+ (27) ESP 2:0 FRA 2012-06-23 20:45
103
+ (28) ENG 0:0 0:0nV 2:4iE ITA 2012-06-24 20:45
104
+
105
+
106
+ 5. Runde // Halbfinale / Semi-finals
107
+
108
+ (29) POR 0:0 0:0nV 2:4iE ESP 2012-06-27 20:45
109
+ (30) GER 1:2 ITA 2012-06-28 20:45
110
+
111
+
112
+ 6. Runde // Finale / Final
113
+
114
+ (31) ESP 4:0 ITA 2012-07-01 20:45
data/db/euro/teams.txt ADDED
@@ -0,0 +1,36 @@
1
+ # encoding: utf-8
2
+
3
+ pol, Polen|Poland, POL, pl
4
+ gre, Griechenland|Greece, GRE, gr
5
+ rus, Russland|Russia, RUS, ru
6
+ cze, Tschechien|Czech Republic, CZE, cz
7
+ ned, Niederlande|Netherlands, NED, nl
8
+ den, Dänemark, DEN, dk
9
+ ger, Deutschland|Germany, GER, de
10
+ por, Portugal, POR, pt
11
+ esp, Spanien|Spain, ESP, es
12
+ ita, Italien|Italy, ITA, it
13
+ irl, Irland, IRL, ie
14
+ cro, Kroatien|Croatia, CRO, hr
15
+ ukr, Ukraine, UKR, ua
16
+ swe, Schweden|Sweden, SWE, se
17
+ fra, Frankreich|France, FRA, fr
18
+ eng, England, ENG, en
19
+
20
+ ## some more teams for wm quali
21
+
22
+ fro, Färöer|Färöer Inseln, FRO, fo
23
+ kaz, Kasachstan, KAZ, kz
24
+ aut, Österreich|Austria, AUT, at
25
+ blr, Weißrussland, BLR, by
26
+ fin, Finnland, FIN, fi
27
+ geo, Georgien, GEO, ge
28
+
29
+ ## some more teams for wm 2010
30
+
31
+ sui, Schweiz|Switzerland, SUI, ch
32
+ srb, Serbien, SRB, rs
33
+ svn, Slowenien, SVN, si
34
+ svk, Slowakei, SVK, sk
35
+ tur, Türkei|Turkey, TUR, tr
36
+ rou, Rumänien|Romania, ROU, ro
data/db/mx/teams.txt ADDED
@@ -0,0 +1,20 @@
1
+ # encoding: utf-8
2
+
3
+ america, Club América|América de Mexico, city:mexico
4
+ atlante, Atlante, city:cancun
5
+ atlas, Atlas, city:guadalajara
6
+ chivas, Guadalajara Chivas, city:guadalajara
7
+ cruzazul, Cruz Azul, city:mexico
8
+ jaguares, Jaguares de Chiapas, city:tuxtla
9
+ leon, Club León, city:leon
10
+ monarcas, Monarcas Morelia|Atletico Monarcas Morelia, city:morelia
11
+ monterrey, Monterrey|CF Monterrey , city:monterrey
12
+ pachuca, Pachuca, city:pachuca
13
+ puebla, Puebla F.C. , city:puebla
14
+ queretaro, Querétaro F.C., city:queretaro
15
+ sanluis, Club San Luis, city:sanluispotosi
16
+ slaguna, Santos Laguna, city:torreon
17
+ tijuana, Club Tijuana, city:tijuana
18
+ toluca, Toluca|Deportivo Toluca, city:toluca
19
+ tigres, Tigres UANL, city:sannicolas
20
+ pumas, Pumas UNAM, city:mexico
data/db/nhl/teams.txt ADDED
@@ -0,0 +1,40 @@
1
+ # encoding: utf-8
2
+
3
+ ######################################
4
+ ## NHL Teams 2012
5
+
6
+ newjersey, New Jersey Devils, East/Atlantic, us
7
+ nyislanders, New York Islanders, East/Atlantic, us, city:newyork
8
+ nyrangers, New York Rangers, East/Atlantic, us, city:newyork
9
+ philadelphia, Philadelphia Flyers, East/Atlantic, us, city:philadelphia
10
+ pittsburgh, Pittsburgh Penguins, East/Atlantic, us, city:pittsburgh
11
+
12
+ boston, Boston Bruis, East/Northeast, us, city:boston
13
+ buffalo, Buffalo Sabres, East/Northeast, us, city:buffalo
14
+ montreal, Montreal Canadiens, East/Northeast, ca, city:montreal
15
+ ottawa, Ottawa Senators, East/Northeast, ca, city:ottawa
16
+ toronto, Toronto Maple Leafs, East/Northeast, ca, city:toronto
17
+
18
+ carolina, Carolina Hurricanes, East/Southeast, us
19
+ florida, Florida Panthers, East/Southeast, us
20
+ tampabay, Tampa Bay Lightning, East/Southeast, us
21
+ washington, Washington Capitals, East/Southeast, us, city:washington
22
+ winnipeg, Winnipeg Jets, East/Southeast, ca, city:winnipeg
23
+
24
+ chicago, Chicago Blackhawks, West/Central, us, city:chicago
25
+ columbus, Columbus Blue Jackets, West/Central, us, city:columbus
26
+ detroit, Detroit Red Wings, West/Central, us, city:detroit
27
+ nashville, Nashville Predators, West/Central, us, city:nashville
28
+ stlouis, St. Louis Blues, West/Central, us, city:stlouis
29
+
30
+ calgary, Calgary Flames, West/Northwest, ca, city:calgary
31
+ colorado, Colorado Avalanche, West/Northwest, us
32
+ edmonton, Edmonton Oilers, West/Northwest, ca, city:edmonton
33
+ minnesota, Minnesota Wild, West/Northwest, us
34
+ vancouver, Vancouver Canucks, West/Northwest, ca, city:vancouver
35
+
36
+ anaheim, Anaheim Ducks, West/Pacific, us, city:anaheim
37
+ dallas, Dallas Stars, West/Pacific, us, city:dallas
38
+ losangeles, Los Angeles Kings, West/Pacific, us, city:losangeles
39
+ phoenix, Phoenix Coyotes, West/Pacific, us, city:phoenix
40
+ sanjose, San Jose Sharks, West/Pacific, us, city:sanjose
data/db/ro/teams.txt ADDED
@@ -0,0 +1,26 @@
1
+ # encoding: utf-8
2
+
3
+ ## fix: remove _ underscore from key (not supported)
4
+
5
+
6
+ astra, Astra Ploiesti, AFC
7
+ ceahlau, Ceahlaul Piatra Neamt, FCC
8
+ cfr, CFR Cluj, CFR
9
+ chiajna, Concordia Chiajna, CCH
10
+ iasi, CSMS Iasi, CSI
11
+ dinamo, Dinamo Bucuresti, FCD
12
+ fcbrasov, FC Brasov, FCB
13
+ gazmetan_severin, FC Severin, FCS
14
+ vaslui, FC Vaslui, FCV
15
+ gazmetan_medias, Gaz Metan Medias, GMM
16
+ gloria_bistrita, Gloria Bistrita, GBS
17
+ otelul, Otelul Galati, OTG
18
+ pandurii, Pandurii Tg Jiu, PTJ
19
+ petrolul, Petrolul Ploiesti, PPL
20
+
21
+ ## fix: at/rapid!!!! already taken
22
+
23
+ rapid, Rapid Bucuresti, RBU
24
+ steaua, Steaua Bucuresti, SBU
25
+ u_cluj, U Cluj, UCJ
26
+ viitorul_constanta, Viitorul Constanta, VCT
data/db/world/2010.txt CHANGED
@@ -2,11 +2,6 @@
2
2
  ## World Cup 2010
3
3
 
4
4
 
5
- ####
6
- ## todo: check why we get with umlauts:
7
- # sportdb/reader.rb:261:in `=~': incompatible encoding regexp match (UTF-8 regexp with
8
- # CP850 string) (Encoding::CompatibilityError)
9
-
10
5
  ######
11
6
  # Groups
12
7
 
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+
3
+ ########################
4
+ ## africa
5
+
6
+ alg, Algerien, ALG, dz
7
+ civ, Elfenbeinküste, CIV, ci
8
+ gha, Ghana, GHA, gh
9
+ cmr, Kamerun, CMR, cm
10
+ nga, Nigeria, NGA, ng
11
+ rsa, Südafrika, RSA, za
12
+
13
+
14
+ #############################
15
+ ## asia w/ australia
16
+
17
+ aus, Australien, AUS, au
18
+ jpn, Japan, JPN, jp
19
+ prk, Nordkorea, PRK, kp
20
+ kor, Südkorea, KOR, kr
21
+
22
+ ###############################
23
+ ## oceania
24
+
25
+ nzl, Neuseeland, NZL, nz
data/lib/sportdb.rb CHANGED
@@ -73,66 +73,77 @@ module SportDB
73
73
  # e.g. lets you use Team instead of Models::Team
74
74
  include SportDB::Models
75
75
 
76
+
76
77
  def self.fixtures_rb_test
77
78
  ['leagues',
78
79
  'seasons',
79
- 'at/teams',
80
- 'at/2011_12/bl',
80
+ # 'at/2011_12/bl',
81
81
  # 'at/2011_12/cup',
82
82
  # 'at/2012_13/bl',
83
83
  # 'at/2012_13/cup',
84
- # 'copa/teams',
85
84
  # 'copa/sud_2012_13',
86
- 'america/teams',
87
- 'world/teams',
88
- 'world/quali_2012_13_america'
85
+ # 'world/quali_2012_13_america'
89
86
  ]
90
87
  end
91
88
 
92
89
  def self.fixtures_txt_test
93
90
  [
94
- [ AT_2011_12, 'at/2011_12/bl'],
91
+ # [ AT_2011_12, 'at/2011_12/bl'],
95
92
  # [ AT_2012_13, 'at/2012_13/bl'],
96
93
  # [ AT_CUP_2012_13, 'at/2012_13/cup'],
97
94
  # ['copa.sud.2012/13', 'copa/sud_2012_13'],
98
- [ WORLD_QUALI_AMERICA_2012_13, 'world/quali_2012_13_america']
95
+ # [ WORLD_QUALI_AMERICA_2012_13, 'world/quali_2012_13_america']
99
96
  ]
100
97
  end
101
98
 
102
99
 
100
+ def self.team_fixtures
101
+ at = Country.find_by_key!( 'at' )
102
+ de = Country.find_by_key!( 'de' )
103
+ en = Country.find_by_key!( 'en' )
104
+ es = Country.find_by_key!( 'es' )
105
+ ro = Country.find_by_key!( 'ro' )
106
+ mx = Country.find_by_key!( 'mx' )
107
+
108
+ [
109
+ [ 'america/teams', { national: true } ],
110
+ [ 'euro/teams', { national: true } ],
111
+ [ 'world/teams', { national: true } ],
112
+ [ 'at/teams', { club: true, country_id: at.id } ],
113
+ [ 'de/teams', { club: true, country_id: de.id } ],
114
+ [ 'en/teams', { club: true, country_id: en.id } ],
115
+ [ 'es/teams', { club: true, country_id: es.id } ],
116
+ # [ 'ro/teams', { club: true, country_id: ro.id } ],
117
+ [ 'mx/teams', { club: true, country_id: mx.id } ],
118
+ [ 'cl/teams', { club: true } ],
119
+ [ 'copa/teams', { club: true } ],
120
+ [ 'nhl/teams', { club: true } ]
121
+ ]
122
+ end
123
+
103
124
  def self.fixtures_rb # all builtin ruby fixtures; helper for covenience
104
125
  ['leagues',
105
126
  'seasons',
106
- 'at/teams',
107
127
  'at/badges',
108
128
  'at/2011_12/bl',
109
129
  'at/2011_12/cup',
110
130
  'at/2012_13/bl',
111
131
  'at/2012_13/cup',
112
- 'de/teams',
113
- 'en/teams',
114
- 'es/teams',
115
- 'cl/teams',
116
132
  'cl/badges',
117
133
  'cl/2011_12/cl',
118
134
  'cl/2011_12/el',
119
135
  'cl/2012_13/cl',
120
136
  'de/2012_13/bl',
121
137
  'en/2012_13/pl',
122
- 'euro/teams',
123
138
  'euro/2008',
124
139
  'euro/2012',
125
- 'america/teams',
126
140
  'america/2011',
127
- 'copa/teams',
128
141
  'copa/sud_2012_13',
129
- 'mx/teams',
130
142
  'mx/apertura_2012',
131
- 'world/teams',
132
143
  'world/2010',
133
144
  'world/quali_2012_13_europe',
134
- 'world/quali_2012_13_america',
135
- 'nhl/teams']
145
+ 'world/quali_2012_13_america'
146
+ ]
136
147
  end
137
148
 
138
149
  def self.fixtures_txt
@@ -151,6 +162,10 @@ module SportDB
151
162
  end
152
163
  end # class Fixtures
153
164
 
165
+ def self.team_fixtures
166
+ Fixtures.team_fixtures
167
+ end
168
+
154
169
  def self.fixtures_rb # all builtin ruby fixtures; helper for covenience
155
170
  Fixtures.fixtures_rb
156
171
  end
@@ -160,11 +175,15 @@ module SportDB
160
175
  end
161
176
 
162
177
  def self.load_all
178
+ ## load teams first
179
+ read( team_fixtures ) # converted to plain text fixtures (.rb no longer exist)
180
+
163
181
  load( fixtures_rb )
164
182
  end
165
183
 
166
184
 
167
185
  def self.read_all
186
+ ## todo/fix: remove!! roll into load_all
168
187
  read( fixtures_txt )
169
188
  end
170
189
 
@@ -184,7 +203,12 @@ module SportDB
184
203
  def self.read( ary )
185
204
  reader = Reader.new
186
205
  ary.each do |rec|
187
- reader.load_fixtures_builtin( rec[0], rec[1] ) # event_key, name
206
+ ## todo: check for teams in name too?
207
+ if rec[1].nil? || rec[1].kind_of?( Hash ) ## assume team fixtures
208
+ reader.load_teams_builtin( rec[0], rec[1] ) ## NB: name goes first than opt more_values hash
209
+ else
210
+ reader.load_fixtures_builtin( rec[0], rec[1] ) # event_key, name -- assume game fixtures
211
+ end
188
212
  end
189
213
  end
190
214