fbtxt 0.2.0 → 0.2.1
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/README.md +2 -2
- data/Rakefile +3 -3
- data/bin/fbgen +26 -13
- data/bin/fbtxt +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a76538d1d6b8835e9903171b051d60da5754d77be9b018ba3a8fe47f044c441a
|
4
|
+
data.tar.gz: 143ea8dbdb8ae7012b933a4e67b1a630140b291852b479afcdae4411d9252103
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92cda04ad0eaf29146d1fa8f2a517d1e002ec9ae56b6988368ada89a4de184912db07d7d71310b770023b2bca27349a12e4417af6ed642c77710e4862218a5b3
|
7
|
+
data.tar.gz: ce76ab844076d43ae0ae2c367d53a01a8050745fb31a1afd9906548fe3723fb2e807aeaf414a73844386e8e619cd77018c26f35f5d6374ffa963a45032e69a23
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# fbtxt - convert football match schedules & more in tabular comma-separated values (csv) format to (future-proof & evergreen) football.txt
|
2
2
|
|
3
3
|
|
4
|
-
* home :: [github.com/sportdb/
|
5
|
-
* bugs :: [github.com/sportdb/
|
4
|
+
* home :: [github.com/sportdb/footty](https://github.com/sportdb/footty)
|
5
|
+
* bugs :: [github.com/sportdb/footty/issues](https://github.com/sportdb/footty/issues)
|
6
6
|
* gem :: [rubygems.org/gems/fbtxt](https://rubygems.org/gems/fbtxt)
|
7
7
|
* rdoc :: [rubydoc.info/gems/fbtxt](http://rubydoc.info/gems/fbtxt)
|
8
8
|
|
data/Rakefile
CHANGED
@@ -2,12 +2,12 @@ require 'hoe'
|
|
2
2
|
|
3
3
|
|
4
4
|
Hoe.spec 'fbtxt' do
|
5
|
-
self.version = '0.2.
|
5
|
+
self.version = '0.2.1'
|
6
6
|
|
7
7
|
self.summary = "fbtxt - convert football match schedules & more in tabular comma-separated values (csv) format to (future-proof & evergreen) football.txt"
|
8
8
|
self.description = summary
|
9
9
|
|
10
|
-
self.urls = { home: 'https://github.com/sportdb/
|
10
|
+
self.urls = { home: 'https://github.com/sportdb/footty' }
|
11
11
|
|
12
12
|
self.author = 'Gerald Bauer'
|
13
13
|
self.email = 'gerald.bauer@gmail.com'
|
@@ -20,7 +20,7 @@ Hoe.spec 'fbtxt' do
|
|
20
20
|
|
21
21
|
self.extra_deps = [
|
22
22
|
['sportdb-writers', '>= 0.4.1'],
|
23
|
-
['
|
23
|
+
['leagues', '>= 0.1.1'],
|
24
24
|
]
|
25
25
|
|
26
26
|
self.spec_extras = {
|
data/bin/fbgen
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
require 'sportdb/writers'
|
8
|
-
require '
|
8
|
+
require 'leagues'
|
9
9
|
|
10
10
|
|
11
11
|
require 'optparse' ## check if included in cocos prelude?
|
@@ -67,10 +67,20 @@ puts "ARGV:"
|
|
67
67
|
p args
|
68
68
|
|
69
69
|
|
70
|
+
### get latest season with autofiller
|
71
|
+
## todo use new LeaguesetAutofiller class - why? why not?
|
72
|
+
## or move code of autofiller here - why? why not?
|
73
|
+
##
|
74
|
+
## share with fbup ???
|
75
|
+
autofiller = ->(league_query) {
|
76
|
+
Leagueset.autofiller( league_query, source_path: source_path )
|
77
|
+
}
|
78
|
+
|
79
|
+
|
70
80
|
datasets = if opts[:file]
|
71
|
-
read_leagueset( opts[:file] )
|
81
|
+
read_leagueset( opts[:file], autofill: autofiller )
|
72
82
|
else
|
73
|
-
parse_leagueset_args( args )
|
83
|
+
parse_leagueset_args( args, autofill: autofiller )
|
74
84
|
end
|
75
85
|
|
76
86
|
puts "datasets:"
|
@@ -87,14 +97,19 @@ datasets.validate!( source_path: source_path )
|
|
87
97
|
|
88
98
|
|
89
99
|
## step 1 - generate
|
90
|
-
datasets.each do |
|
91
|
-
puts "==> gen #{
|
92
|
-
|
93
|
-
league_info = find_league_info( league_key )
|
94
|
-
pp league_info
|
100
|
+
datasets.each do |league_query, seasons|
|
101
|
+
puts "==> gen #{league_query} - #{seasons.size} seasons(s)..."
|
95
102
|
|
96
103
|
seasons.each do |season|
|
97
|
-
|
104
|
+
## todo/fix - use find_by! - add upstream
|
105
|
+
league_info = LeagueCodes.find_by( code: league_query, season: season )
|
106
|
+
pp league_info
|
107
|
+
|
108
|
+
league_code = league_info['code']
|
109
|
+
league_name = league_info['name']
|
110
|
+
|
111
|
+
|
112
|
+
filename = "#{season.to_path}/#{league_code}.csv"
|
98
113
|
path = find_file( filename, path: source_path )
|
99
114
|
|
100
115
|
## get matches
|
@@ -103,17 +118,15 @@ datasets.each do |league_key, seasons|
|
|
103
118
|
puts " #{matches.size} matches"
|
104
119
|
|
105
120
|
## build
|
106
|
-
txt = SportDb::TxtMatchWriter.
|
121
|
+
txt = SportDb::TxtMatchWriter.build_v2( matches )
|
107
122
|
puts txt if opts[:debug]
|
108
123
|
|
109
|
-
league_name = league_info[ :name ] # e.g. Brasileiro Série A
|
110
|
-
league_name = league_name.call( season ) if league_name.is_a?( Proc ) ## is proc/func - name depends on season
|
111
124
|
|
112
125
|
buf = String.new
|
113
126
|
buf << "= #{league_name} #{season}\n\n"
|
114
127
|
buf << txt
|
115
128
|
|
116
|
-
outpath = "#{root_dir}/foot/#{season.to_path}/#{
|
129
|
+
outpath = "#{root_dir}/foot/#{season.to_path}/#{league_code}.txt"
|
117
130
|
|
118
131
|
if opts[:dry]
|
119
132
|
puts " (dry) writing to >#{outpath}<..."
|
data/bin/fbtxt
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
# $LOAD_PATH.unshift( '../../../sportdb/sport.db/quick/lib' )
|
14
14
|
|
15
15
|
require 'sportdb/writers'
|
16
|
-
require '
|
16
|
+
require 'leagues'
|
17
17
|
|
18
18
|
|
19
19
|
require 'optparse' ## check if included in cocos prelude?
|
@@ -48,7 +48,7 @@ end
|
|
48
48
|
puts "#{matches.size} matches"
|
49
49
|
puts
|
50
50
|
|
51
|
-
txt = SportDb::TxtMatchWriter.
|
51
|
+
txt = SportDb::TxtMatchWriter.build_v2( matches )
|
52
52
|
puts txt
|
53
53
|
puts
|
54
54
|
puts "bye"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fbtxt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.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:
|
11
|
+
date: 2025-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sportdb-writers
|
@@ -25,19 +25,19 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.4.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: leagues
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.1.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.1.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rdoc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ files:
|
|
90
90
|
- Rakefile
|
91
91
|
- bin/fbgen
|
92
92
|
- bin/fbtxt
|
93
|
-
homepage: https://github.com/sportdb/
|
93
|
+
homepage: https://github.com/sportdb/footty
|
94
94
|
licenses:
|
95
95
|
- Public Domain
|
96
96
|
metadata: {}
|