football-timezones 0.3.0 → 0.3.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: e1acaa59a47936cf0ac4c5eefb5787e443bc2fefde91676612da7c8ec4943c7c
4
- data.tar.gz: 437779a99bfd460a95d824c5a31341a4e5d2e9c7b3326407dd23358696f077e7
3
+ metadata.gz: ac21f96485baced66f13afd18e167b181203b9aa280b5c16996f76b0895c7500
4
+ data.tar.gz: a6bbe1691030240f2cb599bfb3df8634337ca3678ced4eb19adf6c37f808bbb7
5
5
  SHA512:
6
- metadata.gz: 532ae9d3e63cf763a73e775a3a41a06d7321e7c23726aba289d814b9aab3e082aca6b86592a1aff77d0b9cfb196d7e38a5466244e0baf798a72a89d155112af5
7
- data.tar.gz: b10ac2a0864140fcd1f7bcc0cba321bea0cd960f63c450ee3891fa9d57e2227d4a2af5c2783a180d3d58e480d328ad130969133b3928c9bb601bca0190dfd235
6
+ metadata.gz: 42e149d038868379ab286ded5087b885d4d7bee7d66246b4a6ec8b80acb3d2ec7077854583511fff8175be3c422a262f68deb2898e395871056d302a6051db0c
7
+ data.tar.gz: b53f6d16560a9082e8142080356dd8d1ad39bcec2888a932dbb3e4e395ce3f86cefd25ee8bdbd5087bbc5ea495f4bc0b0e37bde27f7218f141a150256e2cb94f
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 0.3.0
1
+ ### 0.3.1
2
2
 
3
3
  ### 0.0.1 / 2024-09-11
4
4
 
data/Manifest.txt CHANGED
@@ -3,6 +3,7 @@ Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
5
  config/leagues.csv
6
+ config/leagues_more.csv
6
7
  config/timezones_africa.csv
7
8
  config/timezones_america.csv
8
9
  config/timezones_asia.csv
data/config/leagues.csv CHANGED
@@ -209,9 +209,9 @@ fr.cup.l,French Coupe de la Ligue,coupedelaligue,,
209
209
  fr.super,French Trophée des Champions,tropheedeschampions,,
210
210
  it.1,Italian Serie A,1-seriea,,
211
211
  it.2,Italian Serie B,2-serieb,,
212
- it.3.a,Italian Serie C (North & Central West),seriecnorthcentralwest,,
213
- it.3.b,Italian Serie C (North & Central East),seriecnorthcentraleast,,
214
- it.3.c,Italian Serie C (South),seriecsouth,,
212
+ it.3.a,Italian Serie C (North & Central West),3-seriec_a,,
213
+ it.3.b,Italian Serie C (North & Central East),3-seriec_b,,
214
+ it.3.c,Italian Serie C (South),3-seriec_c,,
215
215
  it.cup,Coppa Italia,cup,,
216
216
  it.cup.c,Italian Coppa Italia Serie C,coppaitaliaseriec,,
217
217
  it.super,Italian Supercoppa Italiana,supercoppaitaliana,,
@@ -0,0 +1,34 @@
1
+ key,name,basename,start_season,end_season
2
+
3
+
4
+ ### quick hack - add more leagues "by hand"
5
+ ### todo - add leagues upstream!!!
6
+
7
+
8
+ mls,Major League Soccer,majorleaguesoccer,,
9
+ mls.back,MLS is Back Tournament,mlsisbacktournament,,
10
+
11
+
12
+ ## first expansion season -> 2020/21 Apertura
13
+ ## last ascenso season -> 2019/20 Clausura
14
+ mx.2.ascenso,Ascenso MX,2-ascensomx,,2019/20
15
+ mx.2.expansion,Liga de Expansión MX,2-ligaexpansionmx,2020/21,
16
+
17
+
18
+ ### add alternate keys for de.4
19
+ de.4.n,Deutsche Regionalliga Nord,4-regionalliga_nord,,
20
+ de.4.no,Deutsche Regionalliga Nordost,4-regionalliga_nordost,,
21
+ de.4.w,Deutsche Regionalliga West,4-regionalliga_west,,
22
+ de.4.sw,Deutsche Regionalliga Südwest,4-regionalliga_suedwest,,
23
+
24
+
25
+ ## italy - update upstream
26
+ ## use seriec_a or seriec-a ???
27
+ # it.3.a,Italian Serie C (North & Central West),3-seriec_a,,
28
+ # it.3.b,Italian Serie C (North & Central East),3-seriec_b,,
29
+ # it.3.c,Italian Serie C (South),3-seriec_c,,
30
+
31
+ ## england
32
+ ## add alternate codes / keys
33
+ eng.fa.cup,English FA Cup,facup,,
34
+ eng.efl.cup,English EFL Cup,eflcup,,
@@ -2,6 +2,8 @@ key, zone
2
2
 
