fbup 0.1.2 → 0.2.0
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/Rakefile +1 -1
- data/bin/fbup +1 -1
- data/config/openfootball.csv +10 -5
- data/lib/fbup/github.rb +1 -1
- data/lib/fbup/main.rb +38 -17
- data/lib/fbup/version.rb +2 -2
- data/lib/fbup.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68ab9d496c98e7322a20c75e1b7b351bff26cb684aa15f0e7150879183e0d6a2
|
4
|
+
data.tar.gz: '08e0a215cd0007e324f01da26a78c615ba44ce889a3da48bc62def771c1b0c90'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9e1f3e2171f973847bab5f8b703da05fe94726b0be5b48510b9f04cd878baada565ef1345d163a1daa56f25195149592f67046c700ad6c96294118a52423a2a
|
7
|
+
data.tar.gz: 75d415e44856d90707a22ec178dc0c550a976ee450bb8eac64ffd938929a4927576659aad59a9d3facda7ccc3ecf8a0e05bffb7b789473b046ce2179df73a0d8
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
data/bin/fbup
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
## note - quick hack - auto-add local football timezones
|
10
|
-
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/
|
10
|
+
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/leagues/lib' )
|
11
11
|
$LOAD_PATH.unshift( '/sports/sportdb/sport.db/fifa/lib' )
|
12
12
|
require 'fbup'
|
13
13
|
|
data/config/openfootball.csv
CHANGED
@@ -14,7 +14,7 @@ key, path, flags
|
|
14
14
|
|
15
15
|
at, austria, classic
|
16
16
|
|
17
|
-
de,
|
17
|
+
de, deutschland, classic
|
18
18
|
eng, england, classic
|
19
19
|
es, espana, classic
|
20
20
|
it, italy, classic
|
@@ -114,7 +114,7 @@ copa.s, south-america/copa-libertadores,
|
|
114
114
|
|
115
115
|
|
116
116
|
###
|
117
|
-
# world repo
|
117
|
+
# /world repo
|
118
118
|
|
119
119
|
eg, world/africa/egypt,
|
120
120
|
ma, world/africa/morocco,
|
@@ -137,8 +137,6 @@ mls, world/north-america/major-league-soccer,
|
|
137
137
|
|
138
138
|
|
139
139
|
mx, world/north-america/mexico,
|
140
|
-
## todo/check - why mx config is not enough?
|
141
|
-
## mx.2.expansion, world/north-america/mexico
|
142
140
|
|
143
141
|
|
144
142
|
## fix/change concacaf.cl to concacaf.champs !!!
|
@@ -150,4 +148,11 @@ concacaf.champs, world/north-america/champions-league,
|
|
150
148
|
au, world/pacific/australia,
|
151
149
|
|
152
150
|
|
153
|
-
|
151
|
+
## use world.clubs or club ??
|
152
|
+
world.clubs, club-worldcup, classic ## use classic setup for now - why? why not?
|
153
|
+
world.club, club-worldcup, classic
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
world, worldcup, ## add custom flag - why? why not?
|
158
|
+
|
data/lib/fbup/github.rb
CHANGED
data/lib/fbup/main.rb
CHANGED
@@ -115,17 +115,27 @@ puts "ARGV:"
|
|
115
115
|
p args
|
116
116
|
|
117
117
|
|
118
|
+
|
119
|
+
source_path = opts[:source_path]
|
120
|
+
|
121
|
+
### get latest season with autofiller
|
122
|
+
## todo use new LeaguesetAutofiller class - why? why not?
|
123
|
+
## or move code of autofiller here - why? why not?
|
124
|
+
##
|
125
|
+
autofiller = ->(league_query) {
|
126
|
+
Leagueset.autofiller( league_query, source_path: source_path )
|
127
|
+
}
|
128
|
+
|
118
129
|
datasets = if opts[:file]
|
119
|
-
read_leagueset( opts[:file] )
|
130
|
+
read_leagueset( opts[:file], autofill: autofiller )
|
120
131
|
else
|
121
|
-
parse_leagueset_args( args )
|
132
|
+
parse_leagueset_args( args, autofill: autofiller )
|
122
133
|
end
|
123
134
|
|
124
135
|
puts "datasets:"
|
125
136
|
pp datasets
|
126
137
|
|
127
138
|
|
128
|
-
source_path = opts[:source_path]
|
129
139
|
|
130
140
|
root_dir = if opts[:test]
|
131
141
|
opts[:test_dir]
|
@@ -147,18 +157,34 @@ pp sync
|
|
147
157
|
|
148
158
|
sync.git_fast_forward_if_clean if opts[:ffwd]
|
149
159
|
|
160
|
+
|
150
161
|
### step 0 - validate and fill-in seasons etc.
|
151
162
|
datasets.validate!( source_path: source_path )
|
152
163
|
|
153
164
|
|
154
|
-
|
155
|
-
|
165
|
+
##
|
166
|
+
## note - use league_query (or league_qkey or _querykey) or such
|
167
|
+
## for user supplied key to compute/find the canoncial league code
|
168
|
+
|
169
|
+
datasets.each do |league_query, seasons|
|
170
|
+
puts "==> gen #{league_query} - #{seasons.size} seasons(s)..."
|
156
171
|
|
157
|
-
league_info = find_league_info( league_key )
|
158
|
-
pp league_info
|
159
172
|
|
160
173
|
seasons.each do |season|
|
161
|
-
|
174
|
+
## note - league info requires season
|
175
|
+
## PLUS use (canoncial) league code from info!!!
|
176
|
+
league_info = LeagueCodes.find_by( code: league_query, season: season )
|
177
|
+
pp league_info
|
178
|
+
|
179
|
+
league_code = league_info[ 'code' ]
|
180
|
+
league_name = league_info[ 'name' ] # e.g. Brasileiro Série A
|
181
|
+
|
182
|
+
### todo/fix - move basename out of league_info
|
183
|
+
### make it github/openfootball "legacy" code
|
184
|
+
basename = league_info[ 'basename' ] #.e.g 1-seriea
|
185
|
+
|
186
|
+
|
187
|
+
filename = "#{season.to_path}/#{league_code}.csv"
|
162
188
|
path = find_file( filename, path: source_path )
|
163
189
|
|
164
190
|
### get matches
|
@@ -168,7 +194,7 @@ datasets.each do |league_key, seasons|
|
|
168
194
|
|
169
195
|
|
170
196
|
## get repo config for flags and more
|
171
|
-
repo = GitHubSync::REPOS[
|
197
|
+
repo = GitHubSync::REPOS[ league_code ]
|
172
198
|
flags = repo['flags'] || {}
|
173
199
|
classic_flag = flags['classic'] || false
|
174
200
|
|
@@ -184,18 +210,13 @@ datasets.each do |league_key, seasons|
|
|
184
210
|
puts txt if opts[:debug]
|
185
211
|
|
186
212
|
|
187
|
-
|
188
|
-
basename = league_info[ :basename] #.e.g 1-seriea
|
189
|
-
|
190
|
-
league_name = league_name.call( season ) if league_name.is_a?( Proc ) ## is proc/func - name depends on season
|
191
|
-
basename = basename.call( season ) if basename.is_a?( Proc ) ## is proc/func - name depends on season
|
192
|
-
|
213
|
+
|
193
214
|
|
194
215
|
if classic_flag || opts[:classic]
|
195
216
|
## do nothing
|
196
217
|
else
|
197
218
|
## add quick fix for new league name overwrites
|
198
|
-
league_name = LEAGUE_NAMES_V2[
|
219
|
+
league_name = LEAGUE_NAMES_V2[league_code] || league_name
|
199
220
|
end
|
200
221
|
|
201
222
|
|
@@ -218,7 +239,7 @@ datasets.each do |league_key, seasons|
|
|
218
239
|
## change base name to league key
|
219
240
|
## todo - fix - make gsub smarter
|
220
241
|
## change at.cup to at_cup - why? why not?
|
221
|
-
basename =
|
242
|
+
basename = league_code.gsub( '.', '' )
|
222
243
|
"/#{season.to_path}_#{basename}.txt"
|
223
244
|
end
|
224
245
|
|
data/lib/fbup/version.rb
CHANGED
data/lib/fbup.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fbup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
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
14
|
name: gitti
|
@@ -39,19 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.4.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: leagues
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.1.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.1.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rdoc
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|