TimezoneParser 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -1
- data/data/windows_tzres.yaml +10 -10
- data/lib/timezone_parser/data/windows.rb +16 -0
- data/lib/timezone_parser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cd2f7add9bd7865eabb212a3eb738681ceab43c
|
4
|
+
data.tar.gz: 9db1c17a8894110d2e6fcde60077ff30296a39a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2973864779926a11b8ddcb63cbedba4d78a315692257c0e11f6596a35b83e3ea947cb07ae29dbf7fae0101f1200497752e55b7e089f37a9466fba6cf8e79834
|
7
|
+
data.tar.gz: cee3e66b241e26837b60b5dd39b4a38b528f0994186cf7fb1c6a407f35fa9fd27dc9fe4269cf7824c308b48602a35b4aba9feaabce9b04ac56fc4612aae3392a
|
data/Rakefile
CHANGED
@@ -98,7 +98,7 @@ def update_windows_mui
|
|
98
98
|
tzres = data_location + 'windows_tzres.yaml'
|
99
99
|
require 'timezone_parser/data/windows'
|
100
100
|
offsets = YAML.load_file(tzres)
|
101
|
-
|
101
|
+
offsets.merge!(TimezoneParser::Windows.getMUIOffsets)
|
102
102
|
write_yaml(tzres, offsets)
|
103
103
|
else
|
104
104
|
puts 'Can update Windows tzres MUI offsets only from Windows!'
|
@@ -111,6 +111,9 @@ def update_windows_mui_extended(metazones, locales)
|
|
111
111
|
offsets.merge!(TimezoneParser::Windows.collectMUIOffsets(metazones, locales))
|
112
112
|
write_yaml(tzres, offsets)
|
113
113
|
update_windows_mui
|
114
|
+
offsets = YAML.load_file(tzres)
|
115
|
+
TimezoneParser::Windows.correctMUIOffsetNames(offsets, metazones, locales)
|
116
|
+
write_yaml(tzres, offsets)
|
114
117
|
end
|
115
118
|
|
116
119
|
def import_timezones
|
data/data/windows_tzres.yaml
CHANGED
@@ -1561,13 +1561,13 @@
|
|
1561
1561
|
Name: Libya Standard Time
|
1562
1562
|
1820:
|
1563
1563
|
Type: display
|
1564
|
-
Name:
|
1564
|
+
Name: Kaliningrad Standard Time
|
1565
1565
|
1830:
|
1566
1566
|
Type: display
|
1567
|
-
Name:
|
1567
|
+
Name: Russian Standard Time
|
1568
1568
|
1840:
|
1569
1569
|
Type: display
|
1570
|
-
Name:
|
1570
|
+
Name: Ekaterinburg Standard Time
|
1571
1571
|
1850:
|
1572
1572
|
Type: display
|
1573
1573
|
Name: Russia TZ 5 Standard Time
|
@@ -1579,22 +1579,22 @@
|
|
1579
1579
|
Name: Russia TZ 5 Standard Time
|
1580
1580
|
1860:
|
1581
1581
|
Type: display
|
1582
|
-
Name:
|
1582
|
+
Name: North Asia Standard Time
|
1583
1583
|
1870:
|
1584
1584
|
Type: display
|
1585
|
-
Name:
|
1585
|
+
Name: North Asia East Standard Time
|
1586
1586
|
1880:
|
1587
1587
|
Type: display
|
1588
|
-
Name:
|
1588
|
+
Name: Yakutsk Standard Time
|
1589
1589
|
1890:
|
1590
1590
|
Type: display
|
1591
|
-
Name: Russia
|
1591
|
+
Name: Russia Time Zone 3
|
1592
1592
|
1910:
|
1593
1593
|
Type: display
|
1594
|
-
Name: Russia
|
1594
|
+
Name: Russia Time Zone 10
|
1595
1595
|
1930:
|
1596
1596
|
Type: display
|
1597
|
-
Name: Russia
|
1597
|
+
Name: Russia Time Zone 11
|
1598
1598
|
1950:
|
1599
1599
|
Type: display
|
1600
|
-
Name:
|
1600
|
+
Name: Vladivostok Standard Time
|
@@ -114,6 +114,22 @@ module TimezoneParser
|
|
114
114
|
data['Name'] = baseMetazone[(id / 10) * 10 + type_base + types.index('standard')]
|
115
115
|
offsets[id] = data unless data['Name'].nil?
|
116
116
|
end
|
117
|
+
Hash[offsets.to_a.sort_by { |o| o.first }]
|
118
|
+
end
|
119
|
+
|
120
|
+
def self.correctMUIOffsetNames(offsets, metazoneList, locales)
|
121
|
+
enUS = locales.key('en-US')
|
122
|
+
baseMetazone = metazoneList[enUS]
|
123
|
+
offsets.each do |id, data|
|
124
|
+
actualMetazone = nil
|
125
|
+
baseMetazone.each do |zoneid, name|
|
126
|
+
if id != zoneid and name == data['Name']
|
127
|
+
actualMetazone = offsets[zoneid]['Name']
|
128
|
+
break
|
129
|
+
end
|
130
|
+
end
|
131
|
+
data['Name'] = actualMetazone if actualMetazone
|
132
|
+
end
|
117
133
|
offsets
|
118
134
|
end
|
119
135
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: TimezoneParser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dāvis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzinfo
|