sportdb 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,11 @@
1
+ ### 0.3.0 / 2012-10-07
2
+
3
+ * Add --delete option to delete all records
4
+
5
+ ### 0.2.0 / 2012-10-06
6
+
7
+ * Add --load option for builtin fixtures
8
+
1
9
  ### 0.1.0 / 2012-10-06
2
10
 
3
11
  * Everything is new. First release
@@ -3,12 +3,19 @@ Manifest.txt
3
3
  README.markdown
4
4
  Rakefile
5
5
  bin/sportdb
6
+ db/at/2011_12/bl.rb
7
+ db/at/2011_12/cup.rb
8
+ db/at/2012_13/bl.rb
9
+ db/at/2012_13/cup.rb
10
+ db/at/teams.rb
6
11
  db/cl/2011_12/cl.rb
7
12
  db/cl/2011_12/el.rb
8
13
  db/cl/2012_13/cl.rb
9
14
  db/cl/teams.rb
10
15
  db/euro/2012.rb
11
16
  db/euro/teams.rb
17
+ db/mx/apertura_2012.rb
18
+ db/mx/teams.rb
12
19
  db/world/quali_2012_13.rb
13
20
  lib/sportdb.rb
14
21
  lib/sportdb/cli/opts.rb
@@ -0,0 +1,123 @@
1
+ # encoding: utf-8
2
+
3
+ # note: timezone for games (play_at) is *always* CET (central european time)
4
+
5
+
6
+ ######################################
7
+ ## Oesterreichische Bundesliga 2011/12
8
+ ##
9
+ ## more info => http://bundesliga.at
10
+
11
+ bl = Event.create!( :key => 'at_bl_2011_12',
12
+ :title => 'Österr. Bundesliga 2011/12',
13
+ :start_at => Time.cet('2012-04-07 00:00') )
14
+
15
+ salzburg = Team.find_by_key!( 'salzburg' )
16
+ rapid = Team.find_by_key!( 'rapid' )
17
+ admira = Team.find_by_key!( 'admira' )
18
+ austria = Team.find_by_key!( 'austria' )
19
+ sturm = Team.find_by_key!( 'sturm' )
20
+ ried = Team.find_by_key!( 'ried' )
21
+ wacker = Team.find_by_key!( 'wacker' )
22
+ mattersburg = Team.find_by_key!( 'mattersburg' )
23
+ neustadt = Team.find_by_key!( 'neustadt' )
24
+ ksv = Team.find_by_key!( 'ksv' )
25
+
26
+ bl.teams << salzburg
27
+ bl.teams << rapid
28
+ bl.teams << admira
29
+ bl.teams << austria
30
+ bl.teams << sturm
31
+ bl.teams << ried
32
+ bl.teams << wacker
33
+ bl.teams << mattersburg
34
+ bl.teams << neustadt
35
+ bl.teams << ksv
36
+
37
+
38
+ bl29 = Round.create!( :event => bl, :pos => 29, :title => '29. Runde', :title2 => '7.+8. April 2012' )
39
+ bl30 = Round.create!( :event => bl, :pos => 30, :title => '30. Runde', :title2 => '14.+15. April 2012' )
40
+ bl31 = Round.create!( :event => bl, :pos => 31, :title => '31. Runde', :title2 => '21.+22. April 2012' )
41
+ bl32 = Round.create!( :event => bl, :pos => 32, :title => '32. Runde', :title2 => '28.+29. April 2012' )
42
+ bl33 = Round.create!( :event => bl, :pos => 33, :title => '33. Runde', :title2 => '5. Mai 2012' )
43
+ bl34 = Round.create!( :event => bl, :pos => 34, :title => '34. Runde', :title2 => '10. Mai 2012' )
44
+ bl35 = Round.create!( :event => bl, :pos => 35, :title => '35. Runde', :title2 => '13. Mai 2012' )
45
+ bl36 = Round.create!( :event => bl, :pos => 36, :title => '36. Runde', :title2 => '17. Mai 2012' )
46
+
47
+
48
+ games_bl29 = [
49
+ [ 1, salzburg, [2, 0], wacker, Time.cet('2012-04-07 16:00') ],
50
+ [ 2, ried, [0, 1], austria, Time.cet('2012-04-07 18:30') ],
51
+ [ 3, ksv, [2, 3], admira, Time.cet('2012-04-07 18:30') ],
52
+ [ 4, rapid, [2, 1], neustadt, Time.cet('2012-04-07 18:30') ],
53
+ [ 5, mattersburg, [0, 2], sturm, Time.cet('2012-04-08 16:00') ]
54
+ ]
55
+
56
+ games_bl30 = [
57
+ [ 1, neustadt, [0, 0], ksv, Time.cet('2012-04-14 16:00') ],
58
+ [ 2, admira, [1, 1], wacker, Time.cet('2012-04-14 18:30') ],
59
+ [ 3, sturm, [2, 2], salzburg, Time.cet('2012-04-14 18:30') ],
60
+ [ 4, ried, [2, 0], mattersburg, Time.cet('2012-04-14 18:30') ],
61
+ [ 5, austria, [0, 0], rapid, Time.cet('2012-04-15 16:00') ]
62
+ ]
63
+
64
+ games_bl31 = [
65
+ [ 1, wacker, [2, 0], neustadt, Time.cet('2012-04-21 16:00') ],
66
+ [ 2, ksv, [1, 0], austria, Time.cet('2012-04-21 18:30') ],
67
+ [ 3, mattersburg, [1, 2], admira, Time.cet('2012-04-21 18:30') ],
68
+ [ 4, salzburg, [2, 0], ried, Time.cet('2012-04-21 18:30') ],
69
+ [ 5, rapid, [1, 1], sturm, Time.cet('2012-04-22 16:00') ]
70
+ ]
71
+
72
+ games_bl32 = [
73
+ [ 1, austria, [3, 0], wacker, Time.cet('2012-04-28 16:00') ],
74
+ [ 2, neustadt, [1, 4], admira, Time.cet('2012-04-28 18:30') ],
75
+ [ 3, mattersburg, [0, 1], salzburg, Time.cet('2012-04-28 18:30') ],
76
+ [ 4, sturm, [2, 1], ksv, Time.cet('2012-04-28 18:30') ],
77
+ [ 5, ried, [2, 3], rapid, Time.cet('2012-04-29 16:00') ]
78
+ ]
79
+
80
+ games_bl33 = [
81
+ [ 1, neustadt, [0, 0], sturm, Time.cet('2012-05-05 16:00') ],
82
+ [ 2, admira, [3, 2], austria, Time.cet('2012-05-05 18:30') ],
83
+ [ 3, ksv, [0, 0], ried, Time.cet('2012-05-05 18:30') ],
84
+ [ 4, wacker, [3, 6], mattersburg, Time.cet('2012-05-05 18:30') ],
85
+ [ 5, rapid, [0, 1], salzburg, Time.cet('2012-05-06 16:00') ]
86
+ ]
87
+
88
+ games_bl34 = [
89
+ [ 1, salzburg, [2, 0], ksv, Time.cet('2012-05-10 18:30') ],
90
+ [ 2, austria, [3, 1], neustadt, Time.cet('2012-05-10 20:30') ],
91
+ [ 3, ried, [1, 1], wacker, Time.cet('2012-05-10 20:30') ],
92
+ [ 4, mattersburg, [0, 1], rapid, Time.cet('2012-05-10 20:30') ],
93
+ [ 5, sturm, [0, 3], admira, Time.cet('2012-05-10 20:30') ]
94
+ ]
95
+
96
+ games_bl35 = [
97
+ [ 1, ksv, [0,2], rapid, Time.cet('2012-05-13 16:00') ],
98
+ [ 2, wacker, [1,1], sturm, Time.cet('2012-05-13 16:00') ],
99
+ [ 3, neustadt, [1,5], salzburg, Time.cet('2012-05-13 16:00') ],
100
+ [ 4, admira, [1,1], ried, Time.cet('2012-05-13 16:00') ],
101
+ [ 5, austria, [1,0], mattersburg, Time.cet('2012-05-13 16:00') ]
102
+ ]
103
+
104
+ games_bl36 = [
105
+ [ 1, rapid, [2,0], wacker, Time.cet('2012-05-17 16:00') ],
106
+ [ 2, ried, [2,2], neustadt, Time.cet('2012-05-17 16:00') ],
107
+ [ 3, mattersburg, [2,0], ksv, Time.cet('2012-05-17 16:00') ],
108
+ [ 4, sturm, [3,1], austria, Time.cet('2012-05-17 16:00') ],
109
+ [ 5, salzburg, [2,0], admira, Time.cet('2012-05-17 16:00') ]
110
+ ]
111
+
112
+ Game.create_from_ary!( games_bl29, bl29 )
113
+ Game.create_from_ary!( games_bl30, bl30 )
114
+ Game.create_from_ary!( games_bl31, bl31 )
115
+ Game.create_from_ary!( games_bl32, bl32 )
116
+ Game.create_from_ary!( games_bl33, bl33 )
117
+ Game.create_from_ary!( games_bl34, bl34 )
118
+ Game.create_from_ary!( games_bl35, bl35 )
119
+ Game.create_from_ary!( games_bl36, bl36 )
120
+
121
+
122
+ Prop.create!( :key => 'db.at.bl.2011/12.version', :value => '1' )
123
+
@@ -0,0 +1,63 @@
1
+ # encoding: utf-8
2
+
3
+ # note: timezone for games (play_at) is *always* CET (central european time)
4
+
5
+
6
+ ##################################
7
+ ### ÖFB Cup 2011/12
8
+
9
+ ofb = Event.create!( :key => 'at_cup_2011_12', :title => 'ÖFB Cup 2011/12', :start_at => Time.cet( '2011-10-10 17:00' ) )
10
+
11
+
12
+ sturm = Team.find_by_key!( 'sturm' )
13
+ ried = Team.find_by_key!( 'ried' )
14
+ salzburg = Team.find_by_key!( 'salzburg' )
15
+ austria = Team.find_by_key!( 'austria' )
16
+ rapid = Team.find_by_key!( 'rapid' )
17
+ wacker = Team.find_by_key!( 'wacker' )
18
+ neustadt = Team.find_by_key!( 'neustadt')
19
+ ksv = Team.find_by_key!( 'ksv' )
20
+ mattersburg = Team.find_by_key!( 'mattersburg' )
21
+ admira = Team.find_by_key!( 'admira' )
22
+
23
+
24
+ hartberg = Team.find_by_key!( 'hartberg' )
25
+ groedig = Team.find_by_key!( 'groedig' )
26
+ juniors = Team.find_by_key!( 'juniors' )
27
+ austrial = Team.find_by_key!( 'austrial' )
28
+
29
+ ofb.teams << sturm
30
+ ofb.teams << hartberg
31
+ ofb.teams << groedig
32
+ ofb.teams << ried
33
+ ofb.teams << salzburg
34
+ ofb.teams << juniors
35
+ ofb.teams << austrial
36
+ ofb.teams << austria
37
+
38
+ ofb8 = Round.create!( :event => ofb, :pos => 1, :title => 'Viertelfinale', :title2 => '10.+11. April 2012' )
39
+ ofb4 = Round.create!( :event => ofb, :pos => 2, :title => 'Halbfinale', :title2 => '1.+2. Mai 2012' )
40
+ ofb1 = Round.create!( :event => ofb, :pos => 3, :title => 'Finale', :title2 => '20. Mai 2012' )
41
+
42
+ games_ofb8 = [
43
+ [ 1, groedig, [2, 3], ried, Time.cet('2012-04-10 18:00') ],
44
+ [ 2, austrial, [1, 2], austria, Time.cet('2012-04-11 18:00') ],
45
+ [ 3, sturm, [2, 2, 2, 4], hartberg, Time.cet('2012-04-11 19:00') ],
46
+ [ 4, salzburg, [4, 1], juniors, Time.cet('2012-04-11 19:00') ]
47
+ ]
48
+
49
+ games_ofb4 = [
50
+ [ 1, hartberg, [0, 1], salzburg, Time.cet('2012-05-01 18:00') ],
51
+ [ 2, ried, [2, 0], austria, Time.cet('2012-05-02 20:30') ]
52
+ ]
53
+
54
+ games_ofb1 = [
55
+ [ 1, salzburg, [3,0], ried, Time.cet('2012-05-20 16:00') ]
56
+ ]
57
+
58
+ Game.create_knockouts_from_ary!( games_ofb8, ofb8 )
59
+ Game.create_knockouts_from_ary!( games_ofb4, ofb4 )
60
+ Game.create_knockouts_from_ary!( games_ofb1, ofb1 )
61
+
62
+
63
+ Prop.create!( :key => 'db.at.cup.2011/12.version', :value => '1' )
@@ -0,0 +1,245 @@
1
+ # encoding: utf-8
2
+
3
+ # note: timezone for games (play_at) is *always* CET (central european time)
4
+
5
+ ######################################
6
+ ## Oesterreichische Bundesliga 2012/13
7
+ ##
8
+ ## more info => http://bundesliga.at
9
+
10
+
11
+ bl = Event.create!( :key => 'at_bl_2012_13',
12
+ :title => 'Österr. Bundesliga 2012/13',
13
+ :start_at => Time.cet('2012-07-21 00:00') )
14
+
15
+ salzburg = Team.find_by_key!( 'salzburg' )
16
+ rapid = Team.find_by_key!( 'rapid' )
17
+ admira = Team.find_by_key!( 'admira' )
18
+ austria = Team.find_by_key!( 'austria' )
19
+ sturm = Team.find_by_key!( 'sturm' )
20
+ ried = Team.find_by_key!( 'ried' )
21
+ wacker = Team.find_by_key!( 'wacker' )
22
+ mattersburg = Team.find_by_key!( 'mattersburg' )
23
+ neustadt = Team.find_by_key!( 'neustadt' )
24
+ wac = Team.find_by_key!( 'wac' )
25
+
26
+
27
+ bl.teams << salzburg
28
+ bl.teams << rapid
29
+ bl.teams << admira
30
+ bl.teams << austria
31
+ bl.teams << sturm
32
+ bl.teams << ried
33
+ bl.teams << wacker
34
+ bl.teams << mattersburg
35
+ bl.teams << neustadt
36
+ bl.teams << wac
37
+
38
+
39
+ bl01 = Round.create!( :event => bl, :pos => 1, :title => '1. Runde', :title2 => '21.+22. Jul 2012' )
40
+ bl02 = Round.create!( :event => bl, :pos => 2, :title => '2. Runde', :title2 => '28.+29. Jul 2012' )
41
+ bl03 = Round.create!( :event => bl, :pos => 3, :title => '3. Runde', :title2 => '4.+5. Aug 2012' )
42
+ bl04 = Round.create!( :event => bl, :pos => 4, :title => '4. Runde', :title2 => '11. Aug 2012' )
43
+ bl05 = Round.create!( :event => bl, :pos => 5, :title => '5. Runde', :title2 => '18. Aug 2012' )
44
+ bl06 = Round.create!( :event => bl, :pos => 6, :title => '6. Runde', :title2 => '25. Aug 2012' )
45
+ bl07 = Round.create!( :event => bl, :pos => 7, :title => '7. Runde', :title2 => '1. Sep 2012' )
46
+ bl08 = Round.create!( :event => bl, :pos => 8, :title => '8. Runde', :title2 => '15. Sep 2012' )
47
+ bl09 = Round.create!( :event => bl, :pos => 9, :title => '9. Runde', :title2 => '22. Sep 2012' )
48
+ bl10 = Round.create!( :event => bl, :pos => 10, :title => '10. Runde', :title2 => '29. Sep 2012' )
49
+ bl11 = Round.create!( :event => bl, :pos => 11, :title => '11. Runde', :title2 => '6. Okt 2012' )
50
+ bl12 = Round.create!( :event => bl, :pos => 12, :title => '12. Runde', :title2 => '20. Okt 2012' )
51
+ bl13 = Round.create!( :event => bl, :pos => 13, :title => '13. Runde', :title2 => '27. Okt 2012' )
52
+ bl14 = Round.create!( :event => bl, :pos => 14, :title => '14. Runde', :title2 => '3. Nov 2012' )
53
+ bl15 = Round.create!( :event => bl, :pos => 15, :title => '15. Runde', :title2 => '10. Nov 2012' )
54
+ bl16 = Round.create!( :event => bl, :pos => 16, :title => '16. Runde', :title2 => '17. Nov 2012' )
55
+ bl17 = Round.create!( :event => bl, :pos => 17, :title => '17. Runde', :title2 => '24. Nov 2012' )
56
+ bl18 = Round.create!( :event => bl, :pos => 18, :title => '18. Runde', :title2 => '1. Dez 2012' )
57
+ bl19 = Round.create!( :event => bl, :pos => 19, :title => '19. Runde', :title2 => '8. Dez 2012' )
58
+ bl20 = Round.create!( :event => bl, :pos => 20, :title => '20. Runde', :title2 => '15. Dez 2012' )
59
+
60
+
61
+ games_bl01 = [
62
+ [ 1, sturm, [], salzburg, Time.cet('2012-07-21 16:00') ],
63
+ [ 2, rapid, [], wacker, Time.cet('2012-07-21 18:30') ],
64
+ [ 3, mattersburg, [], neustadt, Time.cet('2012-07-21 18:30') ],
65
+ [ 4, wac, [], austria, Time.cet('2012-07-21 18:30') ],
66
+ [ 5, admira, [], ried, Time.cet('2012-07-22 16:00') ]
67
+ ]
68
+
69
+ games_bl02 = [
70
+ [ 1, neustadt, [], rapid, Time.cet('2012-07-28 18:30') ],
71
+ [ 2, salzburg, [], mattersburg, Time.cet('2012-07-28 18:30') ],
72
+ [ 3, austria, [], sturm, Time.cet('2012-07-28 18:30') ],
73
+ [ 4, wacker, [], admira, Time.cet('2012-07-29 16:00') ],
74
+ [ 5, ried, [], wac, Time.cet('2012-07-29 18:30') ]
75
+ ]
76
+
77
+ games_bl03 = [
78
+ [ 1, ried, [], wacker, Time.cet('2012-08-04 18:30') ],
79
+ [ 2, mattersburg, [], sturm, Time.cet('2012-08-04 18:30') ],
80
+ [ 3, wac, [], salzburg, Time.cet('2012-08-04 18:30') ],
81
+ [ 4, admira, [], neustadt, Time.cet('2012-08-04 18:30') ],
82
+ [ 5, rapid, [], austria, Time.cet('2012-08-05 16:00') ]
83
+ ]
84
+
85
+ games_bl04 = [
86
+ [ 1, neustadt, [], ried, Time.cet('2012-08-11 00:00') ],
87
+ [ 2, sturm, [], wac, Time.cet('2012-08-11 00:00') ],
88
+ [ 3, salzburg, [], rapid, Time.cet('2012-08-11 00:00') ],
89
+ [ 4, austria, [], admira, Time.cet('2012-08-11 00:00') ],
90
+ [ 5, wacker, [], mattersburg, Time.cet('2012-08-11 00:00') ]
91
+ ]
92
+
93
+ games_bl05 = [
94
+ [ 1, ried, [], austria, Time.cet('2012-08-18 00:00') ],
95
+ [ 2, rapid, [], sturm, Time.cet('2012-08-18 00:00') ],
96
+ [ 3, wacker, [], neustadt, Time.cet('2012-08-18 00:00') ],
97
+ [ 4, wac, [], mattersburg, Time.cet('2012-08-18 00:00') ],
98
+ [ 5, admira, [], salzburg, Time.cet('2012-08-18 00:00') ]
99
+ ]
100
+
101
+ games_bl06 = [
102
+ [ 1, sturm, [], admira, Time.cet('2012-08-25 00:00') ],
103
+ [ 2, salzburg, [], neustadt, Time.cet('2012-08-25 00:00') ],
104
+ [ 3, austria, [], wacker, Time.cet('2012-08-25 00:00') ],
105
+ [ 4, mattersburg, [], ried, Time.cet('2012-08-25 00:00') ],
106
+ [ 5, wac, [], rapid, Time.cet('2012-08-25 00:00') ]
107
+ ]
108
+
109
+ games_bl07 = [
110
+ [ 1, ried, [], sturm, Time.cet('2012-09-01 00:00') ],
111
+ [ 2, neustadt,[], austria, Time.cet('2012-09-01 00:00') ],
112
+ [ 3, rapid, [], mattersburg, Time.cet('2012-09-01 00:00') ],
113
+ [ 4, wacker, [], salzburg, Time.cet('2012-09-01 00:00') ],
114
+ [ 5, admira, [], wac, Time.cet('2012-09-01 00:00') ]
115
+ ]
116
+
117
+ games_bl08 = [
118
+ [ 1, sturm, [], wacker, Time.cet('2012-09-15 00:00') ],
119
+ [ 2, salzburg, [], ried, Time.cet('2012-09-15 00:00') ],
120
+ [ 3, rapid, [], admira, Time.cet('2012-09-15 00:00') ],
121
+ [ 4, mattersburg, [], austria, Time.cet('2012-09-15 00:00') ],
122
+ [ 5, wac, [], neustadt, Time.cet('2012-09-15 00:00') ]
123
+ ]
124
+
125
+ games_bl09 = [
126
+ [ 1, ried, [], rapid, Time.cet('2012-09-22 00:00') ],
127
+ [ 2, neustadt,[], sturm, Time.cet('2012-09-22 00:00') ],
128
+ [ 3, austria, [], salzburg, Time.cet('2012-09-22 00:00') ],
129
+ [ 4, wacker, [], wac, Time.cet('2012-09-22 00:00') ],
130
+ [ 5, admira, [], mattersburg, Time.cet('2012-09-22 00:00') ]
131
+ ]
132
+
133
+ games_bl10 = [
134
+ [ 1, salzburg, [], sturm, Time.cet('2012-09-29 00:00') ],
135
+ [ 2, wacker, [], rapid, Time.cet('2012-09-29 00:00') ],
136
+ [ 3, neustadt, [], mattersburg, Time.cet('2012-09-29 00:00') ],
137
+ [ 4, austria, [], wac, Time.cet('2012-09-29 00:00') ],
138
+ [ 5, ried, [], admira, Time.cet('2012-09-29 00:00') ]
139
+ ]
140
+
141
+ games_bl11 = [
142
+ [ 1, wac, [], ried, Time.cet('2012-10-06 00:00') ],
143
+ [ 2, rapid, [], neustadt, Time.cet('2012-10-06 00:00') ],
144
+ [ 3, mattersburg, [], salzburg, Time.cet('2012-10-06 00:00') ],
145
+ [ 4, sturm, [], austria, Time.cet('2012-10-06 00:00') ],
146
+ [ 5, admira, [], wacker, Time.cet('2012-10-06 00:00') ]
147
+ ]
148
+
149
+ games_bl12 = [
150
+ [ 1, wacker, [], ried, Time.cet('2012-10-20 00:00') ],
151
+ [ 2, austria, [], rapid, Time.cet('2012-10-20 00:00') ],
152
+ [ 3, sturm, [], mattersburg, Time.cet('2012-10-20 00:00') ],
153
+ [ 4, salzburg, [], wac, Time.cet('2012-10-20 00:00') ],
154
+ [ 5, neustadt, [], admira, Time.cet('2012-10-20 00:00') ]
155
+ ]
156
+
157
+ games_bl13 = [
158
+ [ 1, ried, [], neustadt, Time.cet('2012-10-27 00:00') ],
159
+ [ 2, wac, [], sturm, Time.cet('2012-10-27 00:00') ],
160
+ [ 3, rapid, [], salzburg, Time.cet('2012-10-27 00:00') ],
161
+ [ 4, admira, [], austria, Time.cet('2012-10-27 00:00') ],
162
+ [ 5, mattersburg, [], wacker, Time.cet('2012-10-27 00:00') ]
163
+ ]
164
+
165
+ games_bl14 = [
166
+ [ 1, austria, [], ried, Time.cet('2012-11-03 00:00') ],
167
+ [ 2, sturm, [], rapid, Time.cet('2012-11-03 00:00') ],
168
+ [ 3, neustadt, [], wacker, Time.cet('2012-11-03 00:00') ],
169
+ [ 4, mattersburg, [], wac, Time.cet('2012-11-03 00:00') ],
170
+ [ 5, salzburg, [], admira, Time.cet('2012-11-03 00:00') ]
171
+ ]
172
+
173
+ games_bl15 = [
174
+ [ 1, admira, [], sturm, Time.cet('2012-11-10 00:00') ],
175
+ [ 2, neustadt, [], salzburg, Time.cet('2012-11-10 00:00') ],
176
+ [ 3, wacker, [], austria, Time.cet('2012-11-10 00:00') ],
177
+ [ 4, ried, [], mattersburg, Time.cet('2012-11-10 00:00') ],
178
+ [ 5, rapid, [], wac, Time.cet('2012-11-10 00:00') ]
179
+ ]
180
+
181
+ games_bl16 = [
182
+ [ 1, sturm, [], ried, Time.cet('2012-11-17 00:00') ],
183
+ [ 2, austria, [], neustadt, Time.cet('2012-11-17 00:00') ],
184
+ [ 3, mattersburg,[], rapid, Time.cet('2012-11-17 00:00') ],
185
+ [ 4, salzburg, [], wacker, Time.cet('2012-11-17 00:00') ],
186
+ [ 5, wac, [], admira, Time.cet('2012-11-17 00:00') ]
187
+ ]
188
+
189
+ games_bl17 = [
190
+ [ 1, wacker, [], sturm, Time.cet('2012-11-24 00:00') ],
191
+ [ 2, ried, [], salzburg, Time.cet('2012-11-24 00:00') ],
192
+ [ 3, admira, [], rapid, Time.cet('2012-11-24 00:00') ],
193
+ [ 4, austria, [], mattersburg, Time.cet('2012-11-24 00:00') ],
194
+ [ 5, neustadt, [], wac, Time.cet('2012-11-24 00:00') ]
195
+ ]
196
+
197
+ games_bl18 = [
198
+ [ 1, rapid, [], ried, Time.cet('2012-12-01 00:00') ],
199
+ [ 2, sturm, [], neustadt, Time.cet('2012-12-01 00:00') ],
200
+ [ 3, salzburg, [], austria, Time.cet('2012-12-01 00:00') ],
201
+ [ 4, wac, [], wacker, Time.cet('2012-12-01 00:00') ],
202
+ [ 5, mattersburg, [], admira, Time.cet('2012-12-01 00:00') ]
203
+ ]
204
+
205
+ games_bl19 = [
206
+ [ 1, sturm, [], salzburg, Time.cet('2012-12-08 00:00') ],
207
+ [ 2, rapid, [], wacker, Time.cet('2012-12-08 00:00') ],
208
+ [ 3, mattersburg, [], neustadt, Time.cet('2012-12-08 00:00') ],
209
+ [ 4, wac, [], austria, Time.cet('2012-12-08 00:00') ],
210
+ [ 5, admira, [], ried, Time.cet('2012-12-08 00:00') ]
211
+ ]
212
+
213
+ games_bl20 = [
214
+ [ 1, ried, [], wac, Time.cet('2012-12-15 00:00') ],
215
+ [ 2, neustadt, [], rapid, Time.cet('2012-12-15 00:00') ],
216
+ [ 3, salzburg, [], mattersburg, Time.cet('2012-12-15 00:00') ],
217
+ [ 4, austria, [], sturm, Time.cet('2012-12-15 00:00') ],
218
+ [ 5, wacker, [], admira, Time.cet('2012-12-15 00:00') ]
219
+ ]
220
+
221
+
222
+
223
+ Game.create_from_ary!( games_bl01, bl01 )
224
+ Game.create_from_ary!( games_bl02, bl02 )
225
+ Game.create_from_ary!( games_bl03, bl03 )
226
+ Game.create_from_ary!( games_bl04, bl04 )
227
+ Game.create_from_ary!( games_bl05, bl05 )
228
+ Game.create_from_ary!( games_bl06, bl06 )
229
+ Game.create_from_ary!( games_bl07, bl07 )
230
+ Game.create_from_ary!( games_bl08, bl08 )
231
+ Game.create_from_ary!( games_bl09, bl09 )
232
+ Game.create_from_ary!( games_bl10, bl10 )
233
+ Game.create_from_ary!( games_bl11, bl11 )
234
+ Game.create_from_ary!( games_bl12, bl12 )
235
+ Game.create_from_ary!( games_bl13, bl13 )
236
+ Game.create_from_ary!( games_bl14, bl14 )
237
+ Game.create_from_ary!( games_bl15, bl15 )
238
+ Game.create_from_ary!( games_bl16, bl16 )
239
+ Game.create_from_ary!( games_bl17, bl17 )
240
+ Game.create_from_ary!( games_bl18, bl18 )
241
+ Game.create_from_ary!( games_bl19, bl19 )
242
+ Game.create_from_ary!( games_bl20, bl20 )
243
+
244
+
245
+ Prop.create!( :key => 'db.at.bl.2012/13.version', :value => '1' )
@@ -0,0 +1,200 @@
1
+ # encoding: utf-8
2
+
3
+ ##################################
4
+ ### ÖFB Cup 2012/13
5
+
6
+ cup = Event.create!( :key => 'at_cup_2012_13',
7
+ :title => 'ÖFB Cup 2012/13',
8
+ :start_at => Time.cet( '2012-07-13 00:00' ) )
9
+
10
+ cuprunde1 = Round.create!( :event => cup, :pos => 1, :title => '1. Runde', :title2 => '13.-15. Juli 2012' )
11
+ cuprunde2 = Round.create!( :event => cup, :pos => 2, :title => '2. Runde', :title2 => '25.+26. Sep 2012' )
12
+ cup16 = Round.create!( :event => cup, :pos => 3, :title => 'Achtelfinale', :title2 => '30.+31. Okt 2012' )
13
+ cup8 = Round.create!( :event => cup, :pos => 4, :title => 'Viertelfinale', :title2 => '16.+17. April 2013' )
14
+ cup4 = Round.create!( :event => cup, :pos => 5, :title => 'Halbfinale', :title2 => '7.+8. Mai 2013' )
15
+ cup1 = Round.create!( :event => cup, :pos => 6, :title => 'Finale', :title2 => '30. Mai 2013' )
16
+
17
+
18
+ ## bundesliga teams
19
+
20
+ salzburg = Team.find_by_key!( 'salzburg' )
21
+ rapid = Team.find_by_key!( 'rapid' )
22
+ admira = Team.find_by_key!( 'admira' )
23
+ austria = Team.find_by_key!( 'austria' )
24
+ sturm = Team.find_by_key!( 'sturm' )
25
+ ried = Team.find_by_key!( 'ried' )
26
+ wacker = Team.find_by_key!( 'wacker' )
27
+ mattersburg = Team.find_by_key!( 'mattersburg' )
28
+ neustadt = Team.find_by_key!( 'neustadt' )
29
+ wac = Team.find_by_key!( 'wac' )
30
+
31
+ ## erste liga teams
32
+
33
+ ksv = Team.find_by_key!( 'ksv' )
34
+ altach = Team.find_by_key!( 'altach' )
35
+ austrial = Team.find_by_key!( 'austrial' )
36
+ stpoelten = Team.find_by_key!( 'stpoelten' )
37
+ linz = Team.find_by_key!( 'linz' )
38
+ groedig = Team.find_by_key!( 'groedig' )
39
+ lustenau = Team.find_by_key!( 'lustenau' )
40
+ vienna = Team.find_by_key!( 'vienna' )
41
+ hartberg = Team.find_by_key!( 'hartberg' )
42
+ horn = Team.find_by_key!( 'horn' )
43
+
44
+ ## regionalliga west teams
45
+
46
+ hard = Team.find_by_key!( 'hard' )
47
+ bregenz = Team.find_by_key!( 'bregenz' )
48
+ dornbirn = Team.find_by_key!( 'dornbirn' )
49
+ kufstein = Team.find_by_key!( 'kufstein' )
50
+ wattens = Team.find_by_key!( 'wattens' )
51
+ austrias = Team.find_by_key!( 'austrias')
52
+ pinzgau = Team.find_by_key!( 'pinzgau' )
53
+ stjohann = Team.find_by_key!( 'stjohann' )
54
+
55
+ ## regionalliga mitte teams
56
+
57
+ vsv = Team.find_by_key!( 'vsv' )
58
+ klagenfurt = Team.find_by_key!( 'klagenfurt' )
59
+ austriak = Team.find_by_key!( 'austriak' )
60
+ kalsdorf = Team.find_by_key!( 'kalsdorf' )
61
+ gratkorn = Team.find_by_key!( 'gratkorn' )
62
+ allerheiligen = Team.find_by_key!( 'allerheiligen' )
63
+ leoben = Team.find_by_key!( 'leoben' )
64
+ gak = Team.find_by_key!( 'gak' )
65
+ pasching = Team.find_by_key!( 'pasching' )
66
+ voecklamarkt = Team.find_by_key!( 'voecklamarkt' )
67
+ stflorian = Team.find_by_key!( 'stflorian' )
68
+ wallern = Team.find_by_key!( 'wallern' )
69
+ lask = Team.find_by_key!( 'lask' )
70
+
71
+ ## regionalliga ost teams
72
+
73
+ sollenau = Team.find_by_key!( 'sollenau' )
74
+ amstetten = Team.find_by_key!( 'amstetten' )
75
+ retz = Team.find_by_key!( 'retz' )
76
+ fac = Team.find_by_key!( 'fac' )
77
+ schwechat = Team.find_by_key!( 'schwechat' )
78
+ wienersk = Team.find_by_key!( 'wienersk' )
79
+ ostbahn = Team.find_by_key!( 'ostbahn' )
80
+ oberwart = Team.find_by_key!( 'oberwart' )
81
+ parndorf = Team.find_by_key!( 'parndorf' )
82
+ stegersbach = Team.find_by_key!( 'stegersbach' )
83
+
84
+ ## noch einige teams
85
+
86
+ wolfurt = Team.find_by_key!( 'wolfurt' )
87
+ schwaz = Team.find_by_key!( 'schwaz' )
88
+ reutte = Team.find_by_key!( 'reutte' )
89
+ spittal = Team.find_by_key!( 'spittal' )
90
+ sak = Team.find_by_key!( 'sak' )
91
+ dsc = Team.find_by_key!( 'dsc' )
92
+ micheldorf = Team.find_by_key!( 'micheldorf' )
93
+ badvoeslau = Team.find_by_key!( 'badvoeslau' )
94
+ gaflenz = Team.find_by_key!( 'gaflenz' )
95
+ ardagger = Team.find_by_key!( 'ardagger' )
96
+ rohrendorf = Team.find_by_key!( 'rohrendorf' )
97
+ heiligenkreuz = Team.find_by_key!( 'heiligenkreuz' )
98
+ viktoria = Team.find_by_key!( 'viktoria' )
99
+
100
+
101
+ ## 10 Bundeliga Teams
102
+
103
+ cup.teams << salzburg
104
+ cup.teams << rapid
105
+ cup.teams << admira
106
+ cup.teams << austria
107
+ cup.teams << sturm
108
+ cup.teams << ried
109
+ cup.teams << wacker
110
+ cup.teams << mattersburg
111
+ cup.teams << neustadt
112
+ cup.teams << wac
113
+
114
+ ## 10 Erste Liga Teams
115
+
116
+ cup.teams << ksv
117
+ cup.teams << altach
118
+ cup.teams << austrial
119
+ cup.teams << stpoelten
120
+ cup.teams << linz
121
+ cup.teams << groedig
122
+ cup.teams << lustenau
123
+ cup.teams << vienna
124
+ cup.teams << hartberg
125
+ cup.teams << horn
126
+
127
+
128
+
129
+ games_cuprunde1 = [
130
+ [ 1, fac, [0,1], altach, Time.cet('2012-07-12 19:00') ],
131
+ # [ 2, hard, [1,0], schwaz, Time.cet('2012-07-13 18:30') ],
132
+ [ 3, dsc, [1,2], hartberg, Time.cet('2012-07-13 19:00') ],
133
+ [ 4, gratkorn, [0,0,0,0,4,5], wacker, Time.cet('2012-07-13 19:00') ],
134
+ # [ 5, pasching, [2,1], austrias, Time.cet('2012-07-13 19:00') ],
135
+ [ 6, parndorf, [0,3], admira, Time.cet('2012-07-13 19:00') ],
136
+ [ 7, voecklamarkt, [3,4], lustenau, Time.cet('2012-07-13 19:00') ],
137
+ # [ 8, kalsdorf, [3,1], wallern, Time.cet('2012-07-13 19:00') ],
138
+ [ 9, wattens, [0,1], sturm, Time.cet('2012-07-13 19:00') ],
139
+ # [ 10, vsv, [4,2], rohrendorf, Time.cet('2012-07-13 19:00') ],
140
+ [ 11, pinzgau, [0,4], groedig, Time.cet('2012-07-13 19:15') ],
141
+ # [ 12, amstetten, [0,1], schwechat, Time.cet('2012-07-13 19:30') ],
142
+ [ 13, stflorian, [2,1], linz, Time.cet('2012-07-13 19:30') ],
143
+ [ 14, austriak, [3,2], horn, Time.cet('2012-07-13 19:30') ],
144
+ # [ 15, sak, [0,5], allerheiligen, Time.cet('2012-07-13 19:30') ],
145
+ [ 16, gak, [2,2,3,2], vienna, Time.cet('2012-07-13 20:00') ],
146
+ [ 17, wienersk, [0,2], salzburg, Time.cet('2012-07-13 20:30') ],
147
+ # [ 18, stegersbach, [2,2,3,2], reutte, Time.cet('2012-07-14 17:00') ],
148
+ [ 19, badvoeslau, [1,0], stpoelten, Time.cet('2012-07-14 17:00') ],
149
+ # [ 20, micheldorf, [0,1], viktoria, Time.cet('2012-07-14 17:00') ],
150
+ # [ 21, klagenfurt, [1,2], stjohann, Time.cet('2012-07-14 18:00') ],
151
+ # [ 22, lask, [7,0], spittal, Time.cet('2012-07-14 18:00') ],
152
+ [ 23, ostbahn, [1,8], wac, Time.cet('2012-07-14 18:00') ],
153
+ # [ 24, gaflenz, [1,2], sollenau, Time.cet('2012-07-14 18:00') ],
154
+ [ 25, oberwart, [1,3], austria, Time.cet('2012-07-14 18:00') ],
155
+ [ 26, leoben, [1,3], mattersburg, Time.cet('2012-07-14 18:00') ],
156
+ [ 27, retz, [1,7], austrial, Time.cet('2012-07-14 18:00') ],
157
+ [ 28, bregenz, [1,2], ksv, Time.cet('2012-07-14 18:30') ],
158
+ # [ 29, ardagger, [2,2,2,3], dornbirn, Time.cet('2012-07-14 19:00') ],
159
+ [ 30, kufstein, [1,4], ried, Time.cet('2012-07-14 19:00') ],
160
+ [ 31, wolfurt, [2,2,2,4], neustadt, Time.cet('2012-07-15 10:30') ],
161
+ [ 32, heiligenkreuz,[0,5], rapid, Time.cet('2012-07-15 18:00') ]
162
+ ]
163
+
164
+ games_cuprunde2 = [
165
+ [ 1, kalsdorf, [3,0], hartberg, Time.cet('2012-09-24 19:00') ],
166
+ [ 2, viktoria, [2,2,3,3,7,4], ksv, Time.cet('2012-09-25 16:00') ],
167
+ [ 3, hard, [0,3], altach, Time.cet('2012-09-25 16:30') ],
168
+ [ 4, stegersbach, [1,3], salzburg, Time.cet('2012-09-25 18:00') ],
169
+ [ 5, pasching, [1,1,3,2], austrial, Time.cet('2012-09-25 19:00') ],
170
+ [ 6, austriak, [0,0,2,0], admira, Time.cet('2012-09-25 19:00') ],
171
+ [ 7, schwechat, [0,5], sturm, Time.cet('2012-09-25 19:00') ],
172
+ [ 8, lask, [2,0], groedig, Time.cet('2012-09-25 19:00') ],
173
+ [ 9, stjohann, [0,3], lustenau, Time.cet('2012-09-25 19:00') ],
174
+ [ 10, sollenau, [1,1,1,5], wacker, Time.cet('2012-09-25 19:00') ],
175
+ [ 11, vsv, [3,1], neustadt, Time.cet('2012-09-25 19:00') ],
176
+ [ 12, dornbirn, [2,3], austria, Time.cet('2012-09-25 20:30') ],
177
+ [ 13, badvoeslau, [2,3], mattersburg, Time.cet('2012-09-26 16:00') ],
178
+ [ 14, stflorian, [1,1,1,1,5,6], ried, Time.cet('2012-09-26 19:00') ],
179
+ [ 15, allerheiligen, [1,4], rapid, Time.cet('2012-09-26 19:00') ],
180
+ [ 16, gak, [0,6], wac, Time.cet('2012-09-26 20:20') ]
181
+ ]
182
+
183
+ games_cup16 = [
184
+ [ 1, lask, [], mattersburg, Time.cet('2012-10-30 00:00') ],
185
+ [ 2, rapid, [], altach, Time.cet('2012-10-30 00:00') ],
186
+ [ 3, viktoria, [], ried, Time.cet('2012-10-30 00:00') ],
187
+ [ 4, sturm, [], wacker, Time.cet('2012-10-30 00:00') ],
188
+ [ 5, pasching, [], austriak, Time.cet('2012-10-30 00:00') ],
189
+ [ 6, lustenau, [], wac, Time.cet('2012-10-30 00:00') ],
190
+ [ 7, kalsdorf, [], salzburg, Time.cet('2012-10-30 00:00') ],
191
+ [ 8, vsv, [], austria, Time.cet('2012-10-30 00:00') ]]
192
+
193
+
194
+ Game.create_knockouts_from_ary!( games_cuprunde1, cuprunde1 )
195
+ Game.create_knockouts_from_ary!( games_cuprunde2, cuprunde2 )
196
+ Game.create_knockouts_from_ary!( games_cup16, cup16 )
197
+
198
+
199
+
200
+ Prop.create!( :key => 'db.at.cup.2012/13.version', :value => '1' )
@@ -0,0 +1,96 @@
1
+ # encoding: utf-8
2
+
3
+
4
+ bl = [
5
+ [ 'salzburg', 'FC RB Salzburg', 'RBS' ],
6
+ [ 'rapid', 'SK Rapid Wien', 'RAP' ],
7
+ [ 'admira', 'FC Admira Wacker', 'ADM' ],
8
+ [ 'austria', 'FK Austria Wien', 'FAK' ],
9
+ [ 'sturm', 'SK Sturm Graz', 'STU' ],
10
+ [ 'ried', 'SV Ried', 'RIE' ],
11
+ [ 'wacker', 'FC Wacker Innsbruck', 'IBK' ],
12
+ [ 'mattersburg', 'SV Mattersburg', 'SVM' ],
13
+ [ 'neustadt', 'SC Wiener Neustadt', 'WRN' ],
14
+ [ 'wac', 'Wolfsberger AC', 'WAC' ]
15
+ ]
16
+
17
+ ersteliga = [
18
+ [ 'ksv', 'Kapfenberger SV 1919', 'Erste Liga/Stmk.', 'KSV' ],
19
+ [ 'altach', 'SCR Altach', 'Erste Liga/Vbg.', 'ALT' ],
20
+ [ 'austrial', 'SC Austria Lustenau', 'Erste Liga/Vbg.', 'LUS' ],
21
+ [ 'stpoelten', 'SKN St. Pölten', 'Erste Liga/NÖ', 'POE' ],
22
+ [ 'linz', 'FC Blau-Weiß Linz', 'Erste Liga/OÖ', 'BWL' ],
23
+ [ 'groedig', 'SV Grödig', 'Erste Liga/Sbg.', 'GRO' ],
24
+ [ 'lustenau', 'FC Lustenau 1907', 'Erste Liga/Vbg.', 'LUS' ],
25
+ [ 'vienna', 'Vienna FC 1894', 'Erste Liga/Wien', 'VIE' ],
26
+ [ 'hartberg', 'TSV Hartberg', 'Erste Liga/Stmk.', 'HAR' ],
27
+ [ 'horn', 'SV Horn', 'Erste Liga/NÖ', 'HOR' ]
28
+ ]
29
+
30
+ rlwest = [
31
+ [ 'hard', 'FC Hard', 'Regionalliga West/Vbg.', 'HAR' ],
32
+ [ 'bregenz', 'SC Bregenz', 'Regionalliga West/Vbg.', 'BRE' ],
33
+ [ 'dornbirn', 'FC Dornbirn 1913', 'Regionalliga West/Vbg.', 'DOR' ],
34
+ [ 'kufstein', 'FC Kufstein', 'Regionalliga West/Tirol', 'KUF' ],
35
+ [ 'wattens', 'WSG Wattens', 'Regionalliga West/Tirol', 'WAT' ],
36
+ [ 'austrias', 'SV Austria Salzburg', 'Regionalliga West/Sbg.', 'AUS' ],
37
+ [ 'pinzgau', 'FC Pinzgau Saalfelden', 'Regionalliga West/Sbg.', 'PIN' ],
38
+ [ 'stjohann', 'TSV St. Johann', 'Regionalliga West/Sbg.', 'STJ' ]
39
+ ]
40
+
41
+ rlmitte = [
42
+ [ 'vsv' , 'Villacher SV', 'Regionalliga Mitte/Ktn.', 'VSV' ],
43
+ [ 'klagenfurt', 'SAK Celovec/Klagenfurt', 'Regionalliga Mitte/Ktn.', 'CEL' ],
44
+ [ 'austriak', 'SK Austria Klagenfurt', 'Regionalliga Mitte/Ktn.', 'KLA' ],
45
+ [ 'kalsdorf', 'SC Kalsdorf', 'Regionalliga Mitte/Stmk.', 'KAL' ],
46
+ [ 'gratkorn', 'FC Gratkorn', 'Regionalliga Mitte/Stmk.', 'GRA' ],
47
+ [ 'allerheiligen', 'SV Allerheiligen', 'Regionalliga Mitte/Stmk.', 'ALL' ],
48
+ [ 'leoben', 'DSV Leoben', 'Regionalliga Mitte/Stmk.', 'LEO' ],
49
+ [ 'gak', 'Grazer AK', 'Regionalliga Mitte/Stmk.', 'GAK' ],
50
+ [ 'pasching', 'FC Pasching', 'Regionalliga Mitte/OÖ', 'PAS' ],
51
+ [ 'voecklamarkt', 'Vöcklamarkt', 'Regionalliga Mitte/OÖ', 'VOE' ],
52
+ [ 'stflorian', 'St. Florian', 'Regionalliga Mitte/OÖ', 'STF' ],
53
+ [ 'wallern', 'Wallern', 'Regionalliga Mitte/OÖ', 'WAL' ],
54
+ [ 'lask', 'LASK Linz', 'Regionalliga Mitte/OÖ', 'LAS' ]
55
+ ]
56
+
57
+ rlost = [
58
+ [ 'sollenau', '1. SC Sollenau', 'Regionalliga Ost/OÖ', 'SOL' ],
59
+ [ 'amstetten', 'SKU Amstetten', 'Regionalliga Ost/NÖ', 'AMS' ],
60
+ [ 'retz', 'SV Retz', 'Regionalliga Ost/NÖ', 'RET' ],
61
+ [ 'fac' , 'FAC Team für Wien', 'Regionalliga Ost/Wien', 'FAC' ],
62
+ [ 'schwechat', 'SV Schwechat', 'Regionalliga Ost/Wien', 'SCH' ],
63
+ [ 'wienersk', 'Wiener SK', 'Regionalliga Ost/Wien', 'WIE' ],
64
+ [ 'ostbahn', 'SC Ostbahn XI', 'Regionalliga Ost/Wien', 'OST' ],
65
+ [ 'oberwart', 'SV Oberwart', 'Regionalliga Ost/Bgld.', 'OBE' ],
66
+ [ 'parndorf', 'SC/ESV Parndorf 1919', 'Regionalliga Ost/Bgld.', 'PAR' ],
67
+ [ 'stegersbach', 'SV Stegersbach', 'Regionalliga Ost/Bgld.', 'STE' ]
68
+ ]
69
+
70
+ misc = [
71
+ [ 'wolfurt', 'FC Wolfurt', 'Vorarlberg Liga', 'WOL' ],
72
+ [ 'schwaz', 'SC Schwaz', 'Tirol Liga', 'SCH' ],
73
+ [ 'reutte', 'SV Reutte', 'Tirol Liga', 'REU' ],
74
+ [ 'spittal', 'SV Spittal/Drau', 'Kärntner Liga', 'SPI' ],
75
+ [ 'sak', 'SAK 1914', 'Salzburger Liga', 'SAK' ],
76
+ [ 'dsc', 'Deutschlandsberger SC', 'Landesliga/Stmk.', 'DSC' ],
77
+ [ 'micheldorf', 'SV Micheldorf', 'OÖ Liga', 'MIC' ],
78
+ [ 'badvoeslau', 'ASK Bad Vöslau', 'Landesliga/NÖ', 'VOE' ],
79
+ [ 'gaflenz', 'SV Gaflenz', 'Landesliga/NÖ', 'GAF' ],
80
+ [ 'ardagger', 'Ardagger SCU', 'Landesliga/NÖ', 'ARD' ],
81
+ [ 'rohrendorf', 'SC Rohrendorf', '2. Landesliga West/NÖ', 'ROH' ],
82
+ [ 'heiligenkreuz', 'SV Heiligenkreuz', '2. Liga Süd/NÖ', 'HEI' ],
83
+ [ 'viktoria', 'Wiener Viktoria', 'Wiener Stadtliga', 'VIK' ],
84
+ [ 'juniors', 'FC RB Juniors Salzburg' ]
85
+ ]
86
+
87
+
88
+ Team.create_from_ary!( bl )
89
+ Team.create_from_ary!( ersteliga )
90
+ Team.create_from_ary!( rlwest )
91
+ Team.create_from_ary!( rlmitte )
92
+ Team.create_from_ary!( rlost )
93
+ Team.create_from_ary!( misc )
94
+
95
+
96
+ Prop.create!( :key => 'db.at.teams.version', :value => '1' )
@@ -10,6 +10,7 @@ cl = Event.create!( :key => 'cl',
10
10
  :title => 'Champions League 2011/12',
11
11
  :start_at => Time.cet( '2011-10-10 17:00' ) )
