football-timezones 0.0.1 → 0.1.0

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: f628a9691af73e5ab5f28f1be1cd09bae28ecf6e064e7efc4cb91867c182bf0a
4
- data.tar.gz: 6273d92f3482d84bf785b6c161e4b71cf84172802c3ad40ffe3119f45c7f5fdf
3
+ metadata.gz: e08f96e81b26f14812a27466a51ac335efe52c84f2178d6401e602e27dae2d85
4
+ data.tar.gz: 4d16d94cde0365e2ae50ecb0b365c5070330317ee21af883a941b1cc73c2878c
5
5
  SHA512:
6
- metadata.gz: 6424048a8a71b877fe32a3ed0278b79391f04cfea1836e09750a64aadc246f6a2df5e57560e0ff3e502b78b26a286843636b18520f346c7add1afe85bfe6e9fe
7
- data.tar.gz: 9091b37b0f6ef280c1927b32299886318f401fbaa0c9c90da2a70d0542351ab67190e2bc9ea5f946de7557c03d279cf2983eb9cd8a75ba2e70ab0062e4c4ba68
6
+ metadata.gz: a44e465c38195500850d1ec8fdae58a896f7c238d4fe146d7f263bc2ede1b58fb3b25f497d86173665e5545ea1ddeb021c954571b1b030d9c06dcca695266539
7
+ data.tar.gz: d280c9f264fdb0f5dadb5b49d0cd92f925887975be4fffe24582eb00387509db240193e5adcd335ef12682b2d14026611524ac5a981b40a8617161c33d186eb1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ ### 0.1.0
2
+
1
3
  ### 0.0.1 / 2024-09-11
2
4
 
3
5
  * Everything is new. First release.
data/Manifest.txt CHANGED
@@ -6,6 +6,8 @@ config/timezones_africa.csv
6
6
  config/timezones_america.csv
7
7
  config/timezones_asia.csv
8
8
  config/timezones_europe.csv
9
+ config/timezones_middle_east.csv
10
+ config/timezones_pacific.csv
9
11
  config/timezones_world.csv
10
12
  lib/football-timezones.rb
11
13
  lib/football-timezones/version.rb
@@ -1,4 +1,17 @@
1
1
  key, zone
2
2
 
3
- eg, Africa/Cairo # +3 (gmt+3)
3
+ eg, Africa/Cairo
4
+
5
+ dz, Africa/Algiers
6
+
7
+ ma, Africa/Casablanca
8
+
9
+ za, Africa/Johannesburg
10
+
11
+
12
+ ng, Africa/Lagos
13
+
14
+ ke, Africa/Nairobi
15
+
16
+
4
17
 
@@ -1,29 +1,30 @@
1
1
  key, zone
2
2
 
3
3
 
4
- us, America/New_York # (gmt-5) new york
4
+ us, America/New_York
5
5
  ca, America/Toronto
6
6
 
7
7
  mx, America/Mexico_City
8
8
 
9
9
 
10
- cr, America/Costa_Rica # gmt-6
11
- gt, America/Guatemala # gmt-6
12
- hn, America/Tegucigalpa # gmt-6
13
- sv, America/El_Salvador # gmt-6
14
- ni, America/Managua # gmt-6
10
+ cr, America/Costa_Rica
11
+ gt, America/Guatemala
12
+ hn, America/Tegucigalpa
13
+ sv, America/El_Salvador
14
+ ni, America/Managua
15
15
 
16
- uy, America/Montevideo # gmt-3
17
- pe, America/Lima # gmt-5
18
- ec, America/Guayaquil # gmt-5
16
+ uy, America/Montevideo
17
+ pe, America/Lima
18
+ ec, America/Guayaquil
19
19
  co, America/Bogota
20
- bo, America/La_Paz # gmt-4
21
- cl, America/Santiago # gmt-4
20
+ bo, America/La_Paz
21
+ cl, America/Santiago
22
+ py, America/Asuncion
22
23
 
23
- br, America/Sao_Paulo # gmt-3 - change to -3?
24
- ar, America/Argentina/Buenos_Aires # gmt-3 - change to -3?
24
+ br, America/Sao_Paulo
25
+ ar, America/Argentina/Buenos_Aires
25
26
 
26
27
 
27
- concacaf.cl, America/Mexico_City ### use mx time
28
- copa.l, America/Sao_Paulo ### use brazil time
28
+ concacaf.cl, America/Mexico_City ### use mx time - why? why not?
29
+ copa.l, America/Sao_Paulo ### use brazil time - why? why not?
29
30
 
@@ -1,8 +1,8 @@
1
1
  key, zone
2
2
 
3
- jp, Asia/Tokyo # +9 (gmt+9)
3
+ jp, Asia/Tokyo
4
4
  kr, Asia/Seoul
5
- cn, Asia/Shanghai # +7 (gmt+7)
5
+ cn, Asia/Shanghai
6
6
 
7
7
 
8
8
 
@@ -9,39 +9,79 @@ de, Europe/Berlin
9
9
  fr, Europe/Paris
10
10
  it, Europe/Rome
11
11
 
12
- pt, Europe/Lisbon
12
+ sm, Europe/San_Marino
13
+ va, Europe/Vatican
13
14
 
14
15
 
16
+ pt, Europe/Lisbon
17
+ ad, Europe/Andorra
18
+ gi, Europe/Gibraltar
19
+ mc, Europe/Monaco
15
20
 
16
21
 
