fbtok 0.3.3 → 0.3.4
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/lib/fbtok/opts.rb +20 -6
- 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: f1d30fb729e926e1745a62c927272839f8be9b6578b92a6d4aa6415872c49164
|
4
|
+
data.tar.gz: 9eb174553656a9394993c554969600262807f8210dd1b4d01a5b392431bf14f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fadde8d521bf4dc46f20650789b1b9de1e8ffe68289bd499ea5d0807e8911bfe7a424a082dfcc599c8e7e97dce63b30ed9962d93cba4cf6b4d5ee3e4f8703bf
|
7
|
+
data.tar.gz: 197a3385174d42bab7045a8d3e64844f85d131da66d51973cfca71cd2176e88baa2831b40a9d1cfe31b8f13352971576f5427b02575c8b2a12d7f38d81fc3ce9
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
data/lib/fbtok/opts.rb
CHANGED
@@ -12,8 +12,10 @@ class Opts
|
|
12
12
|
|
13
13
|
|
14
14
|
SEASON_RE = %r{ (?:
|
15
|
-
|
16
|
-
|
15
|
+
(?<season>\d{4}-\d{2})
|
16
|
+
|
|
17
|
+
(?<season>\d{4})
|
18
|
+
(?: --[a-z0-9_-]+ )? ## todo/fix - allow "extension" to 2024-25 too - why?
|
17
19
|
)
|
18
20
|
}x
|
19
21
|
SEASON = SEASON_RE.source ## "inline" helper for embedding in other regexes - keep? why? why not?
|
@@ -34,9 +36,9 @@ class Opts
|
|
34
36
|
|
|
35
37
|
(?: ## "compact" variant ii) with season in filename
|
36
38
|
(?: ^|/ ) # beginning (^) or beginning of path (/)
|
37
|
-
(?:
|
39
|
+
(?: (?<season>\d{4}-\d{2})
|
38
40
|
|
|
39
|
-
|
41
|
+
(?<season>\d{4})
|
40
42
|
)
|
41
43
|
_ ## allow more than one underscore - why? why not?
|
42
44
|
[a-z0-9][a-z0-9_.-]*\.txt$
|
@@ -47,7 +49,7 @@ class Opts
|
|
47
49
|
## but starting filename e.g. 2024_friendlies.txt or 2024-25_bundesliga.txt
|
48
50
|
|
49
51
|
|
50
|
-
def self._find( path )
|
52
|
+
def self._find( path, seasons: nil )
|
51
53
|
## check - rename dir
|
52
54
|
## use root_dir or work_dir or cd or such - why? why not?
|
53
55
|
|
@@ -58,6 +60,11 @@ def self._find( path )
|
|
58
60
|
## path = path.gsub( "\\", '/' )
|
59
61
|
path = File.expand_path( path )
|
60
62
|
|
63
|
+
if seasons && seasons.size > 0
|
64
|
+
## norm seasons
|
65
|
+
seasons = seasons.map {|season| Season(season) }
|
66
|
+
end
|
67
|
+
|
61
68
|
|
62
69
|
## check all txt files
|
63
70
|
## note: incl. files starting with dot (.)) as candidates
|
@@ -65,7 +72,14 @@ def self._find( path )
|
|
65
72
|
candidates = Dir.glob( "#{path}/**/{*,.*}.txt" )
|
66
73
|
## pp candidates
|
67
74
|
candidates.each do |candidate|
|
68
|
-
|
75
|
+
if m=MATCH_RE.match( candidate )
|
76
|
+
if seasons && seasons.size > 0 ## check for seasons filter
|
77
|
+
season = Season.parse(m[:season])
|
78
|
+
datafiles << candidate if seasons.include?( season )
|
79
|
+
else
|
80
|
+
datafiles << candidate
|
81
|
+
end
|
82
|
+
end
|
69
83
|
end
|
70
84
|
|
71
85
|
## pp datafiles
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fbtok
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
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-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sportdb-parser
|