12
12
 
13
+
13
14
  inter = Team.find_by_key!( 'inter' )
14
15
  marseille = Team.find_by_key!( 'marseille' )
15
16
  bayern = Team.find_by_key!( 'bayern' )
@@ -83,4 +84,5 @@ Game.create_knockout_pairs_from_ary!( games_cl8, cl8, cl8_2 )
83
84
  Game.create_knockout_pairs_from_ary!( games_cl4, cl4, cl4_2 )
84
85
  Game.create_knockouts_from_ary!( games_cl1, cl1 )
85
86
 
87
+
86
88
  Prop.create!( :key => 'db.cl.2011/12.version', :value => '1' )
@@ -0,0 +1,160 @@
1
+ # encoding: utf-8
2
+
3
+ # note: timezone for games (play_at) is *always* CST (central standard time / -6 hours ??)
4
+
5
+
6
+ mx = Event.create!( :key => 'mx_ap_2012',
7
+ :title => 'México Primera División Apertura 2012',
8
+ :start_at => Time.cst('2012-07-20 00:00') )
9
+
10
+
11
+ america = Team.find_by_key!( 'america' )
12
+ atlante = Team.find_by_key!( 'atlante' )
13
+ atlas = Team.find_by_key!( 'atlas' )
14
+ chivas = Team.find_by_key!( 'chivas' )
15
+ cruzazul = Team.find_by_key!( 'cruzazul' )
16
+ jaguares = Team.find_by_key!( 'jaguares' )
17
+ leon = Team.find_by_key!( 'leon' )
18
+ monarcas = Team.find_by_key!( 'monarcas' )
19
+ monterrey = Team.find_by_key!( 'monterrey' )
20
+ pachuca = Team.find_by_key!( 'pachuca' )
21
+ puebla = Team.find_by_key!( 'puebla' )
22
+ queretaro = Team.find_by_key!( 'queretaro' )
23
+ sanluis = Team.find_by_key!( 'sanluis' )
24
+ slaguna = Team.find_by_key!( 'slaguna' )
25
+ tijuana = Team.find_by_key!( 'tijuana' )
26
+ toluca = Team.find_by_key!( 'toluca' )
27
+ tigres = Team.find_by_key!( 'tigres' )
28
+ pumas = Team.find_by_key!( 'pumas' )
29
+
30
+
31
+ mx.teams << america
32
+ mx.teams << atlante
33
+ mx.teams << atlas
34
+ mx.teams << chivas
35
+ mx.teams << cruzazul
36
+ mx.teams << jaguares
37
+ mx.teams << leon
38
+ mx.teams << monarcas
39
+ mx.teams << monterrey
40
+ mx.teams << pachuca
41
+ mx.teams << puebla
42
+ mx.teams << queretaro
43
+ mx.teams << sanluis
44
+ mx.teams << slaguna
45
+ mx.teams << tijuana
46
+ mx.teams << toluca
47
+ mx.teams << tigres
48
+ mx.teams << pumas
49
+
50
+ j1 = Round.create!( :event => mx, :pos => 1, :title => 'Jornada 1', :title2 => '20, 21 y 22 de julio' )
51
+ j2 = Round.create!( :event => mx, :pos => 2, :title => 'Jornada 2', :title2 => '27, 28 y 29 de julio' )
52
+ j3 = Round.create!( :event => mx, :pos => 3, :title => 'Jornada 3', :title2 => '3, 4, y 5 de agosto' )
53
+ j4 = Round.create!( :event => mx, :pos => 4, :title => 'Jornada 4', :title2 => '10, 11 y 12 de agosto' )
54
+ j5 = Round.create!( :event => mx, :pos => 5, :title => 'Jornada 5', :title2 => '17, 18 y 19 de agosto' )
55
+ j6 = Round.create!( :event => mx, :pos => 6, :title => 'Jornada 6', :title2 => '24, 25 y 26 de agosto' )
56
+ j7 = Round.create!( :event => mx, :pos => 7, :title => 'Jornada 7', :title2 => '31 de agosto, 1 y 2 de septiembre' )
57
+ j8 = Round.create!( :event => mx, :pos => 8, :title => 'Jornada 8', :title2 => '14, 15 y 16 de septiembre' )
58
+
59
+
60
+ games_j1 = [
61
+ [1, jaguares, [], tigres, Time.cst('2012-07-20 19:30') ],
62
+ [2, tijuana, [], puebla, Time.cst('2012-07-20 21:30') ],
63
+ [3, cruzazul, [], monarcas, Time.cst('2012-07-21 17:00') ],
64
+ [4, queretaro, [], leon, Time.cst('2012-07-21 17:00') ],
65
+ [5, slaguna, [], sanluis, Time.cst('2012-07-21 19:00') ],
66
+ [6, monterrey, [], america, Time.cst('2012-07-21 19:00') ],
67
+ [7, atlas, [], pumas, Time.cst('2012-07-21 21:00') ],
68
+ [8, toluca, [], chivas, Time.cst('2012-07-22 12:00') ],
69
+ [9, atlante, [], pachuca, Time.cst('2012-07-22 18:00') ]]
70
+
71
+
72
+ games_j2 = [
73
+ [1, monarcas, [], monterrey, Time.cst('2012-07-27 19:30') ],
74
+ [2, leon, [], tijuana, Time.cst('2012-07-27 21:30') ],
75
+ [3, america, [], jaguares, Time.cst('2012-07-28 17:00') ],
76
+ [4, pachuca, [], atlas, Time.cst('2012-07-28 19:00') ],
77
+ [5, tigres, [], atlante, Time.cst('2012-07-28 19:00') ],
78
+ [6, sanluis, [], cruzazul, Time.cst('2012-07-28 21:00') ],
79
+ [7, puebla, [], toluca, Time.cst('2012-07-29 12:00') ],
80
+ [8, pumas, [], queretaro, Time.cst('2012-07-29 12:00') ],
81
+ [9, chivas, [], slaguna, Time.cst('2012-07-29 17:00')]]
82
+
83
+ games_j3 = [
84
+ [1, slaguna, [], puebla, Time.cst('2012-08-03 19:00') ],
85
+ [2, tijuana, [], pumas, Time.cst('2012-08-03 19:30') ],
86
+ [3, monarcas, [], sanluis, Time.cst('2012-08-03 21:30') ],
87
+ [4, cruzazul, [], chivas, Time.cst('2012-08-04 17:00') ],
88
+ [5, queretaro, [], pachuca, Time.cst('2012-08-04 17:00') ],
89
+ [6, monterrey, [], jaguares, Time.cst('2012-08-04 19:00') ],
90
+ [7, atlas, [], tigres, Time.cst('2012-08-04 21:00') ],
91
+ [8, toluca, [], leon, Time.cst('2012-08-05 12:00') ],
92
+ [9, atlante, [], america, Time.cst('2012-08-05 18:00') ]]
93
+
94
+ games_j4 = [
95
+ [1, jaguares, [], atlante, Time.cst('2012-08-10 19:30') ],
96
+ [2, leon, [], slaguna, Time.cst('2012-08-10 21:30') ],
97
+ [3, america, [], atlas, Time.cst('2012-08-11 17:00') ],
98
+ [4, pachuca, [], tijuana, Time.cst('2012-08-11 19:00') ],
99
+ [5, tigres, [], queretaro, Time.cst('2012-08-11 19:00') ],
100
+ [6, sanluis, [], monterrey, Time.cst('2012-08-11 21:00') ],
101
+ [7, puebla, [], cruzazul, Time.cst('2012-08-12 12:00') ],
102
+ [8, pumas, [], toluca, Time.cst('2012-08-12 12:00') ],
103
+ [9, chivas, [], monarcas, Time.cst('2012-08-12 17:00') ]]
104
+
105
+ games_j5 = [
106
+ [1, tijuana, [], tigres, Time.cst('2012-08-17 19:30') ],
107
+ [2, monarcas, [], puebla, Time.cst('2012-08-17 21:30') ],
108
+ [3, cruzazul, [], leon, Time.cst('2012-08-17 21:30') ],
109
+ [4, queretaro, [], america, Time.cst('2012-08-18 17:00') ],
110
+ [5, slaguna, [], pumas, Time.cst('2012-08-18 19:00') ],
111
+ [6, monterrey, [], atlante, Time.cst('2012-08-18 19:00') ],
112
+ [7, sanluis, [], chivas, Time.cst('2012-08-18 21:00') ],
113
+ [8, atlas, [], jaguares, Time.cst('2012-08-18 21:00') ],
114
+ [9, toluca, [], pachuca, Time.cst('2012-08-19 12:00') ]]
115
+
116
+ games_j6 = [
117
+ [1, jaguares, [], queretaro, Time.cst('2012-08-24 19:30') ],
118
+ [2, leon, [], monarcas, Time.cst('2012-08-24 21:30') ],
119
+ [3, america, [], tijuana, Time.cst('2012-08-25 17:00') ],
120
+ [4, pachuca, [], slaguna, Time.cst('2012-08-25 19:00') ],
121
+ [5, tigres, [], toluca, Time.cst('2012-08-25 19:00') ],
122
+ [6, puebla, [], sanluis, Time.cst('2012-08-26 12:00') ],
123
+ [7, pumas, [], cruzazul, Time.cst('2012-08-26 12:00') ],
124
+ [8, chivas, [], monterrey, Time.cst('2012-08-26 17:00') ],
125
+ [9, atlante, [], atlas, Time.cst('2012-08-26 18:00') ]]
126
+
127
+ games_j7 = [
128
+ [1, tijuana, [], jaguares, Time.cst('2012-08-31 19:30') ],
129
+ [2, monarcas, [], pumas, Time.cst('2012-08-31 21:30') ],
130
+ [3, cruzazul, [], pachuca, Time.cst('2012-09-01 17:00') ],
131
+ [4, queretaro, [], atlante, Time.cst('2012-09-01 17:00') ],
132
+ [5, slaguna, [], tigres, Time.cst('2012-09-01 19:00') ],
133
+ [6, monterrey, [], atlas, Time.cst('2012-09-01 19:00') ],
134
+ [7, sanluis, [], leon, Time.cst('2012-09-01 21:00') ],
135
+ [8, toluca, [], america, Time.cst('2012-09-02 12:00') ],
136
+ [9, chivas, [], puebla, Time.cst('2012-09-02 17:00') ]]
137
+
138
+ games_j8 = [
139
+ [1, jaguares, [], toluca, Time.cst('2012-09-14 19:30') ],
140
+ [2, pachuca, [], monarcas, Time.cst('2012-09-14 19:30') ],
141
+ [3, leon, [], chivas, Time.cst('2012-09-14 21:30') ],
142
+ [4, america, [], slaguna, Time.cst('2012-09-15 17:00') ],
143
+ [5, tigres, [], cruzazul, Time.cst('2012-09-15 19:00') ],
144
+ [6, atlas, [], queretaro, Time.cst('2012-09-15 21:00') ],
145
+ [7, puebla, [], monterrey, Time.cst('2012-09-16 12:00') ],
146
+ [8, pumas, [], sanluis, Time.cst('2012-09-16 12:00') ],
147
+ [9, atlante, [], tijuana, Time.cst('2012-09-16 18:00') ]]
148
+
149
+
150
+ Game.create_from_ary!( games_j1, j1 )
151
+ Game.create_from_ary!( games_j2, j2 )
152
+ Game.create_from_ary!( games_j3, j3 )
153
+ Game.create_from_ary!( games_j4, j4 )
154
+ Game.create_from_ary!( games_j5, j5 )
155
+ Game.create_from_ary!( games_j6, j6 )
156
+ Game.create_from_ary!( games_j7, j7 )
157
+ Game.create_from_ary!( games_j8, j8 )
158
+
159
+
160
+ Prop.create!( :key => 'db.mx.apertura.2012.version', :value => '1' )
@@ -0,0 +1,26 @@
1
+ # encoding: utf-8
2
+
3
+ teams = [
4
+ [ 'america', 'Club América', 'México' ],
5
+ [ 'atlante', 'Atlante', 'Cancún' ],
6
+ [ 'atlas', 'Atlas', 'Guadalajara' ],
7
+ [ 'chivas', 'Guadalajara Chivas', 'Guadalajara' ],
8
+ [ 'cruzazul', 'Cruz Azul', 'México' ],
9
+ [ 'jaguares', 'Jaguares de Chiapas', 'Tuxtla Gutiérrez' ],
10
+ [ 'leon', 'Club León', 'León' ],
11
+ [ 'monarcas', 'Monarcas Morelia', 'Morelia' ],
12
+ [ 'monterrey', 'Monterrey', 'Monterrey' ],
13
+ [ 'pachuca', 'Pachuca', 'Pachuca' ],
14
+ [ 'puebla', 'Puebla F.C. ', 'Puebla' ],
15
+ [ 'queretaro', 'Querétaro F.C.', 'Querétaro' ],
16
+ [ 'sanluis', 'Club San Luis', 'San Luis Potosì' ],
17
+ [ 'slaguna', 'Santos Laguna', 'Torreón' ],
18
+ [ 'tijuana', 'Club Tijuana', 'Tijuana' ],
19
+ [ 'toluca', 'Toluca', 'Toluca' ],
20
+ [ 'tigres', 'Tigres UANL', 'San Nicolás de los Garza' ],
21
+ [ 'pumas', 'Pumas UNAM', 'México' ]
22
+ ]
23
+
24
+ Team.create_from_ary!( teams )
25
+
26
+ Prop.create!( :key => 'db.mx.teams.version', :value => '1' )
@@ -48,6 +48,19 @@ module SportDB
48
48
  def self.load( args )