17
- fi, Europe/Helsinki # +2
22
+ cy, Asia/Nicosia
23
+ mt, Europe/Malta
18
24
  gr, Europe/Athens
25
+ tr, Europe/Istanbul
19
26
  ro, Europe/Bucharest
27
+ bg, Europe/Sofia
20
28
  ua, Europe/Kyiv
29
+ ru, Europe/Moscow
30
+ by, Europe/Minsk
31
+
21
32
 
22
33
 
23
- ru, Europe/Moscow
24
- tr, Europe/Istanbul # +3 turkey time/moscow time
25
34
 
26
35
  at, Europe/Vienna
27
36
  ch, Europe/Zurich
37
+ li, Europe/Vaduz
38
+
28
39
  hu, Europe/Budapest
29
40
  cz, Europe/Prague
30
41
  sk, Europe/Bratislava # link to Prague !!!
42
+ si, Europe/Ljubljana
43
+ mk, Europe/Skopje
44
+
45
+
31
46
  pl, Europe/Warsaw
47
+
32
48
  be, Europe/Brussels
33
49
  lu, Europe/Luxembourg # link to Brussels !!!
34
50
  nl, Europe/Amsterdam # link to Brussels !!!
35
51
 
36
52
 
37
- dk, Europe/Berlin ## check if country-specific available
38
- se, Europe/Berlin ## check if country-specific available
39
- hr, Europe/Belgrade ## check if country-specific available
53
+
54
+ is, Iceland
55
+
56
+
57
+ dk, Europe/Copenhagen ## link to Berlin
58
+ se, Europe/Stockholm ## link to Berlin
59
+ no, Europe/Oslo # link to Berlin
60
+ fi, Europe/Helsinki
61
+
62
+ lv, Europe/Riga
63
+ ee, Europe/Tallinn
64
+ lt, Europe/Vilnius
65
+
66
+
67
+
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
+
40
78
 
41
79
 
42
80
 
43
81
  ## for champs default for not to cet (central european time) - why? why not?
44
- uefa.cl, Europe/Paris
45
- uefa.el, Europe/Paris
46
- euro, Europe/Paris
82
+ uefa.cl, Europe/Paris
83
+ uefa.el, Europe/Paris
84
+ uefa.conf, Europe/Paris
85
+ uefa.nl, Europe/Paris
86
+ euro, Europe/Paris
47
87
 
@@ -0,0 +1,5 @@
1
+ key, zone
2
+
3
+ il, Asia/Jerusalem
4
+
5
+
@@ -0,0 +1,5 @@
1
+ key, zone
2
+
3
+
4
+ au, Australia/Sydney
5
+ nz, Pacific/Auckland
@@ -1,4 +1,13 @@
1
1
  key, zone
2
2
 
3
3
 
4
- ## world+2022, add quatar here
4
+ world+2022, Asia/Qatar # Qatar
5
+ world+2018, Europe/Moscow # Russia
6
+ world+2014, America/Sao_Paulo # Brazil
7
+ world+2010, Africa/Johannesburg # South Africa
8
+ world+2006, Europe/Berlin # Germany
9
+ world+2002, Asia/Tokyo # Japan & South Korea
10
+ world+1998, Europe/Paris # France
11
+
12
+
13
+
@@ -3,8 +3,8 @@ module SportDb
3
3
  module Module
4
4
  module Timezones
5
5
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
6
- MINOR = 0
7
- PATCH = 1
6
+ MINOR = 1
7
+ PATCH = 0
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
@@ -84,13 +84,16 @@ class Timezone ## nested inside UTC
84
84
  end
85
85
 
86
86
  def local_time( year, month=1, mday=1, hour=0, min=0, sec=0 )
87
- @zone.local_time( year, month, mday, hour, min, sec )
87
+ ## add auto-fix for ambigious time (dst vs non-dst)
88
+ ## always select first for now (that is, dst)
89
+ @zone.local_time( year, month, mday, hour, min, sec ) {|time| time.first }
88
90
  end
89
91
 
90
92
  def now() @zone.now; end
91
93
 
92
94
 
93
95
 
96
+
94
97
  def assert( cond, msg )
95
98
  if cond
96
99
  # do nothing
@@ -107,11 +110,17 @@ end # module UTC
107
110
 
108
111
  module TimezoneHelper
109
112
  def find_zone!( league:, season: )
113
+ ## note: do NOT pass in league struct! pass in key (string)
114
+ raise ArgumentError, "league key as string|symbol expected" unless league.is_a?(String) || league.is_a?(Symbol)
115
+
110
116
  @zones ||= begin
111
117
  zones = {}
112
- ['timezones_america',
118
+ ['timezones_africa',
119
+ 'timezones_america',
113
120
  'timezones_asia',
114
121
  'timezones_europe',
122
+ 'timezones_middle_east',
123
+ 'timezones_pacific',
115
124
  'timezones_world',].each do |name|
116
125
  recs = read_csv( "#{SportDb::Module::Timezones.root}/config/#{name}.csv" )
117
126
  recs.each do |rec|
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.0.1
4
+ version: 0.1.0
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 00:00:00.000000000 Z
11
+ date: 2024-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo
@@ -103,6 +103,8 @@ files:
103
103
  - config/timezones_america.csv
104
104
  - config/timezones_asia.csv
105
105
  - config/timezones_europe.csv
106
+ - config/timezones_middle_east.csv
107
+ - config/timezones_pacific.csv
106
108
  - config/timezones_world.csv
107
109
  - lib/football-timezones.rb
108
110
  - lib/football-timezones/version.rb