fbtok 0.5.3 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cd5c4d072690acf0846ea8a6c0d34af8857073debf4c8c2d5a5688d92133038
4
- data.tar.gz: 0ea211c29fbc8dcb0305368da6ae654c35404e498b1816d8507695e9a9a0e9e2
3
+ metadata.gz: 79b90fe564aceafc6c304dda555d29602c54cd6a5dc0973d929948f342a34ad2
4
+ data.tar.gz: 32d96ae47f2d9341a28ab52397122dd7d45839689f05211b397c8233c8d879ff
5
5
  SHA512:
6
- metadata.gz: 8c164cb1b0ab93492b055b20f9864ef2dfd0fbd3197bfe658c2a29b68df7cfd0fe06a5f8c4867b8e6e39826972190998385fd691178d2a502122f2b2f13d7cbf
7
- data.tar.gz: e649301128cd231e73ddcd815b32359a658233fb334413f38c083bcf2c54f8b62836f9187abb8cfced19318588737128218fdcf0f46e92ff14728f20ce24df5c
6
+ metadata.gz: da06e09e80a97753369af5cf1abecc7af1576e5a02d7ad69866c060c724f94ed9f35c2d7022759c3ccc4f34275fba7fffde27cdd6a79976f73550ca359556a77
7
+ data.tar.gz: c951cbd72bb32e608e2bfb19ddf45498a9858305ec886062963d7b7517532a55c1d079650097ea1b2e7a96cba99b0f8ffc3177af6682fe09966feb76490a9f5e
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 0.5.3
1
+ ### 0.9.0
2
2
  ### 0.0.1 / 2025-01-02
3
3
 
4
4
  * Everything is new. First release.
data/README.md CHANGED
@@ -22,7 +22,7 @@ $ gem install fbtok
22
22
 
23
23
  ### fbtok & fbtree - use tokenizer (lexer) & parser
24
24
 
25
- - depends on sportdb-parser
25
+ - depends on fbtxt-parser
26
26
 
27
27
  get help
28
28
 
@@ -54,7 +54,7 @@ $ fbtree worldcup
54
54
 
55
55
  ### fbquick/fbquik & fbx - use quick match reader & dump match schedule
56
56
 
57
- - depends on sportdb-quick (& sportdb-parser)
57
+ - depends on fbtxt-document (& fbtxt-parser)
58
58
 
59
59
  get help
60
60
 
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'hoe'
2
2
 
3
3
 
4
4
  Hoe.spec 'fbtok' do
5
- self.version = '0.5.3'
5
+ self.version = '0.9.0'
6
6
 
7
7
  self.summary = "fbtok - football.txt lint tools incl. tokenizer, parser & more"
8
8
  self.description = summary
@@ -19,8 +19,8 @@ Hoe.spec 'fbtok' do
19
19
  self.licenses = ['Public Domain']
20
20
 
21
21
  self.extra_deps = [
22
- ['sportdb-parser', '>= 0.7.2'],
23
- ['sportdb-quick', '>= 0.7.0'],
22
+ ['fbtxt-parser', '>= 0.9.0'],
23
+ ['fbtxt-document', '>= 0.9.0'],
24
24
  ]
25
25
 
26
26
  self.spec_extras = {
data/bin/fbquick CHANGED
@@ -5,13 +5,13 @@
5
5
  ## -or-
6
6
  ## $ ruby -I ../parser/lib -I ./lib bin/fbquick
7
7
  ## -or-
8
- ## $ ruby -I ../parser/lib -I ../quick/lib -I ./lib bin/fbquick
8
+ ## $ ruby -I ../parser/lib -I ../document/lib -I ./lib bin/fbquick
9
9
 
10
10
 
11
11
  ## quick hack
12
12
  ## if available always use latest (local) source version
13
13
  $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/parser/lib' )
14
- $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/quick/lib' )
14
+ $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/document/lib' )
15
15
 
16
16
 
17
17
 
data/bin/fbquik CHANGED
@@ -6,7 +6,7 @@
6
6
  ## quick hack
7
7
  ## if available always use latest (local) source version
8
8
  $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/parser/lib' )
9
- $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/quick/lib' )
9
+ $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/document/lib' )
10
10
 
11
11
 
12
12
  ## our own code
data/bin/fbx CHANGED
@@ -7,7 +7,7 @@
7
7
  ## quick hack
8
8
  ## if available always use latest (local) source version
9
9
  $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/parser/lib' )
10
- $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/quick/lib' )
10
+ $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/document/lib' )
11
11
 
12
12
 
13
13
 
@@ -49,10 +49,6 @@ if opts[:debug]
49
49
  end
50
50
 
51
51
 
52
- # SportDb::Parser::Linter.debug = opts[:debug]
53
- # SportDb::Parser::Linter.warn = opts[:warn]
54
-
55
-
56
52
 
57
53
  ## todo/check - use packs or projects or such
58
54
  ## instead of specs - why? why not?
@@ -66,7 +62,7 @@ specs = if opts[:file]
66
62
  nil
67
63
  end
68
64
 
69
- path = SportDb::Pathspec.path(
65
+ path = Fbtxt::Pathspec.path(
70
66
  ['/sports/sportdb/sport.db.v2/parser/fbtxt-specs',
71
67
  '/sports/sportdb/sport.db.v2/parser/fbtxt-samples',
72
68
  '/sports/openfootball'])
@@ -40,12 +40,11 @@ if opts[:debug]
40
40
  puts "ARGV:"
41
41
  p args
42
42
 
43
- SportDb::QuickMatchReader.debug = true
44
- SportDb::MatchParser.debug = true
43
+ Fbtxt::Lexer.debug = true
44
+ Fbtxt::Parser.debug = true
45
+ Fbtxt::Document.debug = true
45
46
  else
46
- SportDb::QuickMatchReader.debug = false
47
- SportDb::MatchParser.debug = false
48
- LogUtils::Logger.root.level = :info
47
+ ## note - assume no debug is default
49
48
  end
50
49
 
51
50
 
@@ -67,7 +66,7 @@ specs = if opts[:file]
67
66
  nil
68
67
  end
69
68
 
70
- path = SportDb::Pathspec.path(
69
+ path = Fbtxt::Pathspec.path(
71
70
  ['/sports/sportdb/sport.db.v2/parser/fbtxt-specs',
72
71
  '/sports/sportdb/sport.db.v2/parser/fbtxt-samples',
73
72
  '/sports/openfootball'])
@@ -88,14 +87,14 @@ pp specs
88
87
  datafiles.each_with_index do |path,j|
89
88
  puts "==> [#{i+1}/#{specs.size}, #{j+1}/#{datafiles.size}] reading >#{path}<..."
90
89
  txt = read_text( path )
91
- quick = SportDb::QuickMatchReader.new( txt )
92
- matches = quick.parse
90
+ doc = Fbtxt::Document.new( txt )
91
+ matches = doc.matches
93
92
 
94
- if quick.errors?
95
- puts "!! #{quick.errors.size} error(s):"
96
- pp quick.errors
93
+ if doc.errors?
94
+ puts "!! #{doc.errors.size} error(s):"
95
+ pp doc.errors
97
96
 
98
- quick.errors.each do |err|
97
+ doc.errors.each do |err|
99
98
  errors << [ path, *err ] # note: use splat (*) to add extra values (starting with msg)
100
99
  end
101
100
  end
@@ -122,7 +121,7 @@ pp specs
122
121
  ###
123
122
  ## generate a report if --file option used
124
123
  if opts[:file]
125
- buf = SportDb::PathspecReport.new(
124
+ buf = Fbtxt::PathspecReport.new(
126
125
  specs,
127
126
  title: 'fbquick summary report' ).build
128
127
 
@@ -6,9 +6,10 @@ def self.main( args=ARGV )
6
6
 
7
7
  opts = {
8
8
  debug: true,
9
+ # warn: false,
10
+
9
11
  file: nil,
10
12
  seasons: [],
11
- # warn: false,
12
13
  }
13
14
 
14
15
 
@@ -53,11 +54,9 @@ if opts[:debug]
53
54
  p opts
54
55
  puts "ARGV:"
55
56
  p args
56
- end
57
-
58
57
 
59
- # SportDb::Parser::Linter.debug = opts[:debug]
60
- # SportDb::Parser::Linter.warn = opts[:warn]
58
+ Fbtxt::Lexer.debug = true
59
+ end
61
60
 
62
61
 
63
62
 
@@ -73,7 +72,7 @@ specs = if opts[:file]
73
72
  nil
74
73
  end
75
74
 
76
- path = SportDb::Pathspec.path(
75
+ path = Fbtxt::Pathspec.path(
77
76
  ['/sports/sportdb/sport.db.v2/parser/fbtxt-specs',
78
77
  '/sports/sportdb/sport.db.v2/parser/fbtxt-samples',
79
78
  '/sports/openfootball'])
@@ -99,7 +98,7 @@ specs.each_with_index do |rec,i|
99
98
  puts "==> [#{i+1}/#{specs.size}, #{j+1}/#{datafiles.size}] reading >#{path}<..."
100
99
 
101
100
  txt = read_text( path )
102
- lexer = SportDb::Lexer.new( txt, debug: opts[:debug] )
101
+ lexer = Fbtxt::Lexer.new( txt )
103
102
  tokens, more_errors = lexer.tokenize_with_errors
104
103
 
105
104
  ####
@@ -144,7 +143,7 @@ end
144
143
  ###
145
144
  ## generate a report if --file option used
146
145
  if opts[:file]
147
- buf = SportDb::PathspecReport.new(
146
+ buf = Fbtxt::PathspecReport.new(
148
147
  specs,
149
148
  title: 'fbtok summary report' ).build
150
149
 
@@ -72,6 +72,9 @@ if opts[:debug]
72
72
  p opts
73
73
  puts "ARGV:"
74
74
  p args
75
+
76
+ Fbtxt::Lexer.debug = true
77
+ Fbtxt::Parser.debug = true
75
78
  end
76
79
 
77
80
 
@@ -144,7 +147,12 @@ specs = if opts[:file]
144
147
  nil
145
148
  end
146
149
 
147
- path = SportDb::Pathspec.path(
150
+ ##
151
+ ## maybe change to:
152
+ ## Env.fbpath( default)
153
+ ## or fb_path or such - why? why not?
154
+
155
+ path = Fbtxt::Pathspec.path(
148
156
  ['/sports/sportdb/sport.db.v2/parser/fbtxt-specs',
149
157
  '/sports/sportdb/sport.db.v2/parser/fbtxt-samples',
150
158
  '/sports/openfootball'])
@@ -161,9 +169,6 @@ specs = if opts[:file]
161
169
  ## opts[:debug] = false
162
170
  ## end
163
171
 
164
- # SportDb::Parser::Linter.debug = opts[:debug]
165
- # SportDb::Parser::Linter.warn = opts[:warn]
166
-
167
172
 
168
173
 
169
174
  if opts[:seasons].size > 0
@@ -222,7 +227,7 @@ end
222
227
  ## generate a report if --file option used
223
228
  if opts[:file]
224
229
 
225
- buf = SportDb::PathspecReport.new(
230
+ buf = Fbtxt::PathspecReport.new(
226
231
  specs,
227
232
  title: 'fbtree summary report' ).build
228
233
 
@@ -257,7 +262,7 @@ end
257
262
 
258
263
 
259
264
  def self.parse_with_errors( txt, opts={} )
260
- parser = RaccMatchParser.new( txt, debug: opts[:debug] )
265
+ parser = RaccMatchParser.new( txt )
261
266
  tree = parser.parse
262
267
 
263
268
  dump_tree_stats( tree )
@@ -46,10 +46,11 @@ if opts[:debug]
46
46
  puts "ARGV:"
47
47
  p args
48
48
 
49
- SportDb::MatchParser.debug = true
49
+ Fbtxt::Lexer.debug = true
50
+ Fbtxt::Parser.debug = true
51
+ Fbtxt::Document.debug = true
50
52
  else
51
- SportDb::MatchParser.debug = false
52
- LogUtils::Logger.root.level = :info
53
+ ## note - assume no debug is default
53
54
  end
54
55
 
55
56
 
@@ -74,19 +75,18 @@ paths.each_with_index do |path,i|
74
75
 
75
76
  ##
76
77
  ## note - use start: nil => requires that first date incl. a year!!!
77
- parser = SportDb::MatchParser.new( txt, start: nil )
78
+ doc = Fbtxt::Document.new( txt, start: nil )
78
79
 
79
- auto_conf_teams, matches, rounds, groups = parser.parse
80
80
 
81
- puts ">>> #{auto_conf_teams.size} teams:"
82
- pp auto_conf_teams
83
- puts ">>> #{matches.size} matches:"
84
- pp matches[0,2] ## print first two matches
81
+ puts ">>> #{doc.teams.size} teams:"
82
+ pp doc.teams
83
+ puts ">>> #{doc.matches.size} matches:"
84
+ pp doc.matches[0,2] ## print first two matches
85
85
  puts "..."
86
- puts ">>> #{rounds.size} rounds:"
87
- pp rounds
88
- puts ">>> #{groups.size} groups:"
89
- pp groups
86
+ puts ">>> #{doc.rounds.size} rounds:"
87
+ pp doc.rounds
88
+ puts ">>> #{doc.groups.size} groups:"
89
+ pp doc.groups
90
90
  end # each paths
91
91
 
92
92
  =begin
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- module SportDb
5
+ module Fbtxt
6
6
  class Pathspec
7
7
 
8
8
  SEASON_RE = %r{ (?:
@@ -280,7 +280,7 @@ def self.build( args, path: [],
280
280
  end
281
281
 
282
282
  end # class Pathspecs
283
- end # module Sportdb
283
+ end # module Fbtxt
284
284
 
285
285
 
286
286
 
@@ -295,17 +295,18 @@ end # module Sportdb
295
295
  ##
296
296
  ## note: was formerly known as expand_args
297
297
  def build_pathspecs( args, path: [], filepack: nil )
298
- SportDb::Pathspecs.build( args, path: path, filepack: filepack )
298
+ Fbtxt::Pathspecs.build( args, path: path, filepack: filepack )
299
299
  end
300
300
 
301
301
  ####
302
302
  ## read pathspecs via csv file (using path column)
303
303
  def read_pathspecs( src )
304
- SportDb::Pathspecs.read( src )
304
+ Fbtxt::Pathspecs.read( src )
305
305
  end
306
306
 
307
307
 
308
308
 
309
+
309
310
  def filter_pathspecs( specs, seasons: )
310
311
  ## norm seasons
311
312
  seasons = seasons.map {|season| Season(season) }
@@ -316,7 +317,7 @@ def filter_pathspecs( specs, seasons: )
316
317
  specs.each do |rec|
317
318
  rec['datafiles'] =
318
319
  rec['datafiles'].select do |candidate|
319
- m=SportDb::Pathspec::MATCH_RE.match( candidate )
320
+ m=Fbtxt::Pathspec::MATCH_RE.match( candidate )
320
321
  if m && seasons.include?( Season.parse( m[:season] ))
321
322
  true
322
323
  else
@@ -1,4 +1,4 @@
1
- module SportDb
1
+ module Fbtxt
2
2
 
3
3
  ##
4
4
  # PathspecReport (aka/formerly BatchReport)
@@ -39,4 +39,4 @@ end # class BatchReport
39
39
  BatchReport = PathspecReport
40
40
 
41
41
 
42
- end # module Sportdb
42
+ end # module Fbtxt
data/lib/fbtok.rb CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- require 'sportdb/quick'
2
+ require 'fbtxt/document'
3
3
 
4
4
 
5
5
  ## our own code
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbtok
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.9.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: 2026-06-22 00:00:00.000000000 Z
11
+ date: 2026-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: sportdb-parser
14
+ name: fbtxt-parser
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.2
19
+ version: 0.9.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.7.2
26
+ version: 0.9.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: sportdb-quick
28
+ name: fbtxt-document
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.7.0
33
+ version: 0.9.0
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.7.0
40
+ version: 0.9.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rdoc
43
43
  requirement: !ruby/object:Gem::Requirement