49
49
  Loader.new.run( args )
50
50
  end
51
+
52
+
53
+ # delete ALL records (use with care!)
54
+ def self.delete!
55
+ Team.delete_all
56
+ Game.delete_all
57
+ Event.delete_all
58
+ EventTeam.delete_all
59
+ Group.delete_all
60
+ GroupTeam.delete_all
61
+ Round.delete_all
62
+ Prop.delete_all
63
+ end # method delete!
51
64
 
52
65
  end # module SportDB
53
66
 
@@ -12,6 +12,16 @@ class Opts
12
12
  end
13
13
 
14
14
 
15
+ def delete=(boolean)
16
+ @delete = boolean
17
+ end
18
+
19
+ def delete?
20
+ return false if @delete.nil? # default create flag is false
21
+ @delete == true
22
+ end
23
+
24
+
15
25
  # use loader? (that is, built-in seed data)
16
26
  def load=(boolean)
17
27
  @load = boolean
@@ -20,6 +20,8 @@ class Runner
20
20
 
21
21
  ## todo: change to different flag?? use -c/--config ???
22
22
  cmd.on( '-c', '--create', 'Create DB Schema' ) { opts.create = true }
23
+
24
+ cmd.on( '--delete', 'Delete all records' ) { opts.delete = true }
23
25
 
