footty 2026.5.25 → 2026.7.6

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: 75b4ca658d25b404bf5b4f1594da50c42564ad7ffc43e3190429a7c4627b8c94
4
- data.tar.gz: 25eac464226fea4b31da270bc195c443e34bc4fa68ce9de1bd0646b8ec63639e
3
+ metadata.gz: e610fb1316252ad640f6dc1797ff85af9252b00c7f3c90d4d182e683490f77b4
4
+ data.tar.gz: cacbd8b21aaa4f0e29225b158da9c0a35dc825ff6cfdbc4532662fa71997404c
5
5
  SHA512:
6
- metadata.gz: a1762d1389a13f0380267a7b8a0621b6df1e176eb847a4cac454fcfdfb87ece7321a950e80ad2c1ffedbd38f2966def3c63cda9d159063e568b1854bac0349b9
7
- data.tar.gz: e791218fe6679d8c03545114cb60a7ce588b8f8dce4f8d80764aaa1da1168f6ab7552af00098ad6165a59d97ecea5fc1292cbb979689835f029bb4d06a1bc5cb
6
+ metadata.gz: 8db64064a0d96b3c70a7a75fdb5246864c4e13ad950c39eb6a43795f6d6f9af45bf84f8a7590c46664c14547769c51b8116e030e64e1271df17be31e279f9a85
7
+ data.tar.gz: 94ab96e8e3dca3efa6a80fd30a72a469a41271b0819d9ff2a2ebafeb1b6491f10a043a4acc93c3f6f9a0bf99fb06309b9a03f127e26ba9b124b9ac2b07b44ef9
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 2026.5.25
1
+ ### 2026.7.6
2
2
  ### 1.0.0 / 2018-06-09
3
3
 
4
4
  * Everything is new (again). First release.
data/README.md CHANGED
@@ -8,6 +8,12 @@
8
8
 
9
9
 
10
10
 
11
+ ## Step 0 - Installation Via Gems
12
+
13
+ To install the command-line tool via gems (ruby's package manager) use:
14
+
15
+ $ gem install footty
16
+
11
17
 
12
18
 
13
19
  ## Usage - Who's playing today?
@@ -17,21 +23,20 @@ for upcoming or past matches. For example:
17
23
 
18
24
  $ footty # Defaults to today's matches of top leagues
19
25
 
20
-
21
26
  prints on Sep 27, 2024:
22
27
 
23
28
  ==> English Premier League 2024/25
24
- Upcoming matches:
25
- Sat Sep 28 12:30 (in 1d) Newcastle United FC vs Manchester City FC ▪ Matchday 6
26
- Sat Sep 28 15:00 (in 1d) Arsenal FC vs Leicester City FC ▪ Matchday 6
27
- Sat Sep 28 15:00 (in 1d) Brentford FC vs West Ham United FC ▪ Matchday 6
28
- Sat Sep 28 15:00 (in 1d) Chelsea FC vs Brighton & Hove Albion ▪ Matchday 6
29
- Sat Sep 28 15:00 (in 1d) Everton FC vs Crystal Palace FC ▪ Matchday 6
30
- Sat Sep 28 15:00 (in 1d) Nottingham Forest FC vs Fulham FC ▪ Matchday 6
31
- Sat Sep 28 17:30 (in 1d) Wolverhampton Wanderers FC vs Liverpool FC ▪ Matchday 6
32
- Sun Sep 29 14:00 (in 2d) Ipswich Town FC vs Aston Villa FC ▪ Matchday 6
33
- Sun Sep 29 16:30 (in 2d) Manchester United FC vs Tottenham Hotspur FC ▪ Matchday 6
34
- Mon Sep 30 20:00 (in 3d) AFC Bournemouth vs Southampton FC ▪ Matchday 6
29
+ Matchday 6 ▪
30
+ Sat Sep 28 12:30 (in 1d) Newcastle United FC v Manchester City FC
31
+ 15:00 (in 1d) Arsenal FC v Leicester City FC
32
+ 15:00 (in 1d) Brentford FC v West Ham United FC
33
+ 15:00 (in 1d) Chelsea FC v Brighton & Hove Albion
34
+ 15:00 (in 1d) Everton FC v Crystal Palace FC
35
+ 15:00 (in 1d) Nottingham Forest FC v Fulham FC
36
+ 17:30 (in 1d) Wolverhampton Wanderers FC v Liverpool FC
37
+ Sun Sep 29 14:00 (in 2d) Ipswich Town FC v Aston Villa FC
38
+ 16:30 (in 2d) Manchester United FC v Tottenham Hotspur FC
39
+ Mon Sep 30 20:00 (in 3d) AFC Bournemouth v Southampton FC
35
40
 
36
41
 
37
42
 
@@ -45,7 +50,7 @@ Use `--yesterday` or `-y` to print yesterday's matches e.g.:
45
50
  $ footty --yesterday # -or-
46
51
  $ footty -y
47
52
 
48
- Use `--upcoming` or `--up` or `-u` to print all upcoming matches e.g.:
53
+ Use `--upcoming`/`--up` or `-u` to print all upcoming matches e.g.:
49
54
 
50
55
  $ footty --upcoming # -or-
51
56
  $ footty --up
@@ -91,19 +96,11 @@ See [footty/openfootball](https://github.com/sportdb/footty/blob/master/footty/l
91
96
  Why tty? tty stands for teletype (tty) writer and is the old traditional (short) name for the unix command line.
92
97
 
93
98
 
94
- ## Install
95
-
96
- Just install the gem:
97
-
98
- $ gem install footty
99
-
100
99
 
101
100
  ## License
102
101
 
103
102
  The `footty` scripts are dedicated to the public domain.
104
- Use it as you please with no restrictions whatsoever.
105
-
106
-
103
+ Use as you please with no restrictions whatsoever.
107
104
 
108
105
 
109
106
  ## Questions? Comments?
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require './lib/footty/version.rb'
4
4
  Hoe.spec 'footty' do
5
5
  self.version = Footty::VERSION
6
6
 
7
- self.summary = "footty - football.db command line tool for national & int'l football club leagues (& cups) from around the world (bonus - incl. world cup, euro and more)"
7
+ self.summary = "footty - football.db command line tool(s) for national & int'l football club leagues (& cups) from around the world (bonus - incl. world cup, euro and more)"
8
8
  self.description = summary
9
9
 
10
10
  self.urls = { home: 'https://github.com/sportdb/footty' }
@@ -17,8 +17,11 @@ Hoe.spec 'footty' do
17
17
  self.history_file = 'CHANGELOG.md'
18
18
 
19
19
  self.extra_deps = [
20
- ['sportdb-quick', '>= 0.7.0'],
21
20
  ['webget'],
21
+ ['sportdb-parser', '>= 0.8.0'],
22
+ ['sportdb-quick', '>= 0.8.0'],
23
+ ['fbtok'],
24
+ ['fbtxt2json']
22
25
  ]
23
26
 
24
27
  self.licenses = ['Public Domain']
data/bin/footty CHANGED
@@ -3,6 +3,13 @@
3
3
  ## tip: to test run:
4
4
  ## ruby -I ./lib bin/footty
5
5
 
6
+
7
+ ## quick hack
8
+ ## if available always use latest (local) source version
9
+ $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/parser/lib' )
10
+ $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/quick/lib' )
11
+
12
+
6
13
  require 'footty'
7
14
 
8
15
  Footty.main
data/bin/ftty CHANGED
@@ -3,6 +3,12 @@
3
3
  ## tip: to test run:
4
4
  ## ruby -I ./lib bin/ftty
5
5
 
6
+ ## quick hack
7
+ ## if available always use latest (local) source version
8
+ $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/parser/lib' )
9
+ $LOAD_PATH.unshift( '/sports/sportdb/sport.db.v2/quick/lib' )
10
+
11
+
6
12
  require 'footty'
7
13
 
8
14
  Footty.main
@@ -110,11 +110,19 @@ module Footty
110
110
  matches = []
111
111
  urls.each do |url|
112
112
  txt = get!( url ) ## use "memoized" / cached result
113
- parser = SportDb::QuickMatchReader.new( txt )
114
- matches += parser.parse
113
+ doc = Fbtxt::Document.new( txt )
114
+ matches += doc.matches
115
115
  ### for multiple source file use latest name as "definitive"
116
- @league_name = parser.league_name
117
- ### todo/fix - report errors
116
+ @league_name = doc.title || '??'
117
+
118
+ ### todo/fix - imrove report errors formula
119
+ if doc.errors?
120
+ puts "!! HTTP ERROR - #{response.status.code} #{response.status.message}"
121
+ exit 1
122
+ puts "!! PARSE - #{doc.errors.size} parse error(s) in >#{url}<:"
123
+ pp doc.errors
124
+ exit 1
125
+ end
118
126
  end
119
127
 
120
128
  matches = matches.map {|match| match.as_json } # convert to json
@@ -9,9 +9,40 @@ module Footty
9
9
 
10
10
  today = Date.today
11
11
 
12
+ last_date = nil
13
+ last_round = nil
14
+
12
15
  matches.each do |match|
16
+
17
+ ## note - merge group into round
18
+
19
+ round = String.new
20
+ round += "#{match['group']}, " if match['group'] ## (optional) group
21
+ round += "#{match['round']}"
22
+
23
+ if last_round.nil? || last_round != round
24
+ print "▪ #{round} ▪\n" ## knock out (k.o.) phase/stage
25
+ last_date = nil
26
+ else
27
+ ## print " " + (" " *round.length)
28
+ end
29
+ last_round = round
30
+
31
+
32
+
33
+
34
+
13
35
  date = match['date']
14
- print "#{date.strftime('%a %b %d')} " ## e.g. Thu Jun 14
36
+
37
+ ## do NOT repeat same date
38
+ if last_date.nil? || last_date != date
39
+ print "#{date.strftime('%a %b %d')} " ## e.g. Thu Jun 14
40
+ else
41
+ print " "
42
+ end
43
+ last_date = date
44
+
45
+
15
46
  print "#{match['time']} " if match['time']
16
47
 
17
48
  if date > today
@@ -55,7 +86,7 @@ module Footty
55
86
  score = "#{match['score'][0]}-#{match['score'][1]}"
56
87
  print " #{score} "
57
88
  else
58
- print " vs "
89
+ print " v "
59
90
  end
60
91
 
61
92
  if match['team2'].is_a?( Hash )
@@ -65,20 +96,15 @@ module Footty
65
96
  end
66
97
 
67
98
 
68
- print "▪" ## note - add round marker!!
69
-
70
-
71
- print " #{match['group']} /" if match['group'] ## (optional) group
72
-
73
-
74
- print " #{match['round']} " ## knock out (k.o.) phase/stage
75
-
76
99
 
77
100
  print "%-5s " % "(\##{match['num']}) " if match['num']
78
101
 
79
102
  print " @ #{match['ground']}" if match['ground']
80
103
 
81
104
 
105
+ print " [#{match['status']}]" if match['status']
106
+
107
+
82
108
  print "\n"
83
109
 
84
110
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Footty
3
- VERSION = '2026.5.25'
3
+ VERSION = '2026.7.6'
4
4
 
5
5
  def self.banner
6
6
  "footty/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
data/lib/footty.rb CHANGED
@@ -24,10 +24,3 @@ Webcache.root = './cache'
24
24
 
25
25
  # pp Webcache.root
26
26
  Webget.config.sleep = 1 ## set delay in secs (to 1 sec - default is/maybe 3)
27
-
28
-
29
-
30
-
31
-
32
-
33
- Footty.main if __FILE__ == $0
metadata CHANGED
@@ -1,31 +1,73 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: footty
3
3
  version: !ruby/object:Gem::Version
4
- version: 2026.5.25
4
+ version: 2026.7.6
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-05-25 00:00:00.000000000 Z
11
+ date: 2026-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: webget
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sportdb-parser
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.8.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.8.0
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: sportdb-quick
15
43
  requirement: !ruby/object:Gem::Requirement
16
44
  requirements:
17
45
  - - ">="
18
46
  - !ruby/object:Gem::Version
19
- version: 0.7.0
47
+ version: 0.8.0
20
48
  type: :runtime
21
49
  prerelease: false
22
50
  version_requirements: !ruby/object:Gem::Requirement
23
51
  requirements:
24
52
  - - ">="
25
53
  - !ruby/object:Gem::Version
26
- version: 0.7.0
54
+ version: 0.8.0
27
55
  - !ruby/object:Gem::Dependency
28
- name: webget
56
+ name: fbtok
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: fbtxt2json
29
71
  requirement: !ruby/object:Gem::Requirement
30
72
  requirements:
31
73
  - - ">="
@@ -72,7 +114,7 @@ dependencies:
72
114
  - - "~>"
73
115
  - !ruby/object:Gem::Version
74
116
  version: '4.2'
75
- description: footty - football.db command line tool for national & int'l football
117
+ description: footty - football.db command line tool(s) for national & int'l football
76
118
  club leagues (& cups) from around the world (bonus - incl. world cup, euro and more)
77
119
  email: gerald.bauer@gmail.com
78
120
  executables:
@@ -121,6 +163,6 @@ requirements: []
121
163
  rubygems_version: 3.5.22
122
164
  signing_key:
123
165
  specification_version: 4
124
- summary: footty - football.db command line tool for national & int'l football club
166
+ summary: footty - football.db command line tool(s) for national & int'l football club
125
167
  leagues (& cups) from around the world (bonus - incl. world cup, euro and more)
126
168
  test_files: []