worldfootball 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Manifest.txt +1 -0
- data/Rakefile +1 -1
- data/bin/wfb +13 -11
- data/bin/wfbconv +1 -1
- data/bin/wfbgen +1 -1
- data/bin/wfbsync +10 -10
- data/bin/wfbup +1 -1
- data/config/leagues/world.csv +6 -0
- data/config/rounds.csv +9 -7
- data/lib/worldfootball/build.rb +3 -2
- data/lib/worldfootball/convert.rb +1 -0
- data/lib/worldfootball/leagues.rb +2 -2
- data/lib/worldfootball/version.rb +1 -1
- data/lib/worldfootball.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75755982ccfac637d1757b6163be5e03e9af9f6f024ce567ea4137cb64f5eeea
|
4
|
+
data.tar.gz: bd5214b9225b1563d395ab2363a26e21cefadb996c65523e1ce51b647d346fab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e70b232fc8b5275042174d9576b6c3bf57bfb680470667e5cf7af8c77cfd6160c9a1d1ea0a372bb67673cb8210e035314ebe93108ea974ceb496c44cb1d4e8f
|
7
|
+
data.tar.gz: 920bc2041c52cca8445ef4be90d6b4432d4fa1a6518babb0e19e47be6dc7daf4d856fdf709f9dbddfd2614467f300472a726e556767509d59b3db6ebbc93ae85
|
data/CHANGELOG.md
CHANGED
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
data/bin/wfb
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
## ruby -I wfb/lib wfb/bin/wfb -f max.csv --cached
|
9
9
|
|
10
10
|
|
11
|
-
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/
|
11
|
+
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/leagues/lib' )
|
12
12
|
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/fifa/lib' )
|
13
13
|
require 'worldfootball'
|
14
14
|
|
@@ -134,13 +134,23 @@ end
|
|
134
134
|
####
|
135
135
|
# assume leagues
|
136
136
|
|
137
|
+
autofiller = ->(league_query) {
|
138
|
+
league = find_league!( league_query ) ## league info lookup
|
139
|
+
## note - default to latest season of league
|
140
|
+
## might be 2024/25 or 2024 or
|
141
|
+
# for world cup 2022 or such
|
142
|
+
league.seasons.keys[0] ## assume first entry is latest season
|
143
|
+
}
|
144
|
+
|
145
|
+
|
137
146
|
datasets = if opts[:file]
|
138
|
-
read_leagueset( opts[:file] )
|
147
|
+
read_leagueset( opts[:file], autofill: autofiller )
|
139
148
|
else
|
140
|
-
parse_leagueset_args( args )
|
149
|
+
parse_leagueset_args( args, autofill: autofiller )
|
141
150
|
end
|
142
151
|
|
143
152
|
|
153
|
+
|
144
154
|
## step 0 - validate and fill-up seasons etc.
|
145
155
|
datasets.each do |league_key, seasons|
|
146
156
|
|
@@ -149,14 +159,6 @@ datasets.each do |league_key, seasons|
|
|
149
159
|
## output more page meta info
|
150
160
|
puts "league meta:"
|
151
161
|
pp league
|
152
|
-
|
153
|
-
## note - default to latest season of league
|
154
|
-
## might be 2024/25 or 2024 or
|
155
|
-
# for world cup 2022 or such
|
156
|
-
if seasons.empty?
|
157
|
-
season = Season(league.seasons.keys[0])
|
158
|
-
seasons << season
|
159
|
-
end
|
160
162
|
end
|
161
163
|
|
162
164
|
|
data/bin/wfbconv
CHANGED
data/bin/wfbgen
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
|
12
12
|
|
13
|
-
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/
|
13
|
+
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/leagues/lib' )
|
14
14
|
$LOAD_PATH.unshift( '/sports/sportdb/sportdb-writers/lib' )
|
15
15
|
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/fifa/lib' )
|
16
16
|
|
data/bin/wfbsync
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
-
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/
|
21
|
+
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/leagues/lib' )
|
22
22
|
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/fifa/lib' )
|
23
23
|
require 'worldfootball'
|
24
24
|
|
@@ -98,8 +98,16 @@ end
|
|
98
98
|
####
|
99
99
|
# assume leagues
|
100
100
|
|
101
|
+
autofiller = ->(league_query) {
|
102
|
+
league = find_league!( league_query ) ## league info lookup
|
103
|
+
## note - default to latest season of league
|
104
|
+
## might be 2024/25 or 2024 or
|
105
|
+
# for world cup 2022 or such
|
106
|
+
league.seasons.keys[0] ## assume first entry is latest season
|
107
|
+
}
|
108
|
+
|
101
109
|
datasets = if opts[:file]
|
102
|
-
read_leagueset( opts[:file] )
|
110
|
+
read_leagueset( opts[:file], autofill: autofiller )
|
103
111
|
else
|
104
112
|
raise ArgumentError, "file required; sorry"
|
105
113
|
end
|
@@ -114,14 +122,6 @@ datasets.each do |league_key, seasons|
|
|
114
122
|
## output more page meta info
|
115
123
|
puts "league meta:"
|
116
124
|
pp league
|
117
|
-
|
118
|
-
## note - default to latest season of league
|
119
|
-
## might be 2024/25 or 2024 or
|
120
|
-
# for world cup 2022 or such
|
121
|
-
if seasons.empty?
|
122
|
-
season = Season(league.seasons.keys[0])
|
123
|
-
seasons << season
|
124
|
-
end
|
125
125
|
end
|
126
126
|
|
127
127
|
|
data/bin/wfbup
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
## - stopping at si.1 2017/18...
|
14
14
|
|
15
15
|
|
16
|
-
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/
|
16
|
+
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/leagues/lib' )
|
17
17
|
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/fifa/lib' )
|
18
18
|
require 'worldfootball'
|
19
19
|
|
data/config/rounds.csv
CHANGED
@@ -16,13 +16,15 @@ key, name1, name2
|
|
16
16
|
*, Halbfinale, Semifinals
|
17
17
|
*, Finale, Final
|
18
18
|
|
19
|
-
*, Spiel um Platz 6, Match 6th
|
20
|
-
*, Spiel um Platz
|
21
|
-
|
22
|
-
|
23
|
-
*,
|
24
|
-
*,
|
25
|
-
*,
|
19
|
+
*, Spiel um Platz 6, Match 6th place
|
20
|
+
*, Spiel um Platz 5, Match 5th place
|
21
|
+
*, Spiel um Platz 3, Match 3rd place ## use Match for 3rd place
|
22
|
+
|
23
|
+
*, 11. Platz, Match 11th place
|
24
|
+
*, 9. Platz, Match 9th place
|
25
|
+
*, 7. Platz, Match 7th place
|
26
|
+
*, 5. Platz, Match 5th place
|
27
|
+
*, 3. Platz, Match 3rd place
|
26
28
|
|
27
29
|
|
28
30
|
*, Vorrunde, Preliminary round
|
data/lib/worldfootball/build.rb
CHANGED
@@ -15,8 +15,9 @@ def self.build( rows, season:, league:, stage: '' ) ## rename to fixup or such
|
|
15
15
|
print " - #{stage}" unless stage.empty?
|
16
16
|
print "\n"
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
## fix - use find_by! - add upstream
|
19
|
+
league_info = LeagueCodes.find_by( code: league, season: season )
|
20
|
+
zone = league_info['tz']
|
20
21
|
|
21
22
|
|
22
23
|
## note: use only first part from key for lookup
|
@@ -134,14 +134,14 @@ end # class LeagueConfig
|
|
134
134
|
|
135
135
|
|
136
136
|
|
137
|
-
|
138
137
|
LEAGUES = LeagueConfig.new
|
139
138
|
['africa',
|
140
139
|
'america',
|
141
140
|
'asia',
|
142
141
|
'europe',
|
143
142
|
'middle_east',
|
144
|
-
'pacific'
|
143
|
+
'pacific',
|
144
|
+
'world'].each do |name|
|
145
145
|
recs = read_csv( "#{Worldfootball.root}/config/leagues/#{name}.csv" )
|
146
146
|
pp recs
|
147
147
|
puts " #{recs.size} league(s) in #{name}"
|
data/lib/worldfootball.rb
CHANGED
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: worldfootball
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: leagues
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- config/leagues/europe.csv
|
149
149
|
- config/leagues/middle_east.csv
|
150
150
|
- config/leagues/pacific.csv
|
151
|
+
- config/leagues/world.csv
|
151
152
|
- config/rounds.csv
|
152
153
|
- config/stages.csv
|
153
154
|
- lib/worldfootball.rb
|