24
26
  cmd.on( '--load', 'Use Loader for Builtin Sports Data' ) { opts.load = true }
25
27
 
@@ -82,6 +84,10 @@ EOS
82
84
  if opts.create?
83
85
  CreateDB.up
84
86
  end
87
+
88
+ if opts.delete?
89
+ SportDB.delete!
90
+ end
85
91
 
86
92
  loader = nil
87
93
  if opts.load?
@@ -1,4 +1,4 @@
1
1
 
2
2
  module SportDB
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportdb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 0.2.0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gerald Bauer
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-10-06 00:00:00 Z
18
+ date: 2012-10-07 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rdoc
@@ -61,12 +61,19 @@ files:
61
61
  - README.markdown
62
62
  - Rakefile
63
63
  - bin/sportdb
64
+ - db/at/2011_12/bl.rb
65
+ - db/at/2011_12/cup.rb
66
+ - db/at/2012_13/bl.rb
67
+ - db/at/2012_13/cup.rb
68
+ - db/at/teams.rb
64
69
  - db/cl/2011_12/cl.rb
65
70
  - db/cl/2011_12/el.rb
66
71
  - db/cl/2012_13/cl.rb
67
72
  - db/cl/teams.rb
68
73
  - db/euro/2012.rb
69
74
  - db/euro/teams.rb
75
+ - db/mx/apertura_2012.rb
76
+ - db/mx/teams.rb
70
77
  - db/world/quali_2012_13.rb
71
78
  - lib/sportdb.rb
72
79
  - lib/sportdb/cli/opts.rb