et-orbi 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: et-orbi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-14 00:00:00.000000000 Z
11
+ date: 2019-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo
@@ -66,8 +66,11 @@ files:
66
66
  - README.md
67
67
  - et-orbi.gemspec
68
68
  - lib/et-orbi.rb
69
- - lib/et-orbi/eo_time.rb
70
- - lib/et-orbi/zone_aliases.rb
69
+ - lib/et-orbi/info.rb
70
+ - lib/et-orbi/make.rb
71
+ - lib/et-orbi/time.rb
72
+ - lib/et-orbi/zone.rb
73
+ - lib/et-orbi/zones.rb
71
74
  - lib/et_orbi.rb
72
75
  - lib/etorbi.rb
73
76
  homepage: http://github.com/floraison/et-orbi
@@ -1,121 +0,0 @@
1
-
2
- module EtOrbi
3
-
4
- def self.unalias(name)
5
-
6
- return name unless (name.match(/./) rescue nil)
7
-
8
- ZONE_ALIASES[name.sub(/ Daylight /, ' Standard ')] ||
9
- unzz(name) ||
10
- name
11
- end
12
-
13
- def self.unzz(name)
14
-
15
- m = name.match(/\A([A-Z]{3,4})([+-])(\d{1,2}):?(\d{2})?\z/)
16
- return nil unless m
17
-
18
- abbs = [ m[1] ]; a = m[1]
19
- abbs << "#{a}T" if a.size < 4
20
-
21
- off = (m[2] == '+' ? 1 : -1) * (m[3].to_i * 3600 + (m[4] || '0').to_i * 60)
22
-
23
- t = Time.now
24
- twin = Time.utc(t.year, 1, 1) # winter
25
- tsum = Time.utc(t.year, 7, 1) # summer
26
-
27
- (@tz_all ||= ::TZInfo::Timezone.all)
28
- .each { |tz|
29
- abbs.each { |abb|
30
- per = tz.period_for_utc(twin)
31
- return tz.name \
32
- if per.abbreviation.to_s == abb && per.utc_total_offset == off
33
- per = tz.period_for_utc(tsum)
34
- return tz.name \
35
- if per.abbreviation.to_s == abb && per.utc_total_offset == off } }
36
-
37
- nil
38
- end
39
-
40
- # https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones
41
- # https://support.microsoft.com/en-ca/help/973627/microsoft-time-zone-index-values
42
- # https://ss64.com/nt/timezones.html
43
-
44
- ZONE_ALIASES = {
45
- 'Coordinated Universal Time' => 'UTC',
46
- 'Afghanistan Standard Time' => 'Asia/Kabul',
47
- 'FLE Standard Time' => 'Europe/Helsinki',
48
- 'Central Europe Standard Time' => 'Europe/Prague',
49
- 'UTC-11' => 'Etc/GMT+11',
50
- 'W. Europe Standard Time' => 'Europe/Rome',
51
- 'W. Central Africa Standard Time' => 'Africa/Lagos',
52
- 'SA Western Standard Time' => 'America/La_Paz',
53
- 'Pacific SA Standard Time' => 'America/Santiago',
54
- 'Argentina Standard Time' => 'America/Argentina/Buenos_Aires',
55
- 'Caucasus Standard Time' => 'Asia/Yerevan',
56
- 'AUS Eastern Standard Time' => 'Australia/Sydney',
57
- 'Azerbaijan Standard Time' => 'Asia/Baku',
58
- 'Eastern Standard Time' => 'America/New_York',
59
- 'Arab Standard Time' => 'Asia/Riyadh',
60
- 'Bangladesh Standard Time' => 'Asia/Dhaka',
61
- 'Belarus Standard Time' => 'Europe/Minsk',
62
- 'Romance Standard Time' => 'Europe/Paris',
63
- 'Central America Standard Time' => 'America/Belize',
64
- 'Atlantic Standard Time' => 'Atlantic/Bermuda',
65
- 'Venezuela Standard Time' => 'America/Caracas',
66
- 'Central European Standard Time' => 'Europe/Warsaw',
67
- 'South Africa Standard Time' => 'Africa/Johannesburg',
68
- #'UTC' => 'Etc/UTC', # 'UTC' is good as is
69
- 'E. South America Standard Time' => 'America/Sao_Paulo',
70
- 'Central Asia Standard Time' => 'Asia/Almaty',
71
- 'Singapore Standard Time' => 'Asia/Singapore',
72
- 'Greenwich Standard Time' => 'Africa/Monrovia',
73
- 'Cape Verde Standard Time' => 'Atlantic/Cape_Verde',
74
- 'SE Asia Standard Time' => 'Asia/Bangkok',
75
- 'SA Pacific Standard Time' => 'America/Bogota',
76
- 'China Standard Time' => 'Asia/Shanghai',
77
- 'Myanmar Standard Time' => 'Asia/Yangon',
78
- 'E. Africa Standard Time' => 'Africa/Nairobi',
79
- 'Hawaiian Standard Time' => 'Pacific/Honololu',
80
- 'E. Europe Standard Time' => 'Europe/Nicosia',
81
- 'Tokyo Standard Time' => 'Asia/Tokyo',
82
- 'Egypt Standard Time' => 'Africa/Cairo',
83
- 'SA Eastern Standard Time' => 'America/Cayenne',
84
- 'GMT Standard Time' => 'Europe/London',
85
- 'Fiji Standard Time' => 'Pacific/Fiji',
86
- 'West Asia Standard Time' => 'Asia/Tashkent',
87
- 'Georgian Standard Time' => 'Asia/Tbilisi',
88
- 'GTB Standard Time' => 'Europe/Athens',
89
- 'Greenland Standard Time' => 'America/Godthab',
90
- 'West Pacific Standard Time' => 'Pacific/Guam',
91
- 'Mauritius Standard Time' => 'Indian/Mauritius',
92
- 'India Standard Time' => 'Asia/Kolkata',
93
- 'Iran Standard Time' => 'Asia/Tehran',
94
- 'Arabic Standard Time' => 'Asia/Baghdad',
95
- 'Israel Standard Time' => 'Asia/Jerusalem',
96
- 'Jordan Standard Time' => 'Asia/Amman',
97
- 'UTC+12' => 'Etc/GMT-12',
98
- 'Korea Standard Time' => 'Asia/Seoul',
99
- 'Middle East Standard Time' => 'Asia/Beirut',
100
- 'Central Standard Time (Mexico)' => 'America/Mexico_City',
101
- 'Ulaanbaatar Standard Time' => 'Asia/Ulaanbaatar',
102
- 'Morocco Standard Time' => 'Africa/Casablanca',
103
- 'Namibia Standard Time' => 'Africa/Windhoek',
104
- 'Nepal Standard Time' => 'Asia/Kathmandu',
105
- 'Central Pacific Standard Time' => 'Etc/GMT-11',
106
- 'New Zealand Standard Time' => 'Pacific/Auckland',
107
- 'Arabian Standard Time' => 'Asia/Dubai',
108
- 'Pakistan Standard Time' => 'Asia/Karachi',
109
- 'Paraguay Standard Time' => 'America/Asuncion',
110
- 'Pacific Standard Time' => 'America/Los_Angeles',
111
- 'Russian Standard Time' => 'Europe/Moscow',
112
- 'Samoa Standard Time' => 'Pacific/Pago_Pago',
113
- 'UTC-02' => 'Etc/GMT+2',
114
- 'Sri Lanka Standard Time' => 'Asia/Kolkata',
115
- 'Syria Standard Time' => 'Asia/Damascus',
116
- 'Taipei Standard Time' => 'Asia/Taipei',
117
- 'Tonga Standard Time' => 'Pacific/Tongatapu',
118
- 'Turkey Standard Time' => 'Asia/Istanbul',
119
- 'Montevideo Standard Time' => 'America/Montevideo' }
120
- end
121
-