3
3
 
4
4
  us, America/New_York
5
+ mls, America/New_York
6
+
5
7
  ca, America/Toronto
6
8
 
7
9
  mx, America/Mexico_City
@@ -31,4 +33,9 @@ co, America/Bogota
31
33
 
32
34
 
33
35
  copa.l, America/Sao_Paulo ### use brazil time - why? why not?
36
+ copa.s, America/Sao_Paulo
37
+
38
+
39
+ southamerica, America/Sao_Paulo ## copa america - use country specific by year - why? why not?
40
+
34
41
 
@@ -16,4 +16,4 @@ world+2002, Asia/Tokyo # Japan & South Korea
16
16
  world+1998, Europe/Paris # France
17
17
 
18
18
 
19
-
19
+ friendlies, Europe/London ## use (generic) utc - why? why not?
@@ -90,6 +90,8 @@ end
90
90
 
91
91
  ### use a function for (re)use
92
92
  ### note - may add seasons in place!! (if seasons is empty)
93
+ ##
94
+ ## todo/check - change source_path to (simply) path - why? why not?
93
95
  def validate!( source_path: ['.'] )
94
96
  each do |league_key, seasons|
95
97
 
@@ -132,6 +134,32 @@ end
132
134
 
133
135
 
134
136
 
137
+ ## todo/check: find a better name for helper?
138
+ ## find_all_datasets, filter_datatsets - add alias(es???
139
+ ## queries (lik ARGV) e.g. ['at'] or ['eng', 'de'] etc. list of strings
140
+ def filter( queries=[] )
141
+ ## find all matching leagues (that is, league keys)
142
+ if queries.empty? ## no filter - get all league keys
143
+ self
144
+ else
145
+ recs = @recs.find_all do |league_key, seasons|
146
+ found = false
147
+ ## note: normalize league key
148
+ ## (remove dot and downcase)
149
+ norm_key = league_key.gsub( '.', '' )
150
+ queries.each do |query|
151
+ q = query.gsub( '.', '' ).downcase
152
+ if norm_key.start_with?( q )
153
+ found = true
154
+ break
155
+ end
156
+ end
157
+ found
158
+ end
159
+ ## return new typed leagueset
160
+ self.class.new( recs )
161
+ end
162
+ end
135
163
 
136
164
 
137
165
  def pretty_print( printer )
@@ -4,7 +4,7 @@ module Module
4
4
  module Timezones
5
5
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
6
6
  MINOR = 3
7
- PATCH = 0
7
+ PATCH = 1
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
@@ -20,6 +20,7 @@ module LeagueInfoHelper
20
20
  @_leagues ||= begin
21
21
  leagues = SportDb::LeagueConfig.new
22
22
  ['leagues',
23
+ 'leagues_more',
23
24
  ].each do |name|
24
25
  recs = read_csv( "#{SportDb::Module::Timezones.root}/config/#{name}.csv" )
25
26
  leagues.add( recs )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: football-timezones
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.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: 2024-12-29 00:00:00.000000000 Z
11
+ date: 2025-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo
@@ -100,6 +100,7 @@ files:
100
100
  - README.md
101
101
  - Rakefile
102
102
  - config/leagues.csv
103
+ - config/leagues_more.csv
103
104
  - config/timezones_africa.csv
104
105
  - config/timezones_america.csv
105
106
  - config/timezones_asia.csv