sportdb-exporters 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +2 -0
- data/Manifest.txt +3 -1
- data/README.md +5 -6
- data/Rakefile +1 -1
- data/lib/sportdb/exporters/json_exporter.rb +8 -3
- data/lib/sportdb/exporters/json_exporter_copa.rb +221 -0
- data/lib/sportdb/exporters/json_exporter_euro.rb +220 -0
- data/lib/sportdb/exporters/{json_exporter_more.rb → json_exporter_worldcup.rb} +1 -1
- data/lib/sportdb/exporters/version.rb +8 -8
- data/lib/sportdb/exporters.rb +8 -4
- metadata +20 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bf114c0499a16b2776a10e95e3117d7c27e7d419d91e60655d522b396ad55bee
|
4
|
+
data.tar.gz: 425ee87569a742578b48a72583dca9be51b0da803016e1cc3147204d32840430
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 862ce0c0def8d26713a4ee286ea60e1980a58bd1034b4a609b374fb4f73a6a3eff04e7b48bb734857f6fae0b106059f7436f9703da5cb35ba1ce32727601a04a
|
7
|
+
data.tar.gz: 660d5ffda2a06cf6c2e8c354a03cf94b050de8381dd15e96e6316a156722a9d945071ee5dd0e21104d02d2cbce39fe8d651a7b5050ea188d33ac4d8e8feb8c1e
|
data/CHANGELOG.md
CHANGED
data/Manifest.txt
CHANGED
@@ -4,5 +4,7 @@ README.md
|
|
4
4
|
Rakefile
|
5
5
|
lib/sportdb/exporters.rb
|
6
6
|
lib/sportdb/exporters/json_exporter.rb
|
7
|
-
lib/sportdb/exporters/
|
7
|
+
lib/sportdb/exporters/json_exporter_copa.rb
|
8
|
+
lib/sportdb/exporters/json_exporter_euro.rb
|
9
|
+
lib/sportdb/exporters/json_exporter_worldcup.rb
|
8
10
|
lib/sportdb/exporters/version.rb
|
data/README.md
CHANGED
@@ -5,7 +5,6 @@
|
|
5
5
|
* bugs :: [github.com/sportdb/sport.db/issues](https://github.com/sportdb/sport.db/issues)
|
6
6
|
* gem :: [rubygems.org/gems/sportdb-exporters](https://rubygems.org/gems/sportdb-exporters)
|
7
7
|
* rdoc :: [rubydoc.info/gems/sportdb-exporters](http://rubydoc.info/gems/sportdb-exporters)
|
8
|
-
* forum :: [groups.google.com/group/opensport](https://groups.google.com/group/opensport)
|
9
8
|
|
10
9
|
|
11
10
|
## Usage
|
@@ -15,14 +14,14 @@ TBD
|
|
15
14
|
|
16
15
|
## License
|
17
16
|
|
18
|
-
![](https://publicdomainworks.github.io/buttons/zero88x31.png)
|
19
|
-
|
20
17
|
The `sportdb-exporters` scripts are dedicated to the public domain.
|
21
18
|
Use it as you please with no restrictions whatsoever.
|
22
19
|
|
23
20
|
|
21
|
+
|
22
|
+
|
24
23
|
## Questions? Comments?
|
25
24
|
|
26
|
-
|
27
|
-
[
|
28
|
-
|
25
|
+
Yes, you can. More than welcome.
|
26
|
+
See [Help & Support »](https://github.com/openfootball/help)
|
27
|
+
|
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ Hoe.spec 'sportdb-exporters' do
|
|
11
11
|
self.urls = { home: 'https://github.com/sportdb/sport.db' }
|
12
12
|
|
13
13
|
self.author = 'Gerald Bauer'
|
14
|
-
self.email = '
|
14
|
+
self.email = 'gerald.bauer@gmail.com'
|
15
15
|
|
16
16
|
# switch extension to .markdown for gihub formatting
|
17
17
|
self.readme_file = 'README.md'
|
@@ -48,7 +48,7 @@ def self.export( league_key, out_root: )
|
|
48
48
|
|
49
49
|
out_dir = "#{out_root}/#{season_basename}"
|
50
50
|
## make sure folders exist
|
51
|
-
FileUtils.mkdir_p( out_dir ) unless Dir.
|
51
|
+
FileUtils.mkdir_p( out_dir ) unless Dir.exist?( out_dir )
|
52
52
|
|
53
53
|
### note:
|
54
54
|
## skip teams for now if no teams on "top-level"
|
@@ -222,11 +222,16 @@ def self.build_goals( match )
|
|
222
222
|
g = { name: goal.person.name,
|
223
223
|
minute: goal.minute,
|
224
224
|
}
|
225
|
+
|
225
226
|
g[:offset] = goal.offset if goal.offset != 0
|
226
|
-
g[:score1] = goal.score1
|
227
|
-
g[:score2] = goal.score2
|
228
227
|
g[:penalty] = goal.penalty if goal.penalty
|
229
228
|
g[:owngoal] = goal.owngoal if goal.owngoal
|
229
|
+
|
230
|
+
=begin
|
231
|
+
g[:score1] = goal.score1
|
232
|
+
g[:score2] = goal.score2
|
233
|
+
=end
|
234
|
+
|
230
235
|
goals << g
|
231
236
|
end
|
232
237
|
[goals1, goals2]
|
@@ -0,0 +1,221 @@
|
|
1
|
+
module SportDb
|
2
|
+
class JsonExporter
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
def self.export_copa( league_key, out_root: )
|
7
|
+
|
8
|
+
league = Model::League.find_by_key!( league_key )
|
9
|
+
|
10
|
+
league.events.each do |event|
|
11
|
+
puts "** event:"
|
12
|
+
pp event.name
|
13
|
+
pp event.season
|
14
|
+
pp event.league
|
15
|
+
puts "teams.count: #{event.teams.count}"
|
16
|
+
puts "rounds.count: #{event.rounds.count}"
|
17
|
+
puts "groups.count: #{event.groups.count}"
|
18
|
+
puts "grounds.count: #{event.grounds.count}"
|
19
|
+
|
20
|
+
|
21
|
+
grounds = []
|
22
|
+
event.grounds.each do |ground|
|
23
|
+
grounds << { key: ground.key,
|
24
|
+
name: ground.name,
|
25
|
+
capacity: ground.capacity,
|
26
|
+
city: ground.city.name,
|
27
|
+
# timezone: 'UTC+1' ## use summertime (CEST+2) why? why not?
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
hash_grounds = {
|
32
|
+
name: event.name,
|
33
|
+
stadiums: grounds
|
34
|
+
}
|
35
|
+
|
36
|
+
pp hash_grounds
|
37
|
+
|
38
|
+
|
39
|
+
teams = []
|
40
|
+
event.teams.each do |team|
|
41
|
+
t = { name: team.name,
|
42
|
+
code: team.code }
|
43
|
+
teams << t
|
44
|
+
end
|
45
|
+
|
46
|
+
hash_teams = {
|
47
|
+
name: event.name,
|
48
|
+
teams: teams
|
49
|
+
}
|
50
|
+
|
51
|
+
pp hash_teams
|
52
|
+
|
53
|
+
|
54
|
+
standings = []
|
55
|
+
event.groups.each do |group|
|
56
|
+
entries = []
|
57
|
+
group_standing = Model::GroupStanding.find_by( group_id: group.id )
|
58
|
+
if group_standing
|
59
|
+
group_standing.entries.each do |entry|
|
60
|
+
entries << { team: { name: entry.team.name, code: entry.team.code },
|
61
|
+
pos: entry.pos,
|
62
|
+
played: entry.played,
|
63
|
+
won: entry.won,
|
64
|
+
drawn: entry.drawn,
|
65
|
+
lost: entry.lost,
|
66
|
+
goals_for: entry.goals_for,
|
67
|
+
goals_against: entry.goals_against,
|
68
|
+
pts: entry.pts
|
69
|
+
}
|
70
|
+
end
|
71
|
+
end
|
72
|
+
standings << { name: group.name, standings: entries }
|
73
|
+
end
|
74
|
+
|
75
|
+
hash_standings = {
|
76
|
+
name: event.name,
|
77
|
+
groups: standings
|
78
|
+
}
|
79
|
+
|
80
|
+
pp hash_standings
|
81
|
+
|
82
|
+
|
83
|
+
groups = []
|
84
|
+
event.groups.each do |group|
|
85
|
+
teams = []
|
86
|
+
group.teams.each do |team|
|
87
|
+
teams << { name: team.name,
|
88
|
+
code: team.code
|
89
|
+
}
|
90
|
+
end
|
91
|
+
groups << { name: group.name, teams: teams }
|
92
|
+
end
|
93
|
+
|
94
|
+
hash_groups = {
|
95
|
+
name: event.name,
|
96
|
+
groups: groups
|
97
|
+
}
|
98
|
+
|
99
|
+
pp hash_groups
|
100
|
+
|
101
|
+
|
102
|
+
rounds = []
|
103
|
+
event.rounds.each do |round|
|
104
|
+
matches = []
|
105
|
+
round.matches.each do |game|
|
106
|
+
m = { num: game.pos, ## use id - why? why not?
|
107
|
+
date: game.date.strftime( '%Y-%m-%d'),
|
108
|
+
time: game.time, ## note: time is stored as string!!!
|
109
|
+
team1: {
|
110
|
+
name: game.team1.name,
|
111
|
+
code: game.team1.code
|
112
|
+
},
|
113
|
+
team2: {
|
114
|
+
name: game.team2.name,
|
115
|
+
code: game.team2.code
|
116
|
+
},
|
117
|
+
}
|
118
|
+
|
119
|
+
score = {}
|
120
|
+
|
121
|
+
if game.score1
|
122
|
+
score[:ft] = [game.score1,
|
123
|
+
game.score2]
|
124
|
+
if game.score1i
|
125
|
+
# half time / first third (opt)
|
126
|
+
# half time - team 2
|
127
|
+
score[:ht] = [game.score1i,
|
128
|
+
game.score2i]
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
## note: change do NOT check for knockout flag
|
133
|
+
## check for scores for now
|
134
|
+
if game.score1et
|
135
|
+
# extratime - team 1 (opt)
|
136
|
+
# extratime - team 2 (opt)
|
137
|
+
score[:et] = [game.score1et,
|
138
|
+
game.score2et]
|
139
|
+
if game.score1p
|
140
|
+
# penalty - team 1 (opt)
|
141
|
+
# penalty - team 2 (opt) elfmeter (opt)
|
142
|
+
score[:p] = [game.score1p,
|
143
|
+
game.score2p
|
144
|
+
]
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
m[:score] = score
|
149
|
+
|
150
|
+
# m[ :knockout ] = game.knockout
|
151
|
+
|
152
|
+
|
153
|
+
unless game.goals.empty?
|
154
|
+
goals1, goals2 = build_goals( game )
|
155
|
+
m[ :goals1 ] = goals1
|
156
|
+
m[ :goals2 ] = goals2
|
157
|
+
end
|
158
|
+
|
159
|
+
if game.group
|
160
|
+
m[ :group ] = game.group.name
|
161
|
+
end
|
162
|
+
|
163
|
+
if game.ground
|
164
|
+
m[ :stadium ] = { key: game.ground.key, name: game.ground.name }
|
165
|
+
m[ :city ] = game.ground.city.name
|
166
|
+
# m[ :timezone ] = 'UTC+1' ## use summertime (CEST+2) why? why not?
|
167
|
+
end
|
168
|
+
|
169
|
+
matches << m
|
170
|
+
end
|
171
|
+
|
172
|
+
rounds << { name: round.name, matches: matches }
|
173
|
+
end
|
174
|
+
|
175
|
+
hash_matches = {
|
176
|
+
name: event.name,
|
177
|
+
rounds: rounds
|
178
|
+
}
|
179
|
+
|
180
|
+
pp hash_matches
|
181
|
+
|
182
|
+
|
183
|
+
## build path e.g.
|
184
|
+
## 2014-15/at.1.clubs.json
|
185
|
+
## 2018/worldcup.teams.json
|
186
|
+
|
187
|
+
## -- check for remapping (e.g. add .1); if not found use league key as is
|
188
|
+
## league_basename = event.league.key
|
189
|
+
league_basename = 'copa' ## use copa (not southamerica) for now - why? why not?
|
190
|
+
|
191
|
+
season_basename = event.season.name.sub('/', '-') ## e.g. change 2014/15 to 2014-15
|
192
|
+
|
193
|
+
|
194
|
+
out_dir = "#{out_root}/#{season_basename}"
|
195
|
+
## make sure folders exist
|
196
|
+
FileUtils.mkdir_p( out_dir ) unless Dir.exist?( out_dir )
|
197
|
+
|
198
|
+
File.open( "#{out_dir}/#{league_basename}.stadiums.json", 'w' ) do |f|
|
199
|
+
f.write JSON.pretty_generate( hash_grounds )
|
200
|
+
end
|
201
|
+
|
202
|
+
File.open( "#{out_dir}/#{league_basename}.teams.json", 'w' ) do |f|
|
203
|
+
f.write JSON.pretty_generate( hash_teams )
|
204
|
+
end
|
205
|
+
|
206
|
+
File.open( "#{out_dir}/#{league_basename}.groups.json", 'w' ) do |f|
|
207
|
+
f.write JSON.pretty_generate( hash_groups )
|
208
|
+
end
|
209
|
+
|
210
|
+
File.open( "#{out_dir}/#{league_basename}.standings.json", 'w' ) do |f|
|
211
|
+
f.write JSON.pretty_generate( hash_standings )
|
212
|
+
end
|
213
|
+
|
214
|
+
File.open( "#{out_dir}/#{league_basename}.json", 'w' ) do |f|
|
215
|
+
f.write JSON.pretty_generate( hash_matches )
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
end # class Json Exporter
|
221
|
+
end # module SportDb
|
@@ -0,0 +1,220 @@
|
|
1
|
+
module SportDb
|
2
|
+
class JsonExporter
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
def self.export_euro( league_key, out_root: )
|
7
|
+
|
8
|
+
league = Model::League.find_by_key!( league_key )
|
9
|
+
|
10
|
+
league.events.each do |event|
|
11
|
+
puts "** event:"
|
12
|
+
pp event.name
|
13
|
+
pp event.season
|
14
|
+
pp event.league
|
15
|
+
puts "teams.count: #{event.teams.count}"
|
16
|
+
puts "rounds.count: #{event.rounds.count}"
|
17
|
+
puts "groups.count: #{event.groups.count}"
|
18
|
+
puts "grounds.count: #{event.grounds.count}"
|
19
|
+
|
20
|
+
|
21
|
+
grounds = []
|
22
|
+
event.grounds.each do |ground|
|
23
|
+
grounds << { key: ground.key,
|
24
|
+
name: ground.name,
|
25
|
+
capacity: ground.capacity,
|
26
|
+
city: ground.city.name,
|
27
|
+
timezone: 'UTC+1' ## use summertime (CEST+2) why? why not?
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
hash_grounds = {
|
32
|
+
name: event.name,
|
33
|
+
stadiums: grounds
|
34
|
+
}
|
35
|
+
|
36
|
+
pp hash_grounds
|
37
|
+
|
38
|
+
|
39
|
+
teams = []
|
40
|
+
event.teams.each do |team|
|
41
|
+
t = { name: team.name,
|
42
|
+
code: team.code }
|
43
|
+
teams << t
|
44
|
+
end
|
45
|
+
|
46
|
+
hash_teams = {
|
47
|
+
name: event.name,
|
48
|
+
teams: teams
|
49
|
+
}
|
50
|
+
|
51
|
+
pp hash_teams
|
52
|
+
|
53
|
+
|
54
|
+
standings = []
|
55
|
+
event.groups.each do |group|
|
56
|
+
entries = []
|
57
|
+
group_standing = Model::GroupStanding.find_by( group_id: group.id )
|
58
|
+
if group_standing
|
59
|
+
group_standing.entries.each do |entry|
|
60
|
+
entries << { team: { name: entry.team.name, code: entry.team.code },
|
61
|
+
pos: entry.pos,
|
62
|
+
played: entry.played,
|
63
|
+
won: entry.won,
|
64
|
+
drawn: entry.drawn,
|
65
|
+
lost: entry.lost,
|
66
|
+
goals_for: entry.goals_for,
|
67
|
+
goals_against: entry.goals_against,
|
68
|
+
pts: entry.pts
|
69
|
+
}
|
70
|
+
end
|
71
|
+
end
|
72
|
+
standings << { name: group.name, standings: entries }
|
73
|
+
end
|
74
|
+
|
75
|
+
hash_standings = {
|
76
|
+
name: event.name,
|
77
|
+
groups: standings
|
78
|
+
}
|
79
|
+
|
80
|
+
pp hash_standings
|
81
|
+
|
82
|
+
|
83
|
+
groups = []
|
84
|
+
event.groups.each do |group|
|
85
|
+
teams = []
|
86
|
+
group.teams.each do |team|
|
87
|
+
teams << { name: team.name,
|
88
|
+
code: team.code
|
89
|
+
}
|
90
|
+
end
|
91
|
+
groups << { name: group.name, teams: teams }
|
92
|
+
end
|
93
|
+
|
94
|
+
hash_groups = {
|
95
|
+
name: event.name,
|
96
|
+
groups: groups
|
97
|
+
}
|
98
|
+
|
99
|
+
pp hash_groups
|
100
|
+
|
101
|
+
|
102
|
+
rounds = []
|
103
|
+
event.rounds.each do |round|
|
104
|
+
matches = []
|
105
|
+
round.matches.each do |game|
|
106
|
+
m = { num: game.pos, ## use id - why? why not?
|
107
|
+
date: game.date.strftime( '%Y-%m-%d'),
|
108
|
+
time: game.time, ## note: time is stored as string!!!
|
109
|
+
team1: {
|
110
|
+
name: game.team1.name,
|
111
|
+
code: game.team1.code
|
112
|
+
},
|
113
|
+
team2: {
|
114
|
+
name: game.team2.name,
|
115
|
+
code: game.team2.code
|
116
|
+
},
|
117
|
+
}
|
118
|
+
|
119
|
+
score = {}
|
120
|
+
|
121
|
+
if game.score1
|
122
|
+
score[:ft] = [game.score1,
|
123
|
+
game.score2]
|
124
|
+
if game.score1i
|
125
|
+
# half time / first third (opt)
|
126
|
+
# half time - team 2
|
127
|
+
score[:ht] = [game.score1i,
|
128
|
+
game.score2i]
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
## note: change do NOT check for knockout flag
|
133
|
+
## check for scores for now
|
134
|
+
if game.score1et
|
135
|
+
# extratime - team 1 (opt)
|
136
|
+
# extratime - team 2 (opt)
|
137
|
+
score[:et] = [game.score1et,
|
138
|
+
game.score2et]
|
139
|
+
if game.score1p
|
140
|
+
# penalty - team 1 (opt)
|
141
|
+
# penalty - team 2 (opt) elfmeter (opt)
|
142
|
+
score[:p] = [game.score1p,
|
143
|
+
game.score2p
|
144
|
+
]
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
m[:score] = score
|
149
|
+
|
150
|
+
# m[ :knockout ] = game.knockout
|
151
|
+
|
152
|
+
|
153
|
+
unless game.goals.empty?
|
154
|
+
goals1, goals2 = build_goals( game )
|
155
|
+
m[ :goals1 ] = goals1
|
156
|
+
m[ :goals2 ] = goals2
|
157
|
+
end
|
158
|
+
|
159
|
+
if game.group
|
160
|
+
m[ :group ] = game.group.name
|
161
|
+
end
|
162
|
+
|
163
|
+
if game.ground
|
164
|
+
m[ :stadium ] = { key: game.ground.key, name: game.ground.name }
|
165
|
+
m[ :city ] = game.ground.city.name
|
166
|
+
m[ :timezone ] = 'UTC+1' ## use summertime (CEST+2) why? why not?
|
167
|
+
end
|
168
|
+
|
169
|
+
matches << m
|
170
|
+
end
|
171
|
+
|
172
|
+
rounds << { name: round.name, matches: matches }
|
173
|
+
end
|
174
|
+
|
175
|
+
hash_matches = {
|
176
|
+
name: event.name,
|
177
|
+
rounds: rounds
|
178
|
+
}
|
179
|
+
|
180
|
+
pp hash_matches
|
181
|
+
|
182
|
+
|
183
|
+
## build path e.g.
|
184
|
+
## 2014-15/at.1.clubs.json
|
185
|
+
## 2018/worldcup.teams.json
|
186
|
+
|
187
|
+
## -- check for remapping (e.g. add .1); if not found use league key as is
|
188
|
+
league_basename = event.league.key
|
189
|
+
|
190
|
+
season_basename = event.season.name.sub('/', '-') ## e.g. change 2014/15 to 2014-15
|
191
|
+
|
192
|
+
|
193
|
+
out_dir = "#{out_root}/#{season_basename}"
|
194
|
+
## make sure folders exist
|
195
|
+
FileUtils.mkdir_p( out_dir ) unless Dir.exist?( out_dir )
|
196
|
+
|
197
|
+
File.open( "#{out_dir}/#{league_basename}.stadiums.json", 'w' ) do |f|
|
198
|
+
f.write JSON.pretty_generate( hash_grounds )
|
199
|
+
end
|
200
|
+
|
201
|
+
File.open( "#{out_dir}/#{league_basename}.teams.json", 'w' ) do |f|
|
202
|
+
f.write JSON.pretty_generate( hash_teams )
|
203
|
+
end
|
204
|
+
|
205
|
+
File.open( "#{out_dir}/#{league_basename}.groups.json", 'w' ) do |f|
|
206
|
+
f.write JSON.pretty_generate( hash_groups )
|
207
|
+
end
|
208
|
+
|
209
|
+
File.open( "#{out_dir}/#{league_basename}.standings.json", 'w' ) do |f|
|
210
|
+
f.write JSON.pretty_generate( hash_standings )
|
211
|
+
end
|
212
|
+
|
213
|
+
File.open( "#{out_dir}/#{league_basename}.json", 'w' ) do |f|
|
214
|
+
f.write JSON.pretty_generate( hash_matches )
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
end # class Json Exporter
|
220
|
+
end # module SportDb
|
@@ -222,7 +222,7 @@ def self.export_worldcup( league_key, out_root: )
|
|
222
222
|
|
223
223
|
out_dir = "#{out_root}/#{season_basename}"
|
224
224
|
## make sure folders exist
|
225
|
-
FileUtils.mkdir_p( out_dir ) unless Dir.
|
225
|
+
FileUtils.mkdir_p( out_dir ) unless Dir.exist?( out_dir )
|
226
226
|
|
227
227
|
File.open( "#{out_dir}/#{league_basename}.stadiums.json", 'w' ) do |f|
|
228
228
|
f.write JSON.pretty_generate( hash_grounds )
|
@@ -1,11 +1,11 @@
|
|
1
1
|
|
2
2
|
module SportDb
|
3
|
-
|
4
|
-
|
3
|
+
module Module
|
4
|
+
module Exporters
|
5
5
|
|
6
6
|
MAJOR = 0 ## todo: namespace inside version or something - why? why not??
|
7
|
-
MINOR =
|
8
|
-
PATCH =
|
7
|
+
MINOR = 1
|
8
|
+
PATCH = 0
|
9
9
|
VERSION = [MAJOR,MINOR,PATCH].join('.')
|
10
10
|
|
11
11
|
def self.version
|
@@ -13,13 +13,13 @@ module SportDb
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.banner
|
16
|
-
"sportdb-exporters/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
|
16
|
+
"sportdb-exporters/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.root
|
20
20
|
File.expand_path( File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) )
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
end # module Exporters
|
24
|
+
end # module Module
|
25
|
+
end # module SportDb
|
data/lib/sportdb/exporters.rb
CHANGED
@@ -1,12 +1,16 @@
|
|
1
|
-
require 'sportdb/catalogs'
|
1
|
+
require 'sportdb/catalogs' ## catalogs gem needed - why ???
|
2
2
|
require 'sportdb/models'
|
3
3
|
|
4
4
|
|
5
|
+
|
5
6
|
###
|
6
7
|
# our own code
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
require_relative 'exporters/version'
|
9
|
+
require_relative 'exporters/json_exporter'
|
10
|
+
|
11
|
+
require_relative 'exporters/json_exporter_worldcup' ## for worldcup
|
12
|
+
require_relative 'exporters/json_exporter_euro' ## quick hack for euro
|
13
|
+
require_relative 'exporters/json_exporter_copa'
|
10
14
|
|
11
15
|
|
12
16
|
|
metadata
CHANGED
@@ -1,46 +1,52 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportdb-exporters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '7'
|
20
23
|
type: :development
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '4.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '7'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: hoe
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
39
|
+
version: '4.1'
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
44
|
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
46
|
+
version: '4.1'
|
41
47
|
description: sportdb-exporters - export helpers for sport.db data in various formats
|
42
48
|
incl. json, csv, and friends
|
43
|
-
email:
|
49
|
+
email: gerald.bauer@gmail.com
|
44
50
|
executables: []
|
45
51
|
extensions: []
|
46
52
|
extra_rdoc_files:
|
@@ -54,13 +60,15 @@ files:
|
|
54
60
|
- Rakefile
|
55
61
|
- lib/sportdb/exporters.rb
|
56
62
|
- lib/sportdb/exporters/json_exporter.rb
|
57
|
-
- lib/sportdb/exporters/
|
63
|
+
- lib/sportdb/exporters/json_exporter_copa.rb
|
64
|
+
- lib/sportdb/exporters/json_exporter_euro.rb
|
65
|
+
- lib/sportdb/exporters/json_exporter_worldcup.rb
|
58
66
|
- lib/sportdb/exporters/version.rb
|
59
67
|
homepage: https://github.com/sportdb/sport.db
|
60
68
|
licenses:
|
61
69
|
- Public Domain
|
62
70
|
metadata: {}
|
63
|
-
post_install_message:
|
71
|
+
post_install_message:
|
64
72
|
rdoc_options:
|
65
73
|
- "--main"
|
66
74
|
- README.md
|
@@ -77,9 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
85
|
- !ruby/object:Gem::Version
|
78
86
|
version: '0'
|
79
87
|
requirements: []
|
80
|
-
|
81
|
-
|
82
|
-
signing_key:
|
88
|
+
rubygems_version: 3.4.10
|
89
|
+
signing_key:
|
83
90
|
specification_version: 4
|
84
91
|
summary: sportdb-exporters - export helpers for sport.db data in various formats incl.
|
85
92
|
json, csv, and friends
|