football-timezones 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/config/timezones_asia.csv +1 -1
- data/config/timezones_europe.csv +43 -32
- data/config/timezones_world.csv +6 -0
- data/lib/football-timezones/datasets.rb +16 -2
- data/lib/football-timezones/timezones.rb +14 -5
- data/lib/football-timezones/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16541cdfc3acf1a1c6ce0c68c1568ae4d3cce227fad1dc104e49fcc4de2e76ba
|
4
|
+
data.tar.gz: 4e58666b1bd4f8297449590b9a8ac6056e22955a73144e67da6a3cb326cdc6e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e65d3e3be642d9a20930076ae6bca3369240563c667aae9ec955294757e77b9120d59de27d017d4ef1eb9442eb4b74b0ef65d097ee323f48b3781e5e469c2705
|
7
|
+
data.tar.gz: cbf7b6163329f452014de4a8fb7c8178f8f036c0c4c70e91a28bd971fa43c8b02e45e1ab8b0882696c45ccf51aa67c1f161f00650b414cc8b64896e03367d591
|
data/CHANGELOG.md
CHANGED
data/config/timezones_asia.csv
CHANGED
data/config/timezones_europe.csv
CHANGED
@@ -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
|
-
|
11
|
+
pt, Europe/Lisbon
|
12
|
+
gi, Europe/Gibraltar
|
13
|
+
ad, Europe/Andorra
|
14
|
+
|
9
15
|
fr, Europe/Paris
|
10
|
-
|
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
|
-
|
82
|
-
uefa.cl,
|
83
|
-
uefa.
|
84
|
-
uefa.
|
85
|
-
uefa.
|
86
|
-
|
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
|
|
data/config/timezones_world.csv
CHANGED
@@ -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
|
-
|
38
|
-
|
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
|
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.
|
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: 2024-09-
|
11
|
+
date: 2024-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzinfo
|