football-timezones 0.2.0 → 0.2.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: d8574fc2a4c6312eb5f3080f41b1f08a353618b65f049876b2d1c90752e1f579
4
- data.tar.gz: 001a40fbd239ab29c44104f1c67e1f033a4389974ce5699ffd9f61ce44e193a7
3
+ metadata.gz: a95892d9f16f3c79ca11ba53c7620fb1a960685094f34d45505c1a43152c9eef
4
+ data.tar.gz: f007f71ffe6a2e2286497b85c9873c94f21e34008594af9e21cb1d394ec71af2
5
5
  SHA512:
6
- metadata.gz: 80ff25b583304c98bd7fac3b838b901010d6d8a44142c9f8cc5a73d69a86c36d5aed47ab9426875fa7d7d8d8036c35b95fb9520e1aae2c91b4589cdd77df4220
7
- data.tar.gz: 7bf0cf0736dea5c94427049d48a7693e19bc2a6230055a78b759ee12e5df3fcca7282c5ce763c3d2de91bdf31c7fee52e83939bb45ca616a21cd868d85e9d9eb
6
+ metadata.gz: 885f9273eb9502493c4f3890e94ded900dc1d576dc61fc3666d1bc6a7f105ded9f410dfd3c749ba9943d16d5ac39e0f337e91b7597d71db6c4c36ec44163496d
7
+ data.tar.gz: 204e812e47f6080748be10242f0c7b92a279f38384e6f909b3d897d062373fda3be497c829c771702d83e1eff0f59ed6bb648b408d560af31594139251cc688d
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 0.2.0
1
+ ### 0.2.2
2
2
 
3
3
  ### 0.0.1 / 2024-09-11
4
4
 
@@ -3,7 +3,6 @@ key, zone
3
3
  eg, Africa/Cairo
4
4
 
5
5
  dz, Africa/Algiers
6
-
7
6
  ma, Africa/Casablanca
8
7
 
9
8
  za, Africa/Johannesburg
@@ -14,4 +13,9 @@ ng, Africa/Lagos
14
13
  ke, Africa/Nairobi
15
14
 
16
15
 
16
+ ## note: use cairo time zone for int'l africa tournaments for now
17
+ # why? why not?
18
+ afl, Africa/Cairo
19
+ caf.cl, Africa/Cairo
20
+ caf, Africa/Cairo
17
21
 
@@ -13,18 +13,22 @@ hn, America/Tegucigalpa
13
13
  sv, America/El_Salvador
14
14
  ni, America/Managua
15
15
 
16
+ concacaf, America/Mexico_City ### use mx time - why? why not?
17
+ concacaf.cl, America/Mexico_City
18
+
19
+
16
20
  uy, America/Montevideo
17
21
  pe, America/Lima
18
22
  ec, America/Guayaquil
19
- co, America/Bogota
20
23
  bo, America/La_Paz
21
24
  cl, America/Santiago
22
25
  py, America/Asuncion
26
+ ve, America/Caracas
23
27
 
24
28
  br, America/Sao_Paulo
25
29
  ar, America/Argentina/Buenos_Aires
30
+ co, America/Bogota
26
31
 
27
32
 
28
- concacaf.cl, America/Mexico_City ### use mx time - why? why not?
29
33
  copa.l, America/Sao_Paulo ### use brazil time - why? why not?
30
34
 
@@ -4,6 +4,6 @@ jp, Asia/Tokyo
4
4
  kr, Asia/Seoul
5
5
  cn, Asia/Shanghai
6
6
 
7
-
7
+ kz, Asia/Almaty # see en.wikipedia.org/wiki/Time_in_Kazakhstan
8
8
 
9
9
 
@@ -2,36 +2,40 @@ key, zone
2
2
 
3
3
  eng, Europe/London
4
4
  sco, Europe/London ## check if entry or Edingburgh or such exits
5
+ wal, Europe/London
6
+ nir, Europe/London
5
7
  ie, Europe/Dublin
