TimezoneParser 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: 18789091be6be2c439379c82e6942ec61fcf6134
4
- data.tar.gz: 51125b6160160c75006e86174656bf2b6dcf7877
3
+ metadata.gz: 0cd2f7add9bd7865eabb212a3eb738681ceab43c
4
+ data.tar.gz: 9db1c17a8894110d2e6fcde60077ff30296a39a6
5
5
  SHA512:
6
- metadata.gz: c6b429795532b59a6ac5b91ef501d70b98d22813e74a3942ecaab2ae021976f3efe33440b1ea5499845d0288bb99ab5e8c11d43a965f5808d6bde84000ad2dd8
7
- data.tar.gz: 5018193aad38c2b479089eb95a217644f6cbe6846fe049b7de080edc6f91fec1acd6ad355c45dfaea645682ca90d6e12ac492da2bc4ae3a65967c621e1c696d1
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
- offsets.merge!(TimezoneParser::Windows.getMUIOffsets)
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
@@ -1561,13 +1561,13 @@
1561
1561
  Name: Libya Standard Time
1562
1562
  1820:
1563
1563
  Type: display
1564
- Name: Russia TZ 1 Standard Time
1564
+ Name: Kaliningrad Standard Time
1565
1565
  1830:
1566
1566
  Type: display
1567
- Name: Russia TZ 2 Standard Time
1567
+ Name: Russian Standard Time
1568
1568
  1840:
1569
1569
  Type: display
1570
- Name: Russia TZ 4 Standard Time
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: Russia TZ 6 Standard Time
1582
+ Name: North Asia Standard Time
1583
1583
  1870:
1584
1584
  Type: display
1585
- Name: Russia TZ 7 Standard Time
1585
+ Name: North Asia East Standard Time
1586
1586
  1880:
1587
1587
  Type: display
1588
- Name: Russia TZ 8 Standard Time
1588
+ Name: Yakutsk Standard Time
1589
1589
  1890:
1590
1590
  Type: display
1591
- Name: Russia TZ 3 Standard Time
1591
+ Name: Russia Time Zone 3
1592
1592
  1910:
1593
1593
  Type: display
1594
- Name: Russia TZ 10 Standard Time
1594
+ Name: Russia Time Zone 10
1595
1595
  1930:
1596
1596
  Type: display
1597
- Name: Russia TZ 11 Standard Time
1597
+ Name: Russia Time Zone 11
1598
1598
  1950:
1599
1599
  Type: display
1600
- Name: Russia TZ 9 Standard Time
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
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  module TimezoneParser
3
3
  # Version
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
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.1
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 00:00:00.000000000 Z
11
+ date: 2017-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo