leagues 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7de33794f4721fff69b19475defc328a33a8f245d259d26326a2238681cd8255
4
- data.tar.gz: 4bd10a37c73aef136805a5377c9765ba30a6842257ee8193840cbb2c1651e25f
3
+ metadata.gz: 1b61c5794e4e1aa3657c553c73bdb0d912b909097ce06aabe098fb013b142113
4
+ data.tar.gz: cac21b539d073c7061f7138c2a0935771ee81d7dd4321362c524e2a9953c14e8
5
5
  SHA512:
6
- metadata.gz: 1dec15278cd269eb43327ef227bfb277f5865d48469e20833e6aba0e53167bb792b2761865ecaf0b3bc7889444f496cdbe4348216d6c8fab7572f58bd2dc6e22
7
- data.tar.gz: 398b9bf89c963c0e60087be743f709c7c4f42c1417cf66b4b22980e6d42f8fc918328efcec2e782d42861324f2763aaf7375681a7c5edd342a1bfa457704ae61
6
+ metadata.gz: 1af29b03971fa6708f9ca33ae6072a0b11899a544d7fc0d72e6198f80ec1fbcca87a9fcc28483bf3c52895064680e70af126ccba2127cc0bdd6b12dad76cf30c
7
+ data.tar.gz: 5843bc59ba35cafce9c095008d6501e43630284c26b742aaa429260ef71224c921c0bfeb39344bb1999a5e47a46997ce5950b2ddc00a495ba2c5d2c14ce2c7c8
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 0.2.0
1
+ ### 0.2.1
2
2
 
3
3
  ### 0.0.1 / 2025-04-01
4
4
 
data/Rakefile CHANGED
@@ -18,8 +18,8 @@ Hoe.spec 'leagues' do
18
18
  self.history_file = 'CHANGELOG.md'
19
19
 
20
20
  self.extra_deps = [
21
- ['tzinfo'],
22
- ['season-formats'],
21
+ ['tzinfo'], ## note - check if tzinfo-data or such is required too???
22
+ ['season-formats', '>= 0.1.0'],
23
23
  ['cocos'],
24
24
  ]
25
25
 
data/bin/fbok CHANGED
@@ -12,7 +12,7 @@ def read_raw_leagueset( path )
12
12
  recs = read_csv( path )
13
13
  recs.each do |rec|
14
14
  key = rec['league']
15
- seasons = SportDb::Leagueset._parse_seasons( rec['seasons'] )
15
+ seasons = Season.parse_line( rec['seasons'] )
16
16
 
17
17
  datasets << [key, seasons]
18
18
  end
@@ -44,7 +44,7 @@ def check_leagueset( path )
44
44
 
45
45
  if errors.size > 0
46
46
  puts "#{errors.size} error(s):"
47
- pp errrors
47
+ pp errors
48
48
  exit 1
49
49
  end
50
50
 
@@ -79,7 +79,7 @@ def check_leagueset( path )
79
79
 
80
80
  if errors.size > 0
81
81
  puts "#{errors.size} error(s):"
82
- pp errrors
82
+ pp errors
83
83
  else
84
84
  puts
85
85
  puts "OK no error(s) found"
@@ -70,38 +70,6 @@ def self.parse_args( args, autofill: nil )
70
70
  end
71
71
 
72
72
 
73
- # todo/fix - (maybe) move "upstream" later
74
- # e.g. Season.parse_list or parse_lst
75
- # or parse_line or ???
76
- # or parse_multi(ple) - why? why not?
77
- def self._parse_seasons( str )
78
- ## helper to parse seasons string/column
79
- ## note: ALWAYS returns an array of seaons (even if only one)
80
- result = []
81
- seasons = str.split( /[ ]+/ )
82
-
83
- seasons.each do |season_str|
84
- ## note - add support for ranges e.g. 2001/02..2010/11
85
- if season_str.index( '..' )
86
- fst,snd = season_str.split( '..' )
87
- # pp [fst,snd]
88
- fst = Season.parse( fst )
89
- snd = Season.parse( snd )
90
- if fst < snd && fst.year? == snd.year?
91
- result += (fst..snd).to_a
92
- else
93
- raise ArgumentError, "parse error - invalid season range >#{season_str}<, 1) two seasons required, 2) first < second, 3) same (year/academic) type"
94
- end
95
- else
96
- season = Season.parse( season_str ) ## check season
97
- result << season
98
- end
99
- end
100
-
101
- result
102
- end
103
-
104
-
105
73
 
106
74
  def self.parse( txt, autofill: nil )
107
75
  ### split args in datasets with leagues and seasons
@@ -111,7 +79,7 @@ def self.parse( txt, autofill: nil )
111
79
  key = rec['league'].downcase
112
80
 
113
81
  seasons_str = rec['seasons']
114
- seasons = _parse_seasons( seasons_str )
82
+ seasons = Season.parse_line( seasons_str )
115
83
 
116
84
  datasets << [key, seasons]
117
85
  end
@@ -4,7 +4,7 @@ module Module
4
4
  module Leagues
5
5
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
6
6
  MINOR = 2
7
- PATCH = 0
7
+ PATCH = 1
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
data/lib/leagues.rb CHANGED
@@ -41,7 +41,9 @@ end
41
41
 
42
42
 
43
43
 
44
-
44
+ ##
45
+ ## todo/check
46
+ ## note - move FileHelper upstream to cocos (code commons) - why? why not?
45
47
  module FileHelper
46
48
  def find_file( filename, path: )
47
49
  path.each do |src_dir|
@@ -56,6 +58,7 @@ end
56
58
 
57
59
 
58
60
 
61
+
59
62
  ####
60
63
  ### note - make find_zone! public/global by default - why? why not?
61
64
  module Kernel
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leagues
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
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: 2025-04-30 00:00:00.000000000 Z
11
+ date: 2025-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 0.1.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'
40
+ version: 0.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cocos
43
43
  requirement: !ruby/object:Gem::Requirement