sportdb-formats 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 349708bb8a9fc26f5bc6ce47fd8b9b08b37f243e04e017fc22fa1057a165b733
4
- data.tar.gz: 9fb3ba56070b20d14aff9f8804c2201a0fb5599ff111fa8b454ddf32fe81e264
3
+ metadata.gz: 67f0ea27fe2c7a39512eab9728167881fb1b99b919492b3d513cb1a1ff46c787
4
+ data.tar.gz: a93978a81ec8cb8c9b639ff4842e5eb46d7ebc018031e4b37e8361b7ed80e8af
5
5
  SHA512:
6
- metadata.gz: e3ffff589ba03e431c46d9244cb660572b94aa1f95ceb3d7d1b71182048d7c024bddeeaec6b43e36ddf0353071d4cb85b5db62f0a427677ce5e20a40cd347691
7
- data.tar.gz: 8a75b96b980429392dd9e909ba4f8441b96b129ec2cb6745eef65cf481889fb77ab426340ee277a28f6def7ae42e6de20f6d307aed082bea0df357d79d014ad0
6
+ metadata.gz: 94d114bc6772b18e972449cd7ed0f0a890d737203e8e020655e446e4496e8b8e99985ac33c6da2579e27a52a863602ea561e2275f2e1852762355228b3d9383d
7
+ data.tar.gz: 4e645afc07ca5c73cda0308fe82211293160e2ebd3857770dc959ea41c684cbc2794e1c514f1fcf9e103f22294cc5d7879446632a9be06d2a04399b11daef5ed
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 2.0.1
1
+ ### 2.0.2
2
2
 
3
3
  ### 0.0.1 / 2019-10-28
4
4
 
data/Manifest.txt CHANGED
@@ -2,6 +2,7 @@ CHANGELOG.md
2
2
  Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
+ bin/fbx
5
6
  lib/sportdb/formats.rb
6
7
  lib/sportdb/formats/country/country_reader.rb
7
8
  lib/sportdb/formats/csv/goal.rb
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ Hoe.spec 'sportdb-formats' do
21
21
 
