sportdb-quick 0.5.2 → 0.5.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/lib/sportdb/quick/match_parser.rb +66 -13
- data/lib/sportdb/quick/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: 3d63bcffa581bc99cdc5dfaa7d80dd7dd8925dac90da349c43c6fdc5069e2c78
|
4
|
+
data.tar.gz: 1914dd71b5c39a2bea1eb58eca6126d31446a001ec0534656b943a865dc4a99b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9ce783a2f8c21d49a6571b86310fe023578aa7604d39672b7b8a4468d708bbd0c9104522cf2632f38765043ef06707a2a39c33cb53146072ed17f86879b3ef7
|
7
|
+
data.tar.gz: 309f14ee3e37133d8d53d4c51f86e2ebecbe974a3489ce9571f840e9d6ab521956abc5adc6e4e6301e3267daccf3a61711bc0d4d13c129450044fdfa33ce15e3
|
data/CHANGELOG.md
CHANGED
@@ -76,7 +76,14 @@ class MatchParser ## simple match parser for team match schedules
|
|
76
76
|
## _read_lines( lines ) : lines
|
77
77
|
|
78
78
|
@txt = _prep_lines( lines )
|
79
|
+
|
80
|
+
### todo/fix - FIX/FIX
|
81
|
+
## check start year from first date
|
82
|
+
## for now (auot-)update - @start with every date that incl. a year!!!
|
79
83
|
@start = start
|
84
|
+
@last_year = nil
|
85
|
+
|
86
|
+
|
80
87
|
@errors = []
|
81
88
|
end
|
82
89
|
|
@@ -150,6 +157,8 @@ class MatchParser ## simple match parser for team match schedules
|
|
150
157
|
on_group_def( node )
|
151
158
|
elsif node.is_a? RaccMatchParser::GroupHeader
|
152
159
|
on_group_header( node )
|
160
|
+
elsif node.is_a? RaccMatchParser::RoundOutline
|
161
|
+
on_round_outline( node )
|
153
162
|
elsif node.is_a? RaccMatchParser::RoundHeader
|
154
163
|
on_round_header( node )
|
155
164
|
elsif node.is_a? RaccMatchParser::DateHeader
|
@@ -234,23 +243,31 @@ class MatchParser ## simple match parser for team match schedules
|
|
234
243
|
pp start
|
235
244
|
end
|
236
245
|
|
246
|
+
|
237
247
|
if y.nil? ## try to calculate year
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
248
|
+
if @last_year ## use new formula
|
249
|
+
y = @last_year
|
250
|
+
else ## fallback to "old" formula - FIX/FIX remove later
|
251
|
+
puts "[deprecated] WARN - do NOT use old year (date) auto-complete; add year to first date"
|
252
|
+
y = if m > start.month ||
|
253
|
+
(m == start.month && d >= start.day)
|
254
|
+
# assume same year as start_at event (e.g. 2013 for 2013/14 season)
|
255
|
+
start.year
|
256
|
+
else
|
257
|
+
# assume year+1 as start_at event (e.g. 2014 for 2013/14 season)
|
258
|
+
start.year+1
|
259
|
+
end
|
260
|
+
end
|
261
|
+
else
|
262
|
+
### note - reset @start to new date
|
263
|
+
## use @last_year
|
264
|
+
@last_year = y
|
246
265
|
end
|
247
266
|
|
248
267
|
|
249
|
-
|
250
268
|
Date.new( y,m,d ) ## y,m,d
|
251
269
|
end
|
252
270
|
|
253
|
-
|
254
271
|
def on_round_def( node )
|
255
272
|
logger.debug "on round def: >#{node}<"
|
256
273
|
|
@@ -316,15 +333,51 @@ class MatchParser ## simple match parser for team match schedules
|
|
316
333
|
end
|
317
334
|
|
318
335
|
|
336
|
+
|
337
|
+
|
338
|
+
def on_round_outline( node )
|
339
|
+
logger.debug "on round outline: >#{node}<"
|
340
|
+
|
341
|
+
## always reset dates - why? why not?
|
342
|
+
## note - needs last_date for year
|
343
|
+
## track last_year with extra variable
|
344
|
+
|
345
|
+
name = node.outline
|
346
|
+
|
347
|
+
round = @rounds[ name ]
|
348
|
+
if round.nil? ## auto-add / create if missing
|
349
|
+
## todo/check: add num (was pos) if present - why? why not?
|
350
|
+
round = Import::Round.new( name: name )
|
351
|
+
@rounds[ name ] = round
|
352
|
+
end
|
353
|
+
|
354
|
+
## todo/check: if pos match (MUST always match for now)
|
355
|
+
@last_round = round
|
356
|
+
@last_group = nil # note: reset group to no group - why? why not?
|
357
|
+
|
358
|
+
## todo/fix/check
|
359
|
+
## make round a scope for date(time) - why? why not?
|
360
|
+
## reset date/time e.g. @last_date = nil !!!!
|
361
|
+
end
|
362
|
+
|
363
|
+
|
319
364
|
def on_round_header( node )
|
320
365
|
logger.debug "on round header: >#{node}<"
|
321
366
|
|
322
|
-
|
323
|
-
|
367
|
+
### note - auto-add names with - for now (use comma)
|
368
|
+
## why? why not?
|
369
|
+
### check - use ' - ' for separator - why? why not?
|
370
|
+
name = node.names.join( ', ' )
|
371
|
+
=begin
|
372
|
+
## note: was node.names[0] ## ignore more names for now
|
373
|
+
## fix later - fix more names!!!
|
374
|
+
=end
|
324
375
|
|
325
|
-
|
376
|
+
# name = name.sub( ROUND_EXTRA_WORDS_RE, '' )
|
326
377
|
# name = name.strip
|
327
378
|
|
379
|
+
|
380
|
+
|
328
381
|
round = @rounds[ name ]
|
329
382
|
if round.nil? ## auto-add / create if missing
|
330
383
|
## todo/check: add num (was pos) if present - why? why not?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportdb-quick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.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-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sportdb-parser
|