sportdb-formats 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/bin/fbchk +9 -2
- data/lib/sportdb/formats/quick_match_linter.rb +11 -5
- data/lib/sportdb/formats/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2504c391e84f0f27c476d3cd355dedcaf594c1d8d11f0769590b8be904b0a8b0
|
4
|
+
data.tar.gz: a16b1d8b7f7ee50efd9b88d50beafd66bce70c8c2d632969208f0b8b2a48d777
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb5e968e9c148c1e11434ec33a7c8909fff8bcd45ee8d39eafb6005a678cfee766390178d2d70d68bc0b164c1e0a691759dc663eb962c902032c206ea778d0c5
|
7
|
+
data.tar.gz: 58ff1d22a5af74b3831afb119a47011c572ef23b87c1e5b6e7399d75d68c6f5286919d8402dd0503f87a9c2da1f6fc81ad9524e9c10e3e18c2e4207ecbe92ac3
|
data/CHANGELOG.md
CHANGED
data/bin/fbchk
CHANGED
@@ -23,6 +23,7 @@ end
|
|
23
23
|
args = ARGV
|
24
24
|
opts = { debug: false,
|
25
25
|
file: nil,
|
26
|
+
teams: true, ## check/lint teams (name errros etc.)
|
26
27
|
}
|
27
28
|
|
28
29
|
parser = OptionParser.new do |parser|
|
@@ -45,10 +46,14 @@ end
|
|
45
46
|
opts[:file] = file
|
46
47
|
end
|
47
48
|
|
48
|
-
|
49
|
+
parser.on( "--[no]-teams",
|
50
|
+
"turn on/off team name checks (default: #{opts[:teams]})") do |teams|
|
51
|
+
opts[:teams] = teams
|
52
|
+
end
|
49
53
|
end
|
50
54
|
parser.parse!( args )
|
51
55
|
|
56
|
+
|
52
57
|
puts "OPTS:"
|
53
58
|
p opts
|
54
59
|
puts "ARGV:"
|
@@ -95,9 +100,11 @@ end
|
|
95
100
|
errors = []
|
96
101
|
paths.each_with_index do |path,j|
|
97
102
|
puts "==> [#{j+1}/#{paths.size}] reading >#{path}<..."
|
98
|
-
quick = SportDb::QuickMatchLinter.new( read_text( path )
|
103
|
+
quick = SportDb::QuickMatchLinter.new( read_text( path ),
|
104
|
+
check_teams: opts[:teams] )
|
99
105
|
matches = quick.parse
|
100
106
|
|
107
|
+
|
101
108
|
if quick.errors?
|
102
109
|
puts "!! #{quick.errors.size} error(s):"
|
103
110
|
pp quick.errors
|
@@ -23,11 +23,17 @@ class QuickMatchLinter
|
|
23
23
|
|
24
24
|
include Logging
|
25
25
|
|
26
|
-
def initialize( txt
|
26
|
+
def initialize( txt,
|
27
|
+
check_teams: true )
|
27
28
|
@errors = []
|
28
29
|
@txt = txt
|
30
|
+
@check_teams = check_teams
|
29
31
|
end
|
30
32
|
|
33
|
+
def check_teams?() @check_teams; end
|
34
|
+
|
35
|
+
|
36
|
+
|
31
37
|
attr_reader :errors
|
32
38
|
def errors?() @errors.size > 0; end
|
33
39
|
|
@@ -70,7 +76,8 @@ class QuickMatchLinter
|
|
70
76
|
###
|
71
77
|
## db check - check league
|
72
78
|
## fix/fix - add season to match_by !!!!!!!
|
73
|
-
|
79
|
+
## note - changed to match (incl. code) from match_by(name:) only!!!
|
80
|
+
recs = Import::League.match( league )
|
74
81
|
league_rec = nil
|
75
82
|
if recs.size == 1
|
76
83
|
league_rec = recs[0]
|
@@ -111,6 +118,7 @@ class QuickMatchLinter
|
|
111
118
|
## only clubs for now
|
112
119
|
## fix add better support for champs etc
|
113
120
|
## and national teams!!!
|
121
|
+
if check_teams?
|
114
122
|
auto_conf_teams.each do |team|
|
115
123
|
recs = if league_rec && !league_rec.intl?
|
116
124
|
Import::Club.match_by( name: team, league: league_rec )
|
@@ -150,9 +158,7 @@ class QuickMatchLinter
|
|
150
158
|
puts "!! #{msg}"
|
151
159
|
end
|
152
160
|
end
|
153
|
-
|
154
|
-
|
155
|
-
|
161
|
+
end
|
156
162
|
|
157
163
|
|
158
164
|
## note: pass along stage (if present): stage - optional from heading!!!!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportdb-formats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09
|
11
|
+
date: 2024-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sportdb-search
|