sportdb 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +4 -6
- data/Rakefile +1 -1
- data/db/america/2011.rb +50 -0
- data/db/america/2011.txt +102 -0
- data/db/america/teams.rb +55 -0
- data/db/at/2011_12/bl.txt +40 -40
- data/db/at/2012_13/bl.txt +13 -13
- data/db/at/2012_13/cup.txt +30 -25
- data/db/at/teams.rb +10 -10
- data/db/cl/2012_13/cl.rb +16 -16
- data/db/cl/teams.rb +28 -45
- data/db/copa/sud_2012_13.txt +3 -3
- data/db/copa/teams.rb +23 -13
- data/db/de/2012_13/bl.txt +18 -18
- data/db/de/teams.rb +7 -7
- data/db/en/2012_13/pl.txt +21 -21
- data/db/en/teams.rb +4 -4
- data/db/es/teams.rb +17 -0
- data/db/leagues.rb +1 -0
- data/db/mx/apertura_2012.txt +72 -72
- data/db/mx/teams.rb +5 -5
- data/db/world/teams.rb +1 -39
- data/lib/sportdb.rb +107 -2
- data/lib/sportdb/cli/opts.rb +19 -0
- data/lib/sportdb/cli/runner.rb +49 -52
- data/lib/sportdb/models/team.rb +7 -3
- data/lib/sportdb/reader.rb +2 -2
- data/lib/sportdb/schema.rb +4 -15
- data/lib/sportdb/version.rb +1 -1
- metadata +12 -13
- data/db/at/2011_12/bl_fixtures.rb +0 -113
- data/db/at/2012_13/bl_fixtures.rb +0 -233
- data/db/at/2012_13/cup_fixtures.rb +0 -161
- data/db/de/2012_13/bl_fixtures.rb +0 -279
- data/db/en/2012_13/pl_fixtures.rb +0 -178
- data/db/world/quali_2012_13_europe_fixtures.rb +0 -119
data/lib/sportdb/cli/runner.rb
CHANGED
@@ -22,22 +22,27 @@ class Runner
|
|
22
22
|
|
23
23
|
cmd.banner = "Usage: sportdb [options]"
|
24
24
|
|
25
|
-
cmd.on( '-e', '--event KEY', 'Event to load or generate' ) { |key| opts.event = key; }
|
26
|
-
cmd.on( '-g', '--generate', 'Generate fixtures from template' ) { opts.generate = true }
|
27
25
|
|
28
|
-
##
|
29
|
-
cmd.on( '
|
26
|
+
## NB: reserve -c for use with -c/--config
|
27
|
+
cmd.on( '--create', 'Create DB schema' ) { opts.create = true }
|
28
|
+
cmd.on( '--setup', "Create DB schema 'n' load all builtin data" ) { opts.setup = true }
|
30
29
|
|
31
30
|
cmd.on( '--world', "Populate world tables with builtin data (version #{WorldDB::VERSION})" ) { opts.world = true }
|
31
|
+
cmd.on( '--sport', "Populate sport tables with builtin data" ) { opts.sport = true }
|
32
|
+
|
32
33
|
|
33
34
|
cmd.on( '--delete', 'Delete all records' ) { opts.delete = true }
|
34
35
|
|
36
|
+
### todo: in future allow multiple search path??
|
37
|
+
cmd.on( '-i', '--include PATH', "Data path (default is #{opts.data_path})" ) { |path| opts.data_path = path }
|
38
|
+
|
35
39
|
cmd.on( '--load', 'Use loader for builtin sports data' ) { opts.load = true }
|
40
|
+
|
41
|
+
cmd.on( '-e', '--event KEY', 'Event to load or generate' ) { |key| opts.event = key; }
|
36
42
|
|
37
43
|
cmd.on( '-o', '--output PATH', "Output path (default is #{opts.output_path})" ) { |path| opts.output_path = path }
|
44
|
+
cmd.on( '-g', '--generate', 'Generate fixtures from template' ) { opts.generate = true }
|
38
45
|
|
39
|
-
### todo: in future allow multiple search path??
|
40
|
-
cmd.on( '-i', '--include PATH', "Data path (default is #{opts.data_path})" ) { |path| opts.data_path = path }
|
41
46
|
|
42
47
|
cmd.on( '-v', '--version', "Show version" ) do
|
43
48
|
puts SportDB.banner
|
@@ -90,61 +95,53 @@ EOS
|
|
90
95
|
|
91
96
|
ActiveRecord::Base.establish_connection( db_config )
|
92
97
|
|
93
|
-
if opts.
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
SportDB.
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
'cities',
|
106
|
-
'at/cities',
|
107
|
-
'de/cities'
|
108
|
-
])
|
109
|
-
end
|
98
|
+
if opts.setup?
|
99
|
+
WorldDB.create
|
100
|
+
SportDB.create
|
101
|
+
WorldDB.read_all
|
102
|
+
SportDB.load_all # ruby (.rb) fixtures
|
103
|
+
SportDB.read_all # plain text (.txt) fixtures
|
104
|
+
else
|
105
|
+
|
106
|
+
if opts.create?
|
107
|
+
WorldDB.create
|
108
|
+
SportDB.create
|
109
|
+
end
|
110
110
|
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
if opts.world? || opts.sport?
|
112
|
+
if opts.world?
|
113
|
+
WorldDB.delete! if opts.delete?
|
114
|
+
WorldDB.read_all
|
115
|
+
end
|
116
|
+
|
117
|
+
if opts.sport?
|
118
|
+
SportDB.delete! if opts.delete?
|
119
|
+
SportDB.load_all
|
120
|
+
SportDB.read_all
|
121
|
+
end
|
122
|
+
else # no sport or world flag
|
123
|
+
if opts.delete?
|
124
|
+
SportDB.delete!
|
125
|
+
WorldDB.delete! # countries,regions,cities,tags,taggings,props
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
if opts.event.present?
|
130
|
+
if opts.generate?
|
131
|
+
Templater.new( logger ).run( opts, args ) # export/generate ruby fixtures
|
132
|
+
else
|
133
|
+
Reader.new( logger ).run( opts, args ) # load/read plain text fixtures
|
134
|
+
end
|
114
135
|
else
|
115
|
-
|
136
|
+
Loader.new( logger ).run( opts, args ) # load ruby fixtures
|
116
137
|
end
|
117
|
-
else
|
118
|
-
Loader.new( logger ).run( opts, args ) # load ruby fixtures
|
119
138
|
end
|
120
139
|
|
121
|
-
|
122
|
-
dump_stats
|
123
|
-
dump_props
|
140
|
+
SportDB.stats
|
124
141
|
|
125
142
|
puts 'Done.'
|
126
143
|
|
127
144
|
end # method run
|
128
145
|
|
129
|
-
|
130
|
-
def dump_stats
|
131
|
-
# todo: use %5d or similar to format string
|
132
|
-
puts "Stats:"
|
133
|
-
puts " #{Event.count} events / #{Round.count} rounds / #{Group.count} groups"
|
134
|
-
puts " #{League.count} leagues / #{Season.count} seasons"
|
135
|
-
puts " #{Country.count} countries / #{Region.count} regions / #{City.count} cities"
|
136
|
-
puts " #{Team.count} teams"
|
137
|
-
puts " #{Game.count} games"
|
138
|
-
puts " #{Badge.count} badges"
|
139
|
-
end
|
140
|
-
|
141
|
-
def dump_props
|
142
|
-
# todo: use %5 or similar to format string
|
143
|
-
puts "Props:"
|
144
|
-
Prop.order( 'created_at asc' ).all.each do |prop|
|
145
|
-
puts " #{prop.key} / #{prop.value} || #{prop.created_at}"
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
146
|
end # class Runner
|
150
147
|
end # module SportDB
|
data/lib/sportdb/models/team.rb
CHANGED
@@ -6,7 +6,11 @@ class Team < ActiveRecord::Base
|
|
6
6
|
has_many :home_games, :class_name => 'Game', :foreign_key => 'team1_id'
|
7
7
|
has_many :away_games, :class_name => 'Game', :foreign_key => 'team2_id'
|
8
8
|
|
9
|
-
|
9
|
+
validates :key, :format => { :with => /^[a-z]{2,}$/, :message => 'expected two or more lowercase letters a-z' }
|
10
|
+
validates :code, :format => { :with => /^[A-Z_]{3}$/, :message => 'expected three uppercase letters A-Z (and _)' }, :allow_nil => true
|
11
|
+
|
12
|
+
|
13
|
+
### fix - how to do it with has_many macro? use finder_sql?
|
10
14
|
def games
|
11
15
|
Game.where( 'team1_id = ? or team2_id = ?', id, id ).order( 'play_at' ).all
|
12
16
|
end
|
@@ -42,8 +46,8 @@ class Team < ActiveRecord::Base
|
|
42
46
|
attr[ :country_id ] = value.id
|
43
47
|
elsif value.is_a? City
|
44
48
|
attr[ :city_id ] = value.id
|
45
|
-
elsif value
|
46
|
-
attr[ :
|
49
|
+
elsif value =~ /^[A-Z_]{3}$/ ## assume its three letter code (e.g. ITA)
|
50
|
+
attr[ :code ] = value
|
47
51
|
elsif value =~ /^city:/ ## city:
|
48
52
|
value_city_key = value[5..-1] ## cut off city: prefix
|
49
53
|
value_city = City.find_by_key!( value_city_key )
|
data/lib/sportdb/reader.rb
CHANGED
@@ -83,10 +83,10 @@ private
|
|
83
83
|
titles += team.synonyms.split('|') if team.synonyms.present?
|
84
84
|
|
85
85
|
## NB: sort here by length (largest goes first - best match)
|
86
|
-
# exclude
|
86
|
+
# exclude code and key (key should always go last)
|
87
87
|
titles = titles.sort { |left,right| right.length <=> left.length }
|
88
88
|
|
89
|
-
titles << team.
|
89
|
+
titles << team.code if team.code.present?
|
90
90
|
titles << team.key
|
91
91
|
|
92
92
|
@known_teams << [ team.key, titles ]
|
data/lib/sportdb/schema.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
module SportDB
|
3
3
|
|
4
|
-
class CreateDB
|
4
|
+
class CreateDB ## fix/todo: change to ActiveRecord::Migration why? why not?
|
5
5
|
|
6
6
|
|
7
7
|
## make models available in sportdb module by default with namespace
|
@@ -11,26 +11,14 @@ class CreateDB
|
|
11
11
|
|
12
12
|
def self.up
|
13
13
|
|
14
|
-
WorldDB::CreateDB.up # tables countries,regions,cities,props
|
15
|
-
|
16
14
|
ActiveRecord::Schema.define do
|
17
15
|
|
18
|
-
=begin
|
19
|
-
## todo:fix - use if table.exists? why? why not?
|
20
|
-
|
21
|
-
create_table :props do |t|
|
22
|
-
t.string :key, :null => false
|
23
|
-
t.string :value, :null => false
|
24
|
-
t.timestamps
|
25
|
-
end
|
26
|
-
=end
|
27
|
-
|
28
16
|
|
29
17
|
create_table :teams do |t|
|
30
18
|
t.string :title, :null => false
|
31
19
|
t.string :title2
|
32
20
|
t.string :key, :null => false # import/export key
|
33
|
-
t.string :
|
21
|
+
t.string :code # make it not null? - three letter code (short title)
|
34
22
|
t.string :synonyms # comma separated list of synonyms
|
35
23
|
t.references :country, :null => false
|
36
24
|
t.references :city # NB: city is optional (should be required for clubs e.g. non-national teams)
|
@@ -49,7 +37,8 @@ create_table :events do |t|
|
|
49
37
|
t.references :season, :null => false
|
50
38
|
t.datetime :start_at, :null => false
|
51
39
|
t.datetime :end_at # make it required???
|
52
|
-
t.
|
40
|
+
t.boolean :team3, :null => false, :default => true ## e.g. Champions League has no 3rd place (only 1st and 2nd/final)
|
41
|
+
t.timestamps
|
53
42
|
end
|
54
43
|
|
55
44
|
add_index :events, :key, :unique => true
|
data/lib/sportdb/version.rb
CHANGED
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:
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 8
|
9
|
+
- 0
|
10
|
+
version: 0.8.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-11-
|
18
|
+
date: 2012-11-17 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activerecord
|
@@ -43,9 +43,9 @@ dependencies:
|
|
43
43
|
hash: 23
|
44
44
|
segments:
|
45
45
|
- 0
|
46
|
+
- 3
|
46
47
|
- 2
|
47
|
-
|
48
|
-
version: 0.2.0
|
48
|
+
version: 0.3.2
|
49
49
|
type: :runtime
|
50
50
|
version_requirements: *id002
|
51
51
|
- !ruby/object:Gem::Dependency
|
@@ -86,6 +86,7 @@ extensions: []
|
|
86
86
|
|
87
87
|
extra_rdoc_files:
|
88
88
|
- Manifest.txt
|
89
|
+
- db/america/2011.txt
|
89
90
|
- db/at/2011_12/bl.txt
|
90
91
|
- db/at/2012_13/bl.txt
|
91
92
|
- db/at/2012_13/cup.txt
|
@@ -104,16 +105,16 @@ files:
|
|
104
105
|
- README.markdown
|
105
106
|
- Rakefile
|
106
107
|
- bin/sportdb
|
108
|
+
- db/america/2011.rb
|
109
|
+
- db/america/2011.txt
|
110
|
+
- db/america/teams.rb
|
107
111
|
- db/at/2011_12/bl.rb
|
108
112
|
- db/at/2011_12/bl.txt
|
109
|
-
- db/at/2011_12/bl_fixtures.rb
|
110
113
|
- db/at/2011_12/cup.rb
|
111
114
|
- db/at/2012_13/bl.rb
|
112
115
|
- db/at/2012_13/bl.txt
|
113
|
-
- db/at/2012_13/bl_fixtures.rb
|
114
116
|
- db/at/2012_13/cup.rb
|
115
117
|
- db/at/2012_13/cup.txt
|
116
|
-
- db/at/2012_13/cup_fixtures.rb
|
117
118
|
- db/at/badges.rb
|
118
119
|
- db/at/teams.rb
|
119
120
|
- db/cl/2011_12/cl.rb
|
@@ -126,12 +127,11 @@ files:
|
|
126
127
|
- db/copa/teams.rb
|
127
128
|
- db/de/2012_13/bl.rb
|
128
129
|
- db/de/2012_13/bl.txt
|
129
|
-
- db/de/2012_13/bl_fixtures.rb
|
130
130
|
- db/de/teams.rb
|
131
131
|
- db/en/2012_13/pl.rb
|
132
132
|
- db/en/2012_13/pl.txt
|
133
|
-
- db/en/2012_13/pl_fixtures.rb
|
134
133
|
- db/en/teams.rb
|
134
|
+
- db/es/teams.rb
|
135
135
|
- db/euro/2008.rb
|
136
136
|
- db/euro/2008.txt
|
137
137
|
- db/euro/2012.rb
|
@@ -152,7 +152,6 @@ files:
|
|
152
152
|
- db/world/quali_2012_13_europe.rb
|
153
153
|
- db/world/quali_2012_13_europe_c.rb
|
154
154
|
- db/world/quali_2012_13_europe_c.txt
|
155
|
-
- db/world/quali_2012_13_europe_fixtures.rb
|
156
155
|
- db/world/quali_2012_13_europe_i.rb
|
157
156
|
- db/world/quali_2012_13_europe_i.txt
|
158
157
|
- db/world/teams.rb
|
@@ -1,113 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
####################################################################
|
4
|
-
# generiert am 2012-10-27 17:33:00 +0200
|
5
|
-
# using sportdb 0.4.2 on Ruby 1.9.3 (2012-02-16) [i686-linux]
|
6
|
-
####################################################################
|
7
|
-
|
8
|
-
|
9
|
-
###########################################
|
10
|
-
# Österr. Bundesliga 2011/12
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
ev = Event.find_by_key!( 'at.2011/12' )
|
15
|
-
|
16
|
-
salzburg = Team.find_by_key!( 'salzburg' )
|
17
|
-
rapid = Team.find_by_key!( 'rapid' )
|
18
|
-
admira = Team.find_by_key!( 'admira' )
|
19
|
-
austria = Team.find_by_key!( 'austria' )
|
20
|
-
sturm = Team.find_by_key!( 'sturm' )
|
21
|
-
ried = Team.find_by_key!( 'ried' )
|
22
|
-
wacker = Team.find_by_key!( 'wacker' )
|
23
|
-
mattersburg = Team.find_by_key!( 'mattersburg' )
|
24
|
-
neustadt = Team.find_by_key!( 'neustadt' )
|
25
|
-
ksv = Team.find_by_key!( 'ksv' )
|
26
|
-
|
27
|
-
|
28
|
-
r29 = Round.create!( event: ev, pos: 29, title: '29. Runde', start_at: Time.utc('2012-04-07 16:00'))
|
29
|
-
r30 = Round.create!( event: ev, pos: 30, title: '30. Runde', start_at: Time.utc('2012-04-14 16:00'))
|
30
|
-
r31 = Round.create!( event: ev, pos: 31, title: '31. Runde', start_at: Time.utc('2012-04-21 16:00'))
|
31
|
-
r32 = Round.create!( event: ev, pos: 32, title: '32. Runde', start_at: Time.utc('2012-04-28 16:00'))
|
32
|
-
r33 = Round.create!( event: ev, pos: 33, title: '33. Runde', start_at: Time.utc('2012-05-05 16:00'))
|
33
|
-
r34 = Round.create!( event: ev, pos: 34, title: '34. Runde', start_at: Time.utc('2012-05-10 18:30'))
|
34
|
-
r35 = Round.create!( event: ev, pos: 35, title: '35. Runde', start_at: Time.utc('2012-05-13 16:00'))
|
35
|
-
r36 = Round.create!( event: ev, pos: 36, title: '36. Runde', start_at: Time.utc('2012-05-17 16:00'))
|
36
|
-
|
37
|
-
|
38
|
-
games29 = [
|
39
|
-
[ salzburg, [2,0], wacker, Time.utc('2012-04-07 16:00') ],
|
40
|
-
[ ried, [0,1], austria, Time.utc('2012-04-07 18:30') ],
|
41
|
-
[ ksv, [2,3], admira, Time.utc('2012-04-07 18:30') ],
|
42
|
-
[ rapid, [2,1], neustadt, Time.utc('2012-04-07 18:30') ],
|
43
|
-
[ mattersburg, [0,2], sturm, Time.utc('2012-04-08 16:00') ],
|
44
|
-
]
|
45
|
-
|
46
|
-
games30 = [
|
47
|
-
[ neustadt, [0,0], ksv, Time.utc('2012-04-14 16:00') ],
|
48
|
-
[ admira, [1,1], wacker, Time.utc('2012-04-14 18:30') ],
|
49
|
-
[ sturm, [2,2], salzburg, Time.utc('2012-04-14 18:30') ],
|
50
|
-
[ ried, [2,0], mattersburg, Time.utc('2012-04-14 18:30') ],
|
51
|
-
[ austria, [0,0], rapid, Time.utc('2012-04-15 16:00') ],
|
52
|
-
]
|
53
|
-
|
54
|
-
games31 = [
|
55
|
-
[ wacker, [2,0], neustadt, Time.utc('2012-04-21 16:00') ],
|
56
|
-
[ ksv, [1,0], austria, Time.utc('2012-04-21 18:30') ],
|
57
|
-
[ mattersburg, [1,2], admira, Time.utc('2012-04-21 18:30') ],
|
58
|
-
[ salzburg, [2,0], ried, Time.utc('2012-04-21 18:30') ],
|
59
|
-
[ rapid, [1,1], sturm, Time.utc('2012-04-22 16:00') ],
|
60
|
-
]
|
61
|
-
|
62
|
-
games32 = [
|
63
|
-
[ austria, [3,0], wacker, Time.utc('2012-04-28 16:00') ],
|
64
|
-
[ neustadt, [1,4], admira, Time.utc('2012-04-28 18:30') ],
|
65
|
-
[ mattersburg, [0,1], salzburg, Time.utc('2012-04-28 18:30') ],
|
66
|
-
[ sturm, [2,1], ksv, Time.utc('2012-04-28 18:30') ],
|
67
|
-
[ ried, [2,3], rapid, Time.utc('2012-04-29 16:00') ],
|
68
|
-
]
|
69
|
-
|
70
|
-
games33 = [
|
71
|
-
[ neustadt, [0,0], sturm, Time.utc('2012-05-05 16:00') ],
|
72
|
-
[ admira, [3,2], austria, Time.utc('2012-05-05 18:30') ],
|
73
|
-
[ ksv, [0,0], ried, Time.utc('2012-05-05 18:30') ],
|
74
|
-
[ wacker, [3,6], mattersburg, Time.utc('2012-05-05 18:30') ],
|
75
|
-
[ rapid, [0,1], salzburg, Time.utc('2012-05-06 16:00') ],
|
76
|
-
]
|
77
|
-
|
78
|
-
games34 = [
|
79
|
-
[ salzburg, [2,0], ksv, Time.utc('2012-05-10 18:30') ],
|
80
|
-
[ austria, [3,1], neustadt, Time.utc('2012-05-10 20:30') ],
|
81
|
-
[ ried, [1,1], wacker, Time.utc('2012-05-10 20:30') ],
|
82
|
-
[ mattersburg, [0,1], rapid, Time.utc('2012-05-10 20:30') ],
|
83
|
-
[ sturm, [0,3], admira, Time.utc('2012-05-10 20:30') ],
|
84
|
-
]
|
85
|
-
|
86
|
-
games35 = [
|
87
|
-
[ ksv, [0,2], rapid, Time.utc('2012-05-13 16:00') ],
|
88
|
-
[ wacker, [1,1], sturm, Time.utc('2012-05-13 16:00') ],
|
89
|
-
[ neustadt, [1,5], salzburg, Time.utc('2012-05-13 16:00') ],
|
90
|
-
[ admira, [1,1], ried, Time.utc('2012-05-13 16:00') ],
|
91
|
-
[ austria, [1,0], mattersburg, Time.utc('2012-05-13 16:00') ],
|
92
|
-
]
|
93
|
-
|
94
|
-
games36 = [
|
95
|
-
[ rapid, [2,0], wacker, Time.utc('2012-05-17 16:00') ],
|
96
|
-
[ ried, [2,2], neustadt, Time.utc('2012-05-17 16:00') ],
|
97
|
-
[ mattersburg, [2,0], ksv, Time.utc('2012-05-17 16:00') ],
|
98
|
-
[ sturm, [3,1], austria, Time.utc('2012-05-17 16:00') ],
|
99
|
-
[ salzburg, [2,0], admira, Time.utc('2012-05-17 16:00') ],
|
100
|
-
]
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
Game.create_from_ary!( games29, r29 )
|
105
|
-
Game.create_from_ary!( games30, r30 )
|
106
|
-
Game.create_from_ary!( games31, r31 )
|
107
|
-
Game.create_from_ary!( games32, r32 )
|
108
|
-
Game.create_from_ary!( games33, r33 )
|
109
|
-
Game.create_from_ary!( games34, r34 )
|
110
|
-
Game.create_from_ary!( games35, r35 )
|
111
|
-
Game.create_from_ary!( games36, r36 )
|
112
|
-
|
113
|
-
Prop.create!( key: 'db.at.2011/12.fixtures.version', value: '1' )
|
@@ -1,233 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
####################################################################
|
4
|
-
# generiert am 2012-10-27 17:26:25 +0200
|
5
|
-
# using sportdb 0.4.2 on Ruby 1.9.3 (2012-02-16) [i686-linux]
|
6
|
-
####################################################################
|
7
|
-
|
8
|
-
|
9
|
-
###########################################
|
10
|
-
# Österr. Bundesliga 2012/13
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
ev = Event.find_by_key!( 'at_bl_2012_13' )
|
15
|
-
|
16
|
-
salzburg = Team.find_by_key!( 'salzburg' )
|
17
|
-
rapid = Team.find_by_key!( 'rapid' )
|
18
|
-
admira = Team.find_by_key!( 'admira' )
|
19
|
-
austria = Team.find_by_key!( 'austria' )
|
20
|
-
sturm = Team.find_by_key!( 'sturm' )
|
21
|
-
ried = Team.find_by_key!( 'ried' )
|
22
|
-
wacker = Team.find_by_key!( 'wacker' )
|
23
|
-
mattersburg = Team.find_by_key!( 'mattersburg' )
|
24
|
-
neustadt = Team.find_by_key!( 'neustadt' )
|
25
|
-
wac = Team.find_by_key!( 'wac' )
|
26
|
-
|
27
|
-
|
28
|
-
r01 = Round.create!( event: ev, pos: 1, title: '1. Runde', start_at: Time.utc('2012-07-21 16:00'))
|
29
|
-
r02 = Round.create!( event: ev, pos: 2, title: '2. Runde', start_at: Time.utc('2012-07-28 18:30'))
|
30
|
-
r03 = Round.create!( event: ev, pos: 3, title: '3. Runde', start_at: Time.utc('2012-08-04 18:30'))
|
31
|
-
r04 = Round.create!( event: ev, pos: 4, title: '4. Runde', start_at: Time.utc('2012-08-11 18:30'))
|
32
|
-
r05 = Round.create!( event: ev, pos: 5, title: '5. Runde', start_at: Time.utc('2012-08-18 18:30'))
|
33
|
-
r06 = Round.create!( event: ev, pos: 6, title: '6. Runde', start_at: Time.utc('2012-08-25 18:30'))
|
34
|
-
r07 = Round.create!( event: ev, pos: 7, title: '7. Runde', start_at: Time.utc('2012-09-01 18:30'))
|
35
|
-
r08 = Round.create!( event: ev, pos: 8, title: '8. Runde', start_at: Time.utc('2012-09-15 16:00'))
|
36
|
-
r09 = Round.create!( event: ev, pos: 9, title: '9. Runde', start_at: Time.utc('2012-09-22 16:00'))
|
37
|
-
r10 = Round.create!( event: ev, pos: 10, title: '10. Runde', start_at: Time.utc('2012-09-29 16:00'))
|
38
|
-
r11 = Round.create!( event: ev, pos: 11, title: '11. Runde', start_at: Time.utc('2012-10-06 16:00'))
|
39
|
-
r12 = Round.create!( event: ev, pos: 12, title: '12. Runde', start_at: Time.utc('2012-10-20 16:00'))
|
40
|
-
r13 = Round.create!( event: ev, pos: 13, title: '13. Runde', start_at: Time.utc('2012-10-27 16:00'))
|
41
|
-
r14 = Round.create!( event: ev, pos: 14, title: '14. Runde', start_at: Time.utc('2012-11-03 16:00'))
|
42
|
-
r15 = Round.create!( event: ev, pos: 15, title: '15. Runde', start_at: Time.utc('2012-11-10 16:00'))
|
43
|
-
r16 = Round.create!( event: ev, pos: 16, title: '16. Runde', start_at: Time.utc('2012-11-17 16:00'))
|
44
|
-
r17 = Round.create!( event: ev, pos: 17, title: '17. Runde', start_at: Time.utc('2012-11-24 16:00'))
|
45
|
-
r18 = Round.create!( event: ev, pos: 18, title: '18. Runde', start_at: Time.utc('2012-12-01 16:00'))
|
46
|
-
r19 = Round.create!( event: ev, pos: 19, title: '19. Runde', start_at: Time.utc('2012-12-08 16:00'))
|
47
|
-
r20 = Round.create!( event: ev, pos: 20, title: '20. Runde', start_at: Time.utc('2012-12-15 16:00'))
|
48
|
-
|
49
|
-
|
50
|
-
games01 = [
|
51
|
-
[ sturm, [0,2], salzburg, Time.utc('2012-07-21 16:00') ],
|
52
|
-
[ mattersburg, [2,0], neustadt, Time.utc('2012-07-21 18:30') ],
|
53
|
-
[ rapid, [4,0], wacker, Time.utc('2012-07-21 18:30') ],
|
54
|
-
[ admira, [0,2], ried, Time.utc('2012-07-22 16:00') ],
|
55
|
-
[ wac, [0,1], austria, Time.utc('2012-07-25 18:30') ],
|
56
|
-
]
|
57
|
-
|
58
|
-
games02 = [
|
59
|
-
[ austria, [0,1], sturm, Time.utc('2012-07-28 18:30') ],
|
60
|
-
[ salzburg, [3,2], mattersburg, Time.utc('2012-07-28 18:30') ],
|
61
|
-
[ neustadt, [0,1], rapid, Time.utc('2012-07-28 18:30') ],
|
62
|
-
[ wacker, [1,2], admira, Time.utc('2012-07-29 16:00') ],
|
63
|
-
[ ried, [0,2], wac, Time.utc('2012-07-29 18:30') ],
|
64
|
-
]
|
65
|
-
|
66
|
-
games03 = [
|
67
|
-
[ mattersburg, [3,1], sturm, Time.utc('2012-08-04 18:30') ],
|
68
|
-
[ wac, [0,2], salzburg, Time.utc('2012-08-04 18:30') ],
|
69
|
-
[ rapid, [0,3], austria, Time.utc('2012-08-05 16:00') ],
|
70
|
-
[ ried, [2,0], wacker, Time.utc('2012-08-05 16:00') ],
|
71
|
-
[ admira, [4,0], neustadt, Time.utc('2012-08-05 18:30') ],
|
72
|
-
]
|
73
|
-
|
74
|
-
games04 = [
|
75
|
-
[ wacker, [2,1], mattersburg, Time.utc('2012-08-11 18:30') ],
|
76
|
-
[ sturm, [4,1], wac, Time.utc('2012-08-11 18:30') ],
|
77
|
-
[ salzburg, [0,2], rapid, Time.utc('2012-08-12 16:00') ],
|
78
|
-
[ neustadt, [2,3], ried, Time.utc('2012-08-12 16:00') ],
|
79
|
-
[ austria, [1,0], admira, Time.utc('2012-08-12 18:30') ],
|
80
|
-
]
|
81
|
-
|
82
|
-
games05 = [
|
83
|
-
[ rapid, [3,0], sturm, Time.utc('2012-08-18 18:30') ],
|
84
|
-
[ admira, [4,4], salzburg, Time.utc('2012-08-18 18:30') ],
|
85
|
-
[ wacker, [2,3], neustadt, Time.utc('2012-08-18 18:30') ],
|
86
|
-
[ wac, [0,1], mattersburg, Time.utc('2012-08-18 18:30') ],
|
87
|
-
[ ried, [0,1], austria, Time.utc('2012-08-19 16:00') ],
|
88
|
-
]
|
89
|
-
|
90
|
-
games06 = [
|
91
|
-
[ mattersburg, [2,1], ried, Time.utc('2012-08-25 18:30') ],
|
92
|
-
[ austria, [2,0], wacker, Time.utc('2012-08-25 18:30') ],
|
93
|
-
[ salzburg, [1,1], neustadt, Time.utc('2012-08-25 18:30') ],
|
94
|
-
[ sturm, [3,2], admira, Time.utc('2012-08-25 18:30') ],
|
95
|
-
[ wac, [1,0], rapid, Time.utc('2012-08-26 16:00') ],
|
96
|
-
]
|
97
|
-
|
98
|
-
games07 = [
|
99
|
-
[ wacker, [0,4], salzburg, Time.utc('2012-09-01 18:30') ],
|
100
|
-
[ neustadt, [0,2], austria, Time.utc('2012-09-01 18:30') ],
|
101
|
-
[ ried, [0,1], sturm, Time.utc('2012-09-01 18:30') ],
|
102
|
-
[ admira, [1,1], wac, Time.utc('2012-09-01 18:30') ],
|
103
|
-
[ rapid, [3,0], mattersburg, Time.utc('2012-09-02 16:00') ],
|
104
|
-
]
|
105
|
-
|
106
|
-
games08 = [
|
107
|
-
[ wac, [6,0], neustadt, Time.utc('2012-09-15 16:00') ],
|
108
|
-
[ sturm, [3,0], wacker, Time.utc('2012-09-15 18:30') ],
|
109
|
-
[ rapid, [0,0], admira, Time.utc('2012-09-15 18:30') ],
|
110
|
-
[ salzburg, [1,1], ried, Time.utc('2012-09-15 18:30') ],
|
111
|
-
[ mattersburg, [2,4], austria, Time.utc('2012-09-16 16:00') ],
|
112
|
-
]
|
113
|
-
|
114
|
-
games09 = [
|
115
|
-
[ admira, [5,1], mattersburg, Time.utc('2012-09-22 16:00') ],
|
116
|
-
[ austria, [0,1], salzburg, Time.utc('2012-09-22 18:30') ],
|
117
|
-
[ neustadt, [1,1], sturm, Time.utc('2012-09-22 18:30') ],
|
118
|
-
[ wacker, [0,1], wac, Time.utc('2012-09-22 18:30') ],
|
119
|
-
[ ried, [0,2], rapid, Time.utc('2012-09-23 16:30') ],
|
120
|
-
]
|
121
|
-
|
122
|
-
games10 = [
|
123
|
-
[ austria, [1,1], wac, Time.utc('2012-09-29 16:00') ],
|
124
|
-
[ ried, [1,1], admira, Time.utc('2012-09-29 18:30') ],
|
125
|
-
[ wacker, [0,2], rapid, Time.utc('2012-09-29 18:30') ],
|
126
|
-
[ neustadt, [0,0], mattersburg, Time.utc('2012-09-29 18:30') ],
|
127
|
-
[ salzburg, [3,2], sturm, Time.utc('2012-09-30 16:00') ],
|
128
|
-
]
|
129
|
-
|
130
|
-
games11 = [
|
131
|
-
[ wac, [2,5], ried, Time.utc('2012-10-06 16:00') ],
|
132
|
-
[ admira, [4,1], wacker, Time.utc('2012-10-06 18:30') ],
|
133
|
-
[ mattersburg, [1,3], salzburg, Time.utc('2012-10-06 18:30') ],
|
134
|
-
[ sturm, [1,1], austria, Time.utc('2012-10-07 16:00') ],
|
135
|
-
[ rapid, [1,1], neustadt, Time.utc('2012-10-07 18:30') ],
|
136
|
-
]
|
137
|
-
|
138
|
-
games12 = [
|
139
|
-
[ salzburg, [4,1], wac, Time.utc('2012-10-20 16:00') ],
|
140
|
-
[ neustadt, [2,1], admira, Time.utc('2012-10-20 18:30') ],
|
141
|
-
[ sturm, [0,0], mattersburg, Time.utc('2012-10-20 18:30') ],
|
142
|
-
[ wacker, [1,0], ried, Time.utc('2012-10-20 18:30') ],
|
143
|
-
[ austria, [2,0], rapid, Time.utc('2012-10-21 16:00') ],
|
144
|
-
]
|
145
|
-
|
146
|
-
games13 = [
|
147
|
-
[ ried, [], neustadt, Time.utc('2012-10-27 16:00') ],
|
148
|
-
[ mattersburg, [], wacker, Time.utc('2012-10-27 18:30') ],
|
149
|
-
[ admira, [], austria, Time.utc('2012-10-27 18:30') ],
|
150
|
-
[ wac, [], sturm, Time.utc('2012-10-27 18:30') ],
|
151
|
-
[ rapid, [], salzburg, Time.utc('2012-10-28 16:00') ],
|
152
|
-
]
|
153
|
-
|
154
|
-
games14 = [
|
155
|
-
[ neustadt, [], wacker, Time.utc('2012-11-03 16:00') ],
|
156
|
-
[ sturm, [], rapid, Time.utc('2012-11-03 18:30') ],
|
157
|
-
[ salzburg, [], admira, Time.utc('2012-11-03 18:30') ],
|
158
|
-
[ mattersburg, [], wac, Time.utc('2012-11-03 18:30') ],
|
159
|
-
[ austria, [], ried, Time.utc('2012-11-04 16:00') ],
|
160
|
-
]
|
161
|
-
|
162
|
-
games15 = [
|
163
|
-
[ admira, [], sturm, Time.utc('2012-11-10 16:00') ],
|
164
|
-
[ wacker, [], austria, Time.utc('2012-11-10 18:30') ],
|
165
|
-
[ ried, [], mattersburg, Time.utc('2012-11-10 18:30') ],
|
166
|
-
[ neustadt, [], salzburg, Time.utc('2012-11-11 16:00') ],
|
167
|
-
[ rapid, [], wac, Time.utc('2012-11-11 18:30') ],
|
168
|
-
]
|
169
|
-
|
170
|
-
games16 = [
|
171
|
-
[ salzburg, [], wacker, Time.utc('2012-11-17 16:00') ],
|
172
|
-
[ austria, [], neustadt, Time.utc('2012-11-17 16:00') ],
|
173
|
-
[ mattersburg, [], rapid, Time.utc('2012-11-17 16:00') ],
|
174
|
-
[ sturm, [], ried, Time.utc('2012-11-17 16:00') ],
|
175
|
-
[ wac, [], admira, Time.utc('2012-11-17 16:00') ],
|
176
|
-
]
|
177
|
-
|
178
|
-
games17 = [
|
179
|
-
[ wacker, [], sturm, Time.utc('2012-11-24 16:00') ],
|
180
|
-
[ admira, [], rapid, Time.utc('2012-11-24 16:00') ],
|
181
|
-
[ austria, [], mattersburg, Time.utc('2012-11-24 16:00') ],
|
182
|
-
[ ried, [], salzburg, Time.utc('2012-11-24 16:00') ],
|
183
|
-
[ neustadt, [], wac, Time.utc('2012-11-24 16:00') ],
|
184
|
-
]
|
185
|
-
|
186
|
-
games18 = [
|
187
|
-
[ sturm, [], neustadt, Time.utc('2012-12-01 16:00') ],
|
188
|
-
[ rapid, [], ried, Time.utc('2012-12-01 16:00') ],
|
189
|
-
[ salzburg, [], austria, Time.utc('2012-12-01 16:00') ],
|
190
|
-
[ mattersburg, [], admira, Time.utc('2012-12-01 16:00') ],
|
191
|
-
[ wac, [], wacker, Time.utc('2012-12-01 16:00') ],
|
192
|
-
]
|
193
|
-
|
194
|
-
games19 = [
|
195
|
-
[ mattersburg, [], neustadt, Time.utc('2012-12-08 16:00') ],
|
196
|
-
[ admira, [], ried, Time.utc('2012-12-08 16:00') ],
|
197
|
-
[ rapid, [], wacker, Time.utc('2012-12-08 16:00') ],
|
198
|
-
[ sturm, [], salzburg, Time.utc('2012-12-08 16:00') ],
|
199
|
-
[ wac, [], austria, Time.utc('2012-12-08 16:00') ],
|
200
|
-
]
|
201
|
-
|
202
|
-
games20 = [
|
203
|
-
[ salzburg, [], mattersburg, Time.utc('2012-12-15 16:00') ],
|
204
|
-
[ wacker, [], admira, Time.utc('2012-12-15 16:00') ],
|
205
|
-
[ austria, [], sturm, Time.utc('2012-12-15 16:00') ],
|
206
|
-
[ neustadt, [], rapid, Time.utc('2012-12-15 16:00') ],
|
207
|
-
[ ried, [], wac, Time.utc('2012-12-15 16:00') ],
|
208
|
-
]
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
Game.create_from_ary!( games01, r01 )
|
213
|
-
Game.create_from_ary!( games02, r02 )
|
214
|
-
Game.create_from_ary!( games03, r03 )
|
215
|
-
Game.create_from_ary!( games04, r04 )
|
216
|
-
Game.create_from_ary!( games05, r05 )
|
217
|
-
Game.create_from_ary!( games06, r06 )
|
218
|
-
Game.create_from_ary!( games07, r07 )
|
219
|
-
Game.create_from_ary!( games08, r08 )
|
220
|
-
Game.create_from_ary!( games09, r09 )
|
221
|
-
Game.create_from_ary!( games10, r10 )
|
222
|
-
Game.create_from_ary!( games11, r11 )
|
223
|
-
Game.create_from_ary!( games12, r12 )
|
224
|
-
Game.create_from_ary!( games13, r13 )
|
225
|
-
Game.create_from_ary!( games14, r14 )
|
226
|
-
Game.create_from_ary!( games15, r15 )
|
227
|
-
Game.create_from_ary!( games16, r16 )
|
228
|
-
Game.create_from_ary!( games17, r17 )
|
229
|
-
Game.create_from_ary!( games18, r18 )
|
230
|
-
Game.create_from_ary!( games19, r19 )
|
231
|
-
Game.create_from_ary!( games20, r20 )
|
232
|
-
|
233
|
-
Prop.create!( key: 'db.at_bl_2012_13.fixtures.version', value: '1' )
|