6
8
 
9
+
7
10
  es, Europe/Madrid
8
- de, Europe/Berlin
11
+ pt, Europe/Lisbon
12
+ gi, Europe/Gibraltar
13
+ ad, Europe/Andorra
14
+
9
15
  fr, Europe/Paris
10
- it, Europe/Rome
16
+ mc, Europe/Monaco
11
17
 
18
+ it, Europe/Rome
12
19
  sm, Europe/San_Marino
13
20
  va, Europe/Vatican
14
21
 
15
22
 
16
- pt, Europe/Lisbon
17
- ad, Europe/Andorra
18
- gi, Europe/Gibraltar
19
- mc, Europe/Monaco
20
-
21
23
 
22
- cy, Asia/Nicosia
23
- mt, Europe/Malta
24
24
  gr, Europe/Athens
25
25
  tr, Europe/Istanbul
26
+ cy, Asia/Nicosia
27
+ mt, Europe/Malta
28
+
29
+
26
30
  ro, Europe/Bucharest
27
31
  bg, Europe/Sofia
32
+
28
33
  ua, Europe/Kyiv
29
- ru, Europe/Moscow
30
34
  by, Europe/Minsk
35
+ ru, Europe/Moscow
31
36
 
32
37
 
33
-
34
-
38
+ de, Europe/Berlin
35
39
  at, Europe/Vienna
36
40
  ch, Europe/Zurich
37
41
  li, Europe/Vaduz
@@ -40,20 +44,27 @@ hu, Europe/Budapest
40
44
  cz, Europe/Prague
41
45
  sk, Europe/Bratislava # link to Prague !!!
42
46
  si, Europe/Ljubljana
47
+ pl, Europe/Warsaw
48
+
49
+
50
+ hr, Europe/Zagreb # link to Belgrade
51
+ ba, Europe/Sarajevo # link to Belgrade
52
+ rs, Europe/Belgrade # see en.wikipedia.org/wiki/Time_in_Serbia
53
+ al, Europe/Tirane
54
+ me, Europe/Podgorica
43
55
  mk, Europe/Skopje
56
+ md, Europe/Chisinau
57
+
58
+ kos, Europe/Belgrade # en.wikipedia.org/wiki/Time_in_Kosovo
59
+ xk, Europe/Belgrade # note - add both codes for now eg. xk & kos
44
60
 
45
61
 
46
- pl, Europe/Warsaw
47
62
 
48
63
  be, Europe/Brussels
49
64
  lu, Europe/Luxembourg # link to Brussels !!!
50
65
  nl, Europe/Amsterdam # link to Brussels !!!
51
66
 
52
67
 
53
-
54
- is, Iceland
55
-
56
-
57
68
  dk, Europe/Copenhagen ## link to Berlin
58
69
  se, Europe/Stockholm ## link to Berlin
59
70
  no, Europe/Oslo # link to Berlin
@@ -63,25 +74,25 @@ lv, Europe/Riga
63
74
  ee, Europe/Tallinn
64
75
  lt, Europe/Vilnius
65
76
 
77
+ is, Iceland
78
+ fo, Atlantic/Faroe
66
79
 
67
80
 
68
- hr, Europe/Zagreb # link to Belgrade
69
- al, Europe/Tirane
70
- ba, Europe/Sarajevo # link to Belgrade
71
- me, Europe/Podgorica
72
-
73
-
74
-
75
- md, Europe/Chisinau
76
-
77
81
 
82
+ am, Asia/Yerevan # en.wikipedia.org/wiki/Armenia_Time
83
+ ge, Asia/Tbilisi # en.wikipedia.org/wiki/Georgia_Time
84
+ az, Asia/Baku
78
85
 
79
86
 
80
87
 