22
22
  self.extra_deps = [
23
23
  ['sportdb-structs', '>= 0.3.1'],
24
- ['sportdb-parser', '>= 0.2.0'],
24
+ ['sportdb-parser', '>= 0.2.1'],
25
25
  ['sportdb-catalogs', '>= 1.2.2'],
26
26
  ['date-formats', '>= 1.0.2'],
27
27
  ['cocos', '>= 0.4.0'],
data/bin/fbx ADDED
@@ -0,0 +1,146 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ## tip: to test run:
4
+ ## ruby -I ./lib -I ../parser/lib bin/fbx
5
+
6
+
7
+ ## our own code
8
+ require 'sportdb/formats'
9
+
10
+
11
+
12
+ require 'optparse'
13
+
14
+ ##
15
+ ## read textfile
16
+ ## and dump match parse results
17
+ ##
18
+ ## fbt ../openfootball/.../euro.txt
19
+
20
+
21
+
22
+
23
+ args = ARGV
24
+ opts = { debug: false,
25
+ outline: false }
26
+
27
+ parser = OptionParser.new do |parser|
28
+ parser.banner = "Usage: #{$PROGRAM_NAME} [options]"
29
+
30
+ ##
31
+ ## check if git has a offline option?? (use same)
32
+ ## check for other tools - why? why not?
33
+
34
+
35
+ parser.on( "--verbose", "--debug",
36
+ "turn on verbose / debug output (default: #{opts[:debug]})" ) do |debug|
37
+ opts[:debug] = debug
38
+ end
39
+
40
+ parser.on( "--outline",
41
+ "turn on outline (only) output (default: #{opts[:outline]})" ) do |outline|
42
+ opts[:outline] = outline
43
+ end
44
+ end
45
+ parser.parse!( args )
46
+
47
+ puts "OPTS:"
48
+ p opts
49
+ puts "ARGV:"
50
+ p args
51
+
52
+
53
+
54
+
55
+
56
+ paths = if args.empty?
57
+ [
58
+ '../../../openfootball/euro/2021--europe/euro.txt',
59
+ '../../../openfootball/euro/2024--germany/euro.txt',
60
+ ]
61
+ else
62
+ ## check for directories
63
+ ## and auto-expand
64
+
65
+ SportDb::Parser::Opts.expand_args( args )
66
+ end
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+ SportDb::MatchParser.debug = true if opts[:debug]
75
+
76
+
77
+ ## errors = []
78
+
79
+
80
+ paths.each_with_index do |path,i|
81
+ puts "==> [#{i+1}/#{paths.size}] reading >#{path}<..."
82
+
83
+ txt = read_text( path )
84
+ secs = SportDb::LeagueOutlineReader.parse( txt )
85
+ ## pp secs
86
+
87
+ secs.each_with_index do |sec,j| ## sec(tion)s
88
+ season = sec[:season]
89
+ league = sec[:league]
90
+ stage = sec[:stage]
91
+ lines = sec[:lines]
92
+
93
+ puts " section #{j+1}/#{secs.size} - #{league.name} #{season}, #{stage} - #{lines.size} line(s)"
94
+
95
+ next if opts[:outline]
96
+
97
+ =begin
98
+ ### check if event info availabe - use start_date;
99
+ ## otherwise we have to guess (use a "synthetic" start_date)
100
+ event_info = catalog.events.find_by( season: season,
101
+ league: league )
102
+
103
+ start = if event_info && event_info.start_date
104
+ puts "event info found:"
105
+ puts " using start date from event: "
106
+ pp event_info
107
+ pp event_info.start_date
108
+ event_info.start_date
109
+ else
110
+ =end
111
+ start = if season.year?
112
+ Date.new( season.start_year, 1, 1 )
113
+ else
114
+ Date.new( season.start_year, 7, 1 )
115
+ end
116
+
117
+ parser = SportDb::MatchParser.new( lines,
118
+ start ) ## note: keep season start_at date for now (no need for more specific stage date need for now)
119
+
120
+ auto_conf_teams, matches, rounds, groups = parser.parse
121
+
122
+ puts ">>> #{auto_conf_teams.size} teams:"
123
+ pp auto_conf_teams
124
+ puts ">>> #{matches.size} matches:"
125
+ ## pp matches
126
+ puts ">>> #{rounds.size} rounds:"
127
+ pp rounds
128
+ puts ">>> #{groups.size} groups:"
129
+ pp groups
130
+ end # each secs
131
+ end # each paths
132
+
133
+ =begin
134
+ if errors.size > 0
135
+ puts
136
+ pp errors
137
+ puts
138
+ puts "!! #{errors.size} parse error(s) in #{paths.size} datafiles(s)"
139
+ else
140
+ puts
141
+ puts "OK no parse errors found in #{paths.size} datafile(s)"
142
+ end
143
+ =end
144
+
145
+ puts "bye"
146
+
@@ -617,9 +617,11 @@ class GoalStruct
617
617
 
618
618
  elsif node_type == :'@' ||
619
619
  node_type == :',' ||
620
- node_type == :geo
620
+ node_type == :geo ||
621
+ node_type == :timezone
621
622
  ## e.g.
622
623
  ## [:"@"], [:geo, "Stade de France"], [:","], [:geo, "Saint-Denis"]]
624
+ ## [:"@"], [:geo, "Arena de São Paulo"], [:","], [:geo, "São Paulo"], [:timezone, "(UTC-3)"]
623
625
  more << node[1] if node_type == :geo
624
626
  else
625
627
  puts "!! PARSE ERROR - unexpected node type #{node_type} in match line; got:"
@@ -4,7 +4,7 @@ module Formats
4
4
 
5
5
  MAJOR = 2 ## todo: namespace inside version or something - why? why not??
6
6
  MINOR = 0
7
- PATCH = 1
7
+ PATCH = 2
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
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.0.1
4
+ version: 2.0.2
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-08-23 00:00:00.000000000 Z
11
+ date: 2024-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sportdb-structs
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.2.0
33
+ version: 0.2.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.2.0
40
+ version: 0.2.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sportdb-catalogs
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -144,7 +144,8 @@ dependencies:
144
144
  version: '4.1'
145
145
  description: sportdb-formats - sport.db format and text utilities
146
146
  email: gerald.bauer@gmail.com
147
- executables: []
147
+ executables:
148
+ - fbx
148
149
  extensions: []
149
150
  extra_rdoc_files:
150
151
  - CHANGELOG.md
@@ -155,6 +156,7 @@ files:
155
156
  - Manifest.txt
156
157
  - README.md
157
158
  - Rakefile
159
+ - bin/fbx
158
160
  - lib/sportdb/formats.rb
159
161
  - lib/sportdb/formats/country/country_reader.rb
160
162
  - lib/sportdb/formats/csv/goal.rb