81
- ## for champs default for not to cet (central european time) - why? why not?
82
- uefa.cl, Europe/Paris
83
- uefa.el, Europe/Paris
84
- uefa.conf, Europe/Paris
85
- uefa.nl, Europe/Paris
86
- euro, Europe/Paris
88
+ uefa, Europe/Paris
89
+ uefa.cl, Europe/Paris
90
+ uefa.champs, Europe/Paris ## for champs default for now to cet (central european time) - why? why not?
91
+ uefa.el, Europe/Paris
92
+ uefa.europa, Europe/Paris
93
+ uefa.conf, Europe/Paris
94
+ uefa.con, Europe/Paris
95
+ uefa.nl, Europe/Paris
96
+ uefa.nations, Europe/Paris
97
+ euro, Europe/Paris
87
98
 
@@ -1,6 +1,12 @@
1
1
  key, zone
2
2
 
3
3
 
4
+ ## todo/check - allow/use country ref
5
+ ## e.g. world+1998, fr
6
+ ## world+2006, de
7
+ ## and lookup timezone fr instead - why? why not?
8
+
9
+
4
10
  world+2022, Asia/Qatar # Qatar
5
11
  world+2018, Europe/Moscow # Russia
6
12
  world+2014, America/Sao_Paulo # Brazil
@@ -34,13 +34,27 @@ def self.parse( txt )
34
34
  seasons = seasons_str.split( /[ ]+/ )
35
35
 
36
36
  seasons.each do |season_str|
37
- season = Season.parse( season_str ) ## check season
38
- datasets[-1][1] << season
37
+ ## note - add support for ranges e.g. 2001/02..2010/11
38
+ if season_str.index( '..' )
39
+ fst,snd = season_str.split( '..' )
40
+ # pp [fst,snd]
41
+ fst = Season.parse( fst )
42
+ snd = Season.parse( snd )
43
+ if fst < snd && fst.year? == snd.year?
44
+ datasets[-1][1] += (fst..snd).to_a
45
+ else
46
+ raise ArgumentError, "parse error - invalid season range >#{str}<, 1) two seasons required, 2) first < second, 3) same (year/academic) type"
47
+ end
48
+ else
49
+ season = Season.parse( season_str ) ## check season
50
+ datasets[-1][1] << season
51
+ end
39
52
  end
40
53
  end
41
54
  datasets
42
55
  end
43
56
 
57
+
44
58
  def self.read( path )
45
59
  parse( read_text( path ))
46
60
  end
@@ -63,6 +63,10 @@ class Timezone ## nested inside UTC
63
63
  @zone = zone
64
64
  end
65
65
 
66
+ def name() @zone.name; end
67
+ def dst?() @zone.dst?; end
68
+
69
+
66
70
  def to_local( time )
67
71
  ## assert time is Time (not Date or DateTIme)
68
72
  ## and assert utc!!!
@@ -98,7 +102,17 @@ end # module UTC
98
102
 
99
103
 
100
104
  module TimezoneHelper
105
+
101
106
  def find_zone!( league:, season: )
107
+ zone = find_zone( league: league, season: season )
108
+ if zone.nil? ## still not found; report error
109
+ puts "!! ERROR: no timezone found for #{league} #{season}"
110
+ exit 1
111
+ end
112
+ zone
113
+ end
114
+
115
+ def find_zone( league:, season: )
102
116
  ## note: do NOT pass in league struct! pass in key (string)
103
117
  raise ArgumentError, "league key as string|symbol expected" unless league.is_a?(String) || league.is_a?(Symbol)
104
118
 
@@ -143,11 +157,6 @@ def find_zone!( league:, season: )
143
157
  zone = @zones[code]
144
158
  end
145
159
 
146
- if zone.nil? ## still not found; report error
147
- puts "!! ERROR: no timezone found for #{league} #{season}"
148
- exit 1
149
- end
150
-
151
160
  zone
152
161
  end
153
162
  end # module TimezoneHelper
@@ -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 = 2
7
- PATCH = 0
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: football-timezones
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.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-09-15 00:00:00.000000000 Z
11
+ date: 2024-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo