tzinfo 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of tzinfo might be problematic. Click here for more details.

Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/CHANGES.md +10 -0
  5. data/lib/tzinfo/country_info.rb +8 -2
  6. data/lib/tzinfo/data_source.rb +10 -6
  7. data/lib/tzinfo/data_timezone_info.rb +9 -3
  8. data/lib/tzinfo/ruby_data_source.rb +1 -1
  9. data/lib/tzinfo/timezone.rb +9 -5
  10. data/lib/tzinfo/timezone_info.rb +7 -1
  11. data/lib/tzinfo/timezone_transition.rb +7 -1
  12. data/lib/tzinfo/zoneinfo_data_source.rb +1 -1
  13. data/lib/tzinfo/zoneinfo_timezone_info.rb +39 -6
  14. data/test/tc_timezone_london.rb +9 -16
  15. data/test/tc_zoneinfo_timezone_info.rb +146 -14
  16. data/test/tzinfo-data/tzinfo/data.rb +7 -0
  17. data/test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb +2 -0
  18. data/test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb +2 -0
  19. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb +2 -0
  20. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb +2 -0
  21. data/test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb +2 -0
  22. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb +2 -0
  23. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb +2 -0
  24. data/test/tzinfo-data/tzinfo/data/indexes/countries.rb +9 -11
  25. data/test/tzinfo-data/tzinfo/data/indexes/timezones.rb +16 -21
  26. data/test/tzinfo-data/tzinfo/data/version.rb +1 -1
  27. data/test/zoneinfo/America/Argentina/Buenos_Aires +0 -0
  28. data/test/zoneinfo/America/New_York +0 -0
  29. data/test/zoneinfo/Australia/Melbourne +0 -0
  30. data/test/zoneinfo/EST +0 -0
  31. data/test/zoneinfo/Etc/UTC +0 -0
  32. data/test/zoneinfo/Europe/Amsterdam +0 -0
  33. data/test/zoneinfo/Europe/Andorra +0 -0
  34. data/test/zoneinfo/Europe/London +0 -0
  35. data/test/zoneinfo/Europe/Paris +0 -0
  36. data/test/zoneinfo/Europe/Prague +0 -0
  37. data/test/zoneinfo/Factory +0 -0
  38. data/test/zoneinfo/iso3166.tab +12 -13
  39. data/test/zoneinfo/posix/Europe/London +0 -0
  40. data/test/zoneinfo/posixrules +0 -0
  41. data/test/zoneinfo/right/Europe/London +0 -0
  42. data/test/zoneinfo/zone.tab +25 -17
  43. data/tzinfo.gemspec +1 -1
  44. metadata +2 -2
  45. metadata.gz.sig +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e48380a40bf9c0b26cf7b925cbe0eef6d198130c
4
- data.tar.gz: d2fbd737fd05d0e56d8835ab85f1de51338971a6
3
+ metadata.gz: 50a3eb0b5e727ec5ef5cfc93577f18fa28924512
4
+ data.tar.gz: 8de5a649d264b57190e65f2ba9728a123f7a5167
5
5
  SHA512:
6
- metadata.gz: 2a631f6a845f0547389417def1880190f16d7d761d75dcbf940c9c15cc96b884f3f30f5afce7ac76ac64361ae020158615096fa7e48897e2b635e5249827be8a
7
- data.tar.gz: e06467b2b159ce423db5d2ef55c5eab9f2ee3c7f912b58268ea160d1047da576af46613378aa6a2b7d579ca6a4365edb036597f7fa9e85a5261e4768578862c5
6
+ metadata.gz: 602840d66f927274773a40f22e1807e4280fee76b7b5098db8e739b0041b7a26af9f225f8c4e591f5b2f5baac5a3c0a597204f195edfd6805beca17e606ab4de
7
+ data.tar.gz: 0b53e4209bfde4cfd326e8b22ebe5750e6e293f486c4420ff517eff9015f2329340de343ad7d489d32df4c96e1eab9f988a056c3b323bcda73d3978c84d2dcc3
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGES.md CHANGED
@@ -1,3 +1,13 @@
1
+ Version 1.2.1 - 1-Jun-2014
2
+ --------------------------
3
+
4
+ * Support zoneinfo files generated with zic version 2014c and later.
5
+ * On platforms that only support positive 32-bit timestamps, ensure that
6
+ conversions are accurate from the epoch instead of just from the first
7
+ transition after the epoch.
8
+ * Minor documentation improvements.
9
+
10
+
1
11
  Version 1.2.0 - 26-May-2014
2
12
  ---------------------------
3
13
 
@@ -22,7 +22,7 @@ module TZInfo
22
22
  # Returns a frozen array of all the zone identifiers for the country.
23
23
  # The identifiers are ordered by importance according to the DataSource.
24
24
  def zone_identifiers
25
- raise NotImplementedError, 'Subclasses must override zone_identifiers'
25
+ raise_not_implemented('zone_identifiers')
26
26
  end
27
27
 
28
28
  # Returns a frozen array of all the timezones for the for the country as
@@ -30,7 +30,13 @@ module TZInfo
30
30
  #
31
31
  # The timezones are ordered by importance according to the DataSource.
32
32
  def zones
33
- raise NotImplementedError, 'Subclasses must override zone_identifiers'
33
+ raise_not_implemented('zones')
34
+ end
35
+
36
+ private
37
+
38
+ def raise_not_implemented(method_name)
39
+ raise NotImplementedError, "Subclasses must override #{method_name}"
34
40
  end
35
41
  end
36
42
  end
@@ -118,37 +118,37 @@ module TZInfo
118
118
  # Raises InvalidTimezoneIdentifier if the timezone is not found or the
119
119
  # identifier is invalid.
120
120
  def load_timezone_info(identifier)
121
- raise InvalidDataSource, 'load_timezone_info not defined'
121
+ raise_invalid_data_source('load_timezone_info')
122
122
  end
123
123
 
124
124
  # Returns an array of all the available timezone identifiers.
125
125
  def timezone_identifiers
126
- raise InvalidDataSource, 'timezone_identifiers not defined'
126
+ raise_invalid_data_source('timezone_identifiers')
127
127
  end
128
128
 
129
129
  # Returns an array of all the available timezone identifiers for
130
130
  # data timezones (i.e. those that actually contain definitions).
131
131
  def data_timezone_identifiers
132
- raise InvalidDataSource, 'data_timezone_identifiers not defined'
132
+ raise_invalid_data_source('data_timezone_identifiers')
133
133
  end
134
134
 
135
135
  # Returns an array of all the available timezone identifiers that
136
136
  # are links to other timezones.
137
137
  def linked_timezone_identifiers
138
- raise InvalidDataSource, 'linked_timezone_identifiers not defined'
138
+ raise_invalid_data_source('linked_timezone_identifiers')
139
139
  end
140
140
 
141
141
  # Returns a CountryInfo instance for the given ISO 3166-1 alpha-2
142
142
  # country code. Raises InvalidCountryCode if the country could not be found
143
143
  # or the code is invalid.
144
144
  def load_country_info(code)
145
- raise InvalidDataSource, 'load_country_info not defined'
145
+ raise_invalid_data_source('load_country_info')
146
146
  end
147
147
 
148
148
  # Returns an array of all the available ISO 3166-1 alpha-2
149
149
  # country codes.
150
150
  def country_codes
151
- raise InvalidDataSource, 'country_codes not defined'
151
+ raise_invalid_data_source('country_codes')
152
152
  end
153
153
 
154
154
  # Returns the name of this DataSource.
@@ -182,5 +182,9 @@ module TZInfo
182
182
  raise DataSourceNotFound, "No source of timezone data could be found.\nPlease refer to http://tzinfo.github.io/datasourcenotfound for help resolving this error."
183
183
  end
184
184
  end
185
+
186
+ def raise_invalid_data_source(method_name)
187
+ raise InvalidDataSource, "#{method_name} not defined"
188
+ end
185
189
  end
186
190
  end
@@ -4,14 +4,14 @@ module TZInfo
4
4
 
5
5
  # Returns the TimezonePeriod for the given UTC time.
6
6
  def period_for_utc(utc)
7
- raise NotImplementedError, 'Subclasses must override period_for_utc'
7
+ raise_not_implemented('period_for_utc')
8
8
  end
9
9
 
10
10
  # Returns the set of TimezonePeriods for the given local time as an array.
11
11
  # Results returned are ordered by increasing UTC start date.
12
12
  # Returns an empty array if no periods are found for the given time.
13
13
  def periods_for_local(local)
14
- raise NotImplementedError, 'Subclasses must override periods_for_local'
14
+ raise_not_implemented('periods_for_local')
15
15
  end
16
16
 
17
17
  # Returns an Array of TimezoneTransition instances representing the times
@@ -37,7 +37,7 @@ module TZInfo
37
37
  # If utc_from is specified and utc_to is not greater than utc_from, then
38
38
  # transitions_up_to raises an ArgumentError exception.
39
39
  def transitions_up_to(utc_to, utc_from = nil)
40
- raise NotImplementedError, 'Subclasses must override transitions_up_to'
40
+ raise_not_implemented('transitions_up_to')
41
41
  end
42
42
 
43
43
  # Constructs a Timezone instance for the timezone represented by this
@@ -45,5 +45,11 @@ module TZInfo
45
45
  def create_timezone
46
46
  DataTimezone.new(self)
47
47
  end
48
+
49
+ private
50
+
51
+ def raise_not_implemented(method_name)
52
+ raise NotImplementedError, "Subclasses must override #{method_name}"
53
+ end
48
54
  end
49
55
  end
@@ -69,7 +69,7 @@ module TZInfo
69
69
  def load_country_info(code)
70
70
  load_country_index
71
71
  info = Data::Indexes::Countries.countries[code]
72
- raise InvalidCountryCode.new, 'Invalid country code' unless info
72
+ raise InvalidCountryCode, 'Invalid country code' unless info
73
73
  info
74
74
  end
75
75
 
@@ -199,7 +199,7 @@ module TZInfo
199
199
 
200
200
  # The identifier of the timezone, e.g. "Europe/Paris".
201
201
  def identifier
202
- raise UnknownTimezone, 'TZInfo::Timezone constructed directly'
202
+ raise_unknown_timezone
203
203
  end
204
204
 
205
205
  # An alias for identifier.
@@ -268,7 +268,7 @@ module TZInfo
268
268
  # a DateTime, Time or integer timestamp (Time.to_i). Any timezone
269
269
  # information in utc is ignored (it is treated as a UTC time).
270
270
  def period_for_utc(utc)
271
- raise UnknownTimezone, 'TZInfo::Timezone constructed directly'
271
+ raise_unknown_timezone
272
272
  end
273
273
 
274
274
  # Returns the set of TimezonePeriod instances that are valid for the given
@@ -276,7 +276,7 @@ module TZInfo
276
276
  # period_for_local instead and specify how ambiguities should be resolved.
277
277
  # Returns an empty array if no periods are found for the given time.
278
278
  def periods_for_local(local)
279
- raise UnknownTimezone, 'TZInfo::Timezone constructed directly'
279
+ raise_unknown_timezone
280
280
  end
281
281
 
282
282
  # Returns an Array of TimezoneTransition instances representing the times
@@ -302,7 +302,7 @@ module TZInfo
302
302
  # If utc_from is specified and utc_to is not greater than utc_from, then
303
303
  # transitions_up_to raises an ArgumentError exception.
304
304
  def transitions_up_to(utc_to, utc_from = nil)
305
- raise UnknownTimezone, 'TZInfo::Timezone constructed directly'
305
+ raise_unknown_timezone
306
306
  end
307
307
 
308
308
  # Returns the canonical Timezone instance for this Timezone.
@@ -341,7 +341,7 @@ module TZInfo
341
341
  # The TZInfo::DataSource.get method can be used to check which DataSource
342
342
  # implementation is being used.
343
343
  def canonical_zone
344
- raise UnknownTimezone, 'TZInfo::Timezone constructed directly'
344
+ raise_unknown_timezone
345
345
  end
346
346
 
347
347
  # Returns the TimezonePeriod for the given local time. local can either be
@@ -628,5 +628,9 @@ module TZInfo
628
628
  def self.data_source
629
629
  DataSource.get
630
630
  end
631
+
632
+ def raise_unknown_timezone
633
+ raise UnknownTimezone, 'TZInfo::Timezone constructed directly'
634
+ end
631
635
  end
632
636
  end
@@ -18,7 +18,13 @@ module TZInfo
18
18
  # Constructs a Timezone instance for the timezone represented by this
19
19
  # TimezoneInfo.
20
20
  def create_timezone
21
- raise NotImplementedError, 'Subclasses must override create_timezone'
21
+ raise_not_implemented('create_timezone')
22
+ end
23
+
24
+ private
25
+
26
+ def raise_not_implemented(method_name)
27
+ raise NotImplementedError, "Subclasses must override #{method_name}"
22
28
  end
23
29
  end
24
30
  end
@@ -21,7 +21,7 @@ module TZInfo
21
21
  # A TimeOrDateTime instance representing the UTC time when this transition
22
22
  # occurs.
23
23
  def at
24
- raise NotImplementedError, 'Subclasses must override at'
24
+ raise_not_implemented('at')
25
25
  end
26
26
 
27
27
  # The UTC time when this transition occurs, returned as a DateTime instance.
@@ -110,5 +110,11 @@ module TZInfo
110
110
  def inspect
111
111
  "#<#{self.class}: #{at.inspect},#{@offset.inspect}>"
112
112
  end
113
+
114
+ private
115
+
116
+ def raise_not_implemented(method_name)
117
+ raise NotImplementedError, "Subclasses must override #{method_name}"
118
+ end
113
119
  end
114
120
  end
@@ -240,7 +240,7 @@ module TZInfo
240
240
  # or the code is invalid.
241
241
  def load_country_info(code)
242
242
  info = @country_index[code]
243
- raise InvalidCountryCode.new, 'Invalid country code' unless info
243
+ raise InvalidCountryCode, 'Invalid country code' unless info
244
244
  info
245
245
  end
246
246
 
@@ -4,11 +4,21 @@ module TZInfo
4
4
  class InvalidZoneinfoFile < StandardError
5
5
  end
6
6
 
7
- # Represents a timezone defined by a compiled zoneinfo TZif (\0 or 2) file.
7
+ # Represents a timezone defined by a compiled zoneinfo TZif (\0, 2 or 3) file.
8
8
  #
9
9
  # @private
10
10
  class ZoneinfoTimezoneInfo < TransitionDataTimezoneInfo #:nodoc:
11
11
 
12
+ # Minimum supported timestamp (inclusive).
13
+ #
14
+ # Time.utc(1700, 1, 1).to_i
15
+ MIN_TIMESTAMP = -8520336000
16
+
17
+ # Maximum supported timestamp (exclusive).
18
+ #
19
+ # Time.utc(2500, 1, 1).to_i
20
+ MAX_TIMESTAMP = 16725225600
21
+
12
22
  # Constructs the new ZoneinfoTimezoneInfo with an identifier and path
13
23
  # to the file.
14
24
  def initialize(identifier, file_path)
@@ -30,7 +40,7 @@ module TZInfo
30
40
  # (most significant first). Translate to signed 64-bit
31
41
  def make_signed_int64(high, low)
32
42
  unsigned = (high << 32) | low
33
- unsigned > 0x8000000000000000 ? unsigned - 0x10000000000000000 : unsigned
43
+ unsigned >= 0x8000000000000000 ? unsigned - 0x10000000000000000 : unsigned
34
44
  end
35
45
 
36
46
  # Read bytes from file and check that the correct number of bytes could
@@ -92,7 +102,7 @@ module TZInfo
92
102
 
93
103
  if (version == '2' || version == '3') && RubyCoreSupport.time_supports_64bit
94
104
  # Skip the first 32-bit section and read the header of the second 64-bit section
95
- check_read(file, timecnt * 5 + typecnt * 6 + charcnt + leapcnt * 8 + ttisgmtcnt + ttisstdcnt)
105
+ file.seek(timecnt * 5 + typecnt * 6 + charcnt + leapcnt * 8 + ttisgmtcnt + ttisstdcnt, IO::SEEK_CUR)
96
106
 
97
107
  prev_version = version
98
108
 
@@ -194,15 +204,38 @@ module TZInfo
194
204
  offset first, offsets[first][:utc_offset], offsets[first][:std_offset], offsets[first][:abbr].untaint.to_sym
195
205
  end
196
206
 
197
-
198
-
199
207
  offsets.each_with_index do |o, i|
200
208
  offset i, o[:utc_offset], o[:std_offset], o[:abbr].untaint.to_sym unless i == first
201
209
  end
210
+
211
+ if !using_64bit && !RubyCoreSupport.time_supports_negative
212
+ # Filter out transitions that are not supported by Time on this
213
+ # platform.
214
+
215
+ # Move the last transition before the epoch up to the epoch. This
216
+ # allows for accurate conversions for all supported timestamps on the
217
+ # platform.
218
+
219
+ before_epoch, after_epoch = transitions.partition {|t| t[:at] < 0}
220
+
221
+ if before_epoch.length > 0 && after_epoch.length > 0 && after_epoch.first[:at] != 0
222
+ last_before = before_epoch.last
223
+ last_before[:at] = 0
224
+ transitions = [last_before] + after_epoch
225
+ else
226
+ transitions = after_epoch
227
+ end
228
+ end
202
229
 
230
+ # Ignore transitions that occur outside of a defined window. The
231
+ # transition index cannot handle a large range of transition times.
232
+ #
233
+ # This is primarily intended to ignore the far in the past transition
234
+ # added in zic 2014c (at timestamp -2**63 in zic 2014c and at the
235
+ # approximate time of the big bang from zic 2014d).
203
236
  transitions.each do |t|
204
237
  at = t[:at]
205
- if using_64bit || at > 0 || RubyCoreSupport.time_supports_negative
238
+ if at >= MIN_TIMESTAMP && at < MAX_TIMESTAMP
206
239
  time = Time.at(at).utc
207
240
  transition time.year, time.mon, t[:offset], at
208
241
  end
@@ -129,22 +129,15 @@ class TCTimezoneLondon < Minitest::Test
129
129
  end
130
130
 
131
131
  def test_time_boundary
132
- # This test cannot be run when using ZoneinfoDataSource on platforms
133
- # that don't support Times before the epoch (i.e. Ruby < 1.9 on Windows)
134
- # because it relates to the period following the transition prior to the
135
- # epoch.
132
+ #Europe/London Sat Oct 26 23:00:00 1968 UTC = Sun Oct 27 00:00:00 1968 GMT isdst=0 gmtoff=3600
133
+ #Europe/London Sun Oct 31 01:59:59 1971 UTC = Sun Oct 31 02:59:59 1971 GMT isdst=0 gmtoff=3600
136
134
 
137
- if !DataSource.get.kind_of?(ZoneinfoDataSource) || RubyCoreSupport.time_supports_negative
138
- #Europe/London Sat Oct 26 23:00:00 1968 UTC = Sun Oct 27 00:00:00 1968 GMT isdst=0 gmtoff=3600
139
- #Europe/London Sun Oct 31 01:59:59 1971 UTC = Sun Oct 31 02:59:59 1971 GMT isdst=0 gmtoff=3600
140
-
141
- tz = Timezone.get('Europe/London')
142
- assert_equal(DateTime.new(1970,1,1,1,0,0), tz.utc_to_local(DateTime.new(1970,1,1,0,0,0)))
143
- assert_equal(DateTime.new(1970,1,1,0,0,0), tz.local_to_utc(DateTime.new(1970,1,1,1,0,0)))
144
- assert_equal(Time.utc(1970,1,1,1,0,0), tz.utc_to_local(Time.utc(1970,1,1,0,0,0)))
145
- assert_equal(Time.utc(1970,1,1,0,0,0), tz.local_to_utc(Time.utc(1970,1,1,1,0,0)))
146
- assert_equal(3600, tz.utc_to_local(0))
147
- assert_equal(0, tz.local_to_utc(3600))
148
- end
135
+ tz = Timezone.get('Europe/London')
136
+ assert_equal(DateTime.new(1970,1,1,1,0,0), tz.utc_to_local(DateTime.new(1970,1,1,0,0,0)))
137
+ assert_equal(DateTime.new(1970,1,1,0,0,0), tz.local_to_utc(DateTime.new(1970,1,1,1,0,0)))
138
+ assert_equal(Time.utc(1970,1,1,1,0,0), tz.utc_to_local(Time.utc(1970,1,1,0,0,0)))
139
+ assert_equal(Time.utc(1970,1,1,0,0,0), tz.local_to_utc(Time.utc(1970,1,1,1,0,0)))
140
+ assert_equal(3600, tz.utc_to_local(0))
141
+ assert_equal(0, tz.local_to_utc(3600))
149
142
  end
150
143
  end
@@ -15,11 +15,19 @@ class TCZoneinfoTimezoneInfo < Minitest::Test
15
15
  SUPPORTS_64BIT = false
16
16
  end
17
17
 
18
+ begin
19
+ Time.at(-1)
20
+ Time.at(-2147483648)
21
+ SUPPORTS_NEGATIVE = true
22
+ rescue ArgumentError
23
+ SUPPORTS_NEGATIVE = false
24
+ end
25
+
18
26
  def assert_period(abbreviation, utc_offset, std_offset, dst, start_at, end_at, info)
19
27
  if start_at
20
28
  period = info.period_for_utc(start_at)
21
29
  elsif end_at
22
- period = info.period_for_utc(end_at - 1)
30
+ period = info.period_for_utc(TimeOrDateTime.wrap(end_at).add_with_convert(-1).to_orig)
23
31
  else
24
32
  # no transitions, pick the epoch
25
33
  period = info.period_for_utc(Time.utc(1970, 1, 1))
@@ -386,16 +394,11 @@ class TCZoneinfoTimezoneInfo < Minitest::Test
386
394
  end
387
395
 
388
396
  def test_load_before_epoch
389
- # Some platforms don't support negative numbers for times before the epoch.
390
- # Check that they are returned when supported and skipped when not.
391
-
392
- begin
393
- Time.at(-1)
394
- Time.at(-2147483648)
395
- supports_negative = true
396
- rescue ArgumentError
397
- supports_negative = false
398
- end
397
+ # Some platforms don't support negative timestamps for times before the
398
+ # epoch. Check that they are returned when supported and skipped when not.
399
+
400
+ # Note the last transition before the epoch (and within the 32-bit range) is
401
+ # moved to the epoch on platforms that do not support negative timestamps.
399
402
 
400
403
  offsets = [
401
404
  {:gmtoff => 3542, :isdst => false, :abbrev => 'LMT'},
@@ -413,12 +416,13 @@ class TCZoneinfoTimezoneInfo < Minitest::Test
413
416
  info = ZoneinfoTimezoneInfo.new('Zone/Negative', path)
414
417
  assert_equal('Zone/Negative', info.identifier)
415
418
 
416
- if supports_negative
419
+ if SUPPORTS_NEGATIVE
417
420
  assert_period(:LMT, 3542, 0, false, nil, Time.utc(1948, 1, 2), info)
418
421
  assert_period(:XST, 3600, 0, false, Time.utc(1948, 1, 2), Time.utc(1969, 4, 22), info)
419
422
  assert_period(:XDT, 3600, 3600, true, Time.utc(1969, 4, 22), Time.utc(1970, 10, 21), info)
420
423
  else
421
- assert_period(:LMT, 3542, 0, false, nil, Time.utc(1970, 10, 21), info)
424
+ assert_period(:LMT, 3542, 0, false, nil, Time.utc(1970, 1, 1), info)
425
+ assert_period(:XDT, 3600, 3600, true, Time.utc(1970, 1, 1), Time.utc(1970, 10, 21), info)
422
426
  end
423
427
 
424
428
  assert_period(:XST, 3600, 0, false, Time.utc(1970, 10, 21), Time.utc(2000, 12, 31), info)
@@ -426,9 +430,39 @@ class TCZoneinfoTimezoneInfo < Minitest::Test
426
430
  end
427
431
  end
428
432
 
433
+ def test_load_on_epoch
434
+ offsets = [
435
+ {:gmtoff => 3542, :isdst => false, :abbrev => 'LMT'},
436
+ {:gmtoff => 3600, :isdst => false, :abbrev => 'XST'},
437
+ {:gmtoff => 7200, :isdst => true, :abbrev => 'XDT'},
438
+ {:gmtoff => 0, :isdst => false, :abbrev => 'XNST'}]
439
+
440
+ transitions = [
441
+ {:at => -694224000, :offset_index => 1}, # Time.utc(1948, 1, 2)
442
+ {:at => -21945600, :offset_index => 2}, # Time.utc(1969, 4, 22)
443
+ {:at => Time.utc(1970, 1, 1), :offset_index => 1},
444
+ {:at => Time.utc(2000, 12, 31), :offset_index => 3}]
445
+
446
+ tzif_test(offsets, transitions) do |path, format|
447
+ info = ZoneinfoTimezoneInfo.new('Zone/Negative', path)
448
+ assert_equal('Zone/Negative', info.identifier)
449
+
450
+ if SUPPORTS_NEGATIVE
451
+ assert_period(:LMT, 3542, 0, false, nil, Time.utc(1948, 1, 2), info)
452
+ assert_period(:XST, 3600, 0, false, Time.utc(1948, 1, 2), Time.utc(1969, 4, 22), info)
453
+ assert_period(:XDT, 3600, 3600, true, Time.utc(1969, 4, 22), Time.utc(1970, 1, 1), info)
454
+ else
455
+ assert_period(:LMT, 3542, 0, false, nil, Time.utc(1970, 1, 1), info)
456
+ end
457
+
458
+ assert_period(:XST, 3600, 0, false, Time.utc(1970, 1, 1), Time.utc(2000, 12, 31), info)
459
+ assert_period(:XNST, 0, 0, false, Time.utc(2000, 12, 31), nil, info)
460
+ end
461
+ end
462
+
429
463
  def test_load_64bit
430
464
  # Some platforms support 64-bit Times, others only 32-bit. The TZif version
431
- # 2 and later format contains both 32-bit and 64-bit times.
465
+ # 2 and later format contains both 32-bit and 64-bit times.
432
466
 
433
467
  # Where 64-bit is supported and a TZif 2 or later file is provided, the
434
468
  # 64-bit times should be used, otherwise the 32-bit information should be
@@ -464,6 +498,104 @@ class TCZoneinfoTimezoneInfo < Minitest::Test
464
498
  end
465
499
  end
466
500
 
501
+ def test_load_64bit_range
502
+ # The full range of 64 bit timestamps is not currently supported because of
503
+ # the way transitions are indexed. Transitions outside the supported range
504
+ # will be ignored.
505
+
506
+ offsets = [
507
+ {:gmtoff => 3542, :isdst => false, :abbrev => 'LMT'},
508
+ {:gmtoff => 3600, :isdst => false, :abbrev => 'XST'},
509
+ {:gmtoff => 7200, :isdst => false, :abbrev => 'XNST'}]
510
+
511
+ transitions = [
512
+ {:at => -2**63, :offset_index => 1},
513
+ {:at => Time.utc(2014, 5, 27), :offset_index => 2},
514
+ {:at => 2**63 - 1, :offset_index => 0}]
515
+
516
+ tzif_test(offsets, transitions) do |path, format|
517
+ info = ZoneinfoTimezoneInfo.new('Zone/SixtyFourRange', path)
518
+ assert_equal('Zone/SixtyFourRange', info.identifier)
519
+
520
+ if SUPPORTS_64BIT && format >= 2
521
+ # When the full range is supported, the following periods will be defined:
522
+ #assert_period(:LMT, 3542, 0, false, nil, Time.at(-2**63).utc, info)
523
+ #assert_period(:XST, 3600, 0, false, Time.at(-2**63).utc, Time.utc(2014, 5, 27), info)
524
+ #assert_period(:XNST, 7200, 0, false, Time.utc(2014, 5, 27), Time.at(2**63 - 1).utc, info)
525
+ #assert_period(:LMT, 3542, 0, false, Time.at(2**63 - 1).utc, nil, info)
526
+
527
+ # Without full range support, the following periods will be defined:
528
+ assert_period(:LMT, 3542, 0, false, nil, Time.utc(2014, 5, 27), info)
529
+ assert_period(:XNST, 7200, 0, false, Time.utc(2014, 5, 27), nil, info)
530
+ else
531
+ assert_period(:LMT, 3542, 0, false, nil, Time.utc(2014, 5, 27), info)
532
+ assert_period(:XNST, 7200, 0, false, Time.utc(2014, 5, 27), nil, info)
533
+ end
534
+ end
535
+ end
536
+
537
+ def test_load_supported_64bit_range
538
+ # The full range of 64 bit timestamps is not currently supported because of
539
+ # the way transitions are indexed. Transitions outside the supported range
540
+ # will be ignored.
541
+
542
+ min_timestamp = -8520336000 # Time.utc(1700, 1, 1).to_i
543
+ max_timestamp = 16725225600 # Time.utc(2500, 1, 1).to_i
544
+
545
+ offsets = [
546
+ {:gmtoff => 3542, :isdst => false, :abbrev => 'LMT'},
547
+ {:gmtoff => 3600, :isdst => false, :abbrev => 'XST'},
548
+ {:gmtoff => 7200, :isdst => false, :abbrev => 'XNST'}]
549
+
550
+ transitions = [
551
+ {:at => min_timestamp, :offset_index => 1},
552
+ {:at => Time.utc(2014, 5, 27), :offset_index => 2},
553
+ {:at => max_timestamp - 1, :offset_index => 0}]
554
+
555
+ tzif_test(offsets, transitions) do |path, format|
556
+ info = ZoneinfoTimezoneInfo.new('Zone/SupportedSixtyFourRange', path)
557
+ assert_equal('Zone/SupportedSixtyFourRange', info.identifier)
558
+
559
+ if SUPPORTS_64BIT && format >= 2
560
+ assert_period(:LMT, 3542, 0, false, nil, Time.at(min_timestamp).utc, info)
561
+ assert_period(:XST, 3600, 0, false, Time.at(min_timestamp).utc, Time.utc(2014, 5, 27), info)
562
+ assert_period(:XNST, 7200, 0, false, Time.utc(2014, 5, 27), Time.at(max_timestamp - 1).utc, info)
563
+ assert_period(:LMT, 3542, 0, false, Time.at(max_timestamp - 1).utc, nil, info)
564
+ else
565
+ assert_period(:LMT, 3542, 0, false, nil, Time.utc(2014, 5, 27), info)
566
+ assert_period(:XNST, 7200, 0, false, Time.utc(2014, 5, 27), nil, info)
567
+ end
568
+ end
569
+ end
570
+
571
+ def test_load_32bit_range
572
+ offsets = [
573
+ {:gmtoff => 3542, :isdst => false, :abbrev => 'LMT'},
574
+ {:gmtoff => 3600, :isdst => false, :abbrev => 'XST'},
575
+ {:gmtoff => 7200, :isdst => false, :abbrev => 'XNST'}]
576
+
577
+ transitions = [
578
+ {:at => -2**31, :offset_index => 1},
579
+ {:at => Time.utc(2014, 5, 27), :offset_index => 2},
580
+ {:at => 2**31 - 1, :offset_index => 0}]
581
+
582
+ tzif_test(offsets, transitions) do |path, format|
583
+ info = ZoneinfoTimezoneInfo.new('Zone/ThirtyTwoRange', path)
584
+ assert_equal('Zone/ThirtyTwoRange', info.identifier)
585
+
586
+ if SUPPORTS_NEGATIVE
587
+ assert_period(:LMT, 3542, 0, false, nil, Time.at(-2**31).utc, info)
588
+ assert_period(:XST, 3600, 0, false, Time.at(-2**31).utc, Time.utc(2014, 5, 27), info)
589
+ assert_period(:XNST, 7200, 0, false, Time.utc(2014, 5, 27), Time.at(2**31 - 1).utc, info)
590
+ assert_period(:LMT, 3542, 0, false, Time.at(2**31 - 1).utc, nil, info)
591
+ else
592
+ assert_period(:XST, 3600, 0, false, Time.utc(1970, 1, 1), Time.utc(2014, 5, 27), info)
593
+ assert_period(:XNST, 7200, 0, false, Time.utc(2014, 5, 27), Time.at(2**31 - 1).utc, info)
594
+ assert_period(:LMT, 3542, 0, false, Time.at(2**31 - 1).utc, nil, info)
595
+ end
596
+ end
597
+ end
598
+
467
599
  def test_load_std_offset_changes
468
600
  # The zoneinfo files don't include the offset from standard time, so this
469
601
  # has to be derived by looking at changes in the total UTC offset.
@@ -1 +1,8 @@
1
+ # Top level module for TZInfo.
2
+ module TZInfo
3
+ # Top level module for TZInfo::Data.
4
+ module Data
5
+ end
6
+ end
7
+
1
8
  require 'tzinfo/data/version'
@@ -305,6 +305,8 @@ module TZInfo
305
305
  tz.transition 2062, 11, :o1, 2929932000, 9897995, 4
306
306
  tz.transition 2063, 3, :o2, 2940822000, 59390995, 24
307
307
  tz.transition 2063, 11, :o1, 2961381600, 9899451, 4
308
+ tz.transition 2064, 3, :o2, 2972271600, 59399731, 24
309
+ tz.transition 2064, 11, :o1, 2992831200, 9900907, 4
308
310
  end
309
311
  end
310
312
  end
@@ -208,6 +208,8 @@ module TZInfo
208
208
  tz.transition 2062, 4, :o1, 2911132800, 14845687, 6
209
209
  tz.transition 2062, 9, :o2, 2926857600, 14846779, 6
210
210
  tz.transition 2063, 3, :o1, 2942582400, 14847871, 6
211
+ tz.transition 2063, 10, :o2, 2958912000, 14849005, 6
212
+ tz.transition 2064, 4, :o1, 2974636800, 14850097, 6
211
213
  end
212
214
  end
213
215
  end
@@ -251,6 +251,8 @@ module TZInfo
251
251
  tz.transition 2062, 10, :o6, 2929309200, 59387797, 24
252
252
  tz.transition 2063, 3, :o5, 2942010000, 59391325, 24
253
253
  tz.transition 2063, 10, :o6, 2960758800, 59396533, 24
254
+ tz.transition 2064, 3, :o5, 2974064400, 59400229, 24
255
+ tz.transition 2064, 10, :o6, 2992208400, 59405269, 24
254
256
  end
255
257
  end
256
258
  end
@@ -176,6 +176,8 @@ module TZInfo
176
176
  tz.transition 2062, 10, :o2, 2929309200, 59387797, 24
177
177
  tz.transition 2063, 3, :o3, 2942010000, 59391325, 24
178
178
  tz.transition 2063, 10, :o2, 2960758800, 59396533, 24
179
+ tz.transition 2064, 3, :o3, 2974064400, 59400229, 24
180
+ tz.transition 2064, 10, :o2, 2992208400, 59405269, 24
179
181
  end
180
182
  end
181
183
  end
@@ -311,6 +311,8 @@ module TZInfo
311
311
  tz.transition 2062, 10, :o1, 2929309200, 59387797, 24
312
312
  tz.transition 2063, 3, :o2, 2942010000, 59391325, 24
313
313
  tz.transition 2063, 10, :o1, 2960758800, 59396533, 24
314
+ tz.transition 2064, 3, :o2, 2974064400, 59400229, 24
315
+ tz.transition 2064, 10, :o1, 2992208400, 59405269, 24
314
316
  end
315
317
  end
316
318
  end
@@ -255,6 +255,8 @@ module TZInfo
255
255
  tz.transition 2062, 10, :o5, 2929309200, 59387797, 24
256
256
  tz.transition 2063, 3, :o4, 2942010000, 59391325, 24
257
257
  tz.transition 2063, 10, :o5, 2960758800, 59396533, 24
258
+ tz.transition 2064, 3, :o4, 2974064400, 59400229, 24
259
+ tz.transition 2064, 10, :o5, 2992208400, 59405269, 24
258
260
  end
259
261
  end
260
262
  end
@@ -210,6 +210,8 @@ module TZInfo
210
210
  tz.transition 2062, 10, :o2, 2929309200, 59387797, 24
211
211
  tz.transition 2063, 3, :o3, 2942010000, 59391325, 24
212
212
  tz.transition 2063, 10, :o2, 2960758800, 59396533, 24
213
+ tz.transition 2064, 3, :o3, 2974064400, 59400229, 24
214
+ tz.transition 2064, 10, :o2, 2992208400, 59405269, 24
213
215
  end
214
216
  end
215
217
  end
@@ -34,8 +34,7 @@ module TZInfo
34
34
  c.timezone 'Africa/Luanda', -44, 5, 397, 30
35
35
  end
36
36
  country 'AQ', 'Antarctica' do |c|
37
- c.timezone 'Antarctica/McMurdo', -467, 6, 833, 5, 'McMurdo Station, Ross Island'
38
- c.timezone 'Antarctica/South_Pole', -90, 1, 0, 1, 'Amundsen-Scott Station, South Pole'
37
+ c.timezone 'Antarctica/McMurdo', -467, 6, 833, 5, 'McMurdo, South Pole, Scott (New Zealand time)'
39
38
  c.timezone 'Antarctica/Rothera', -2027, 30, -1022, 15, 'Rothera Station, Adelaide Island'
40
39
  c.timezone 'Antarctica/Palmer', -324, 5, -641, 10, 'Palmer Station, Anvers Island'
41
40
  c.timezone 'Antarctica/Mawson', -338, 5, 3773, 60, 'Mawson Station, Holme Bay'
@@ -44,6 +43,7 @@ module TZInfo
44
43
  c.timezone 'Antarctica/Vostok', -392, 5, 1069, 10, 'Vostok Station, Lake Vostok'
45
44
  c.timezone 'Antarctica/DumontDUrville', -200, 3, 8401, 60, 'Dumont-d\'Urville Station, Terre Adelie'
46
45
  c.timezone 'Antarctica/Syowa', -124211, 1800, 3959, 100, 'Syowa Station, E Ongul I'
46
+ c.timezone 'Antarctica/Troll', -259241, 3600, 507, 200, 'Troll Station, Queen Maud Land'
47
47
  end
48
48
  country 'AR', 'Argentina' do |c|
49
49
  c.timezone 'America/Argentina/Buenos_Aires', -173, 5, -1169, 20, 'Buenos Aires (BA, CF)'
@@ -128,7 +128,7 @@ module TZInfo
128
128
  country 'BO', 'Bolivia' do |c|
129
129
  c.timezone 'America/La_Paz', -33, 2, -1363, 20
130
130
  end
131
- country 'BQ', 'Bonaire Sint Eustatius & Saba' do |c|
131
+ country 'BQ', 'Caribbean Netherlands' do |c|
132
132
  c.timezone 'America/Kralendijk', 14581, 1200, -20483, 300
133
133
  end
134
134
  country 'BR', 'Brazil' do |c|
@@ -172,8 +172,7 @@ module TZInfo
172
172
  c.timezone 'America/Moncton', 461, 10, -3887, 60, 'Atlantic Time - New Brunswick'
173
173
  c.timezone 'America/Goose_Bay', 160, 3, -725, 12, 'Atlantic Time - Labrador - most locations'
174
174
  c.timezone 'America/Blanc-Sablon', 617, 12, -3427, 60, 'Atlantic Standard Time - Quebec - Lower North Shore'
175
- c.timezone 'America/Montreal', 2731, 60, -2207, 30, 'Eastern Time - Quebec - most locations'
176
- c.timezone 'America/Toronto', 873, 20, -4763, 60, 'Eastern Time - Ontario - most locations'
175
+ c.timezone 'America/Toronto', 873, 20, -4763, 60, 'Eastern Time - Ontario & Quebec - most locations'
177
176
  c.timezone 'America/Nipigon', 2941, 60, -1324, 15, 'Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973'
178
177
  c.timezone 'America/Thunder_Bay', 2903, 60, -357, 4, 'Eastern Time - Thunder Bay, Ontario'
179
178
  c.timezone 'America/Iqaluit', 956, 15, -1027, 15, 'Eastern Time - east Nunavut - most locations'
@@ -404,7 +403,7 @@ module TZInfo
404
403
  c.timezone 'Europe/Dublin', 160, 3, -25, 4
405
404
  end
406
405
  country 'IL', 'Israel' do |c|
407
- c.timezone 'Asia/Jerusalem', 953, 30, 1057, 30
406
+ c.timezone 'Asia/Jerusalem', 11441, 360, 63403, 1800
408
407
  end
409
408
  country 'IM', 'Isle of Man' do |c|
410
409
  c.timezone 'Europe/Isle_of_Man', 1083, 20, -67, 15
@@ -431,7 +430,7 @@ module TZInfo
431
430
  c.timezone 'Europe/Jersey', 246, 5, -127, 60
432
431
  end
433
432
  country 'JM', 'Jamaica' do |c|
434
- c.timezone 'America/Jamaica', 18, 1, -384, 5
433
+ c.timezone 'America/Jamaica', 12937, 720, -11519, 150
435
434
  end
436
435
  country 'JO', 'Jordan' do |c|
437
436
  c.timezone 'Asia/Amman', 639, 20, 539, 15
@@ -699,6 +698,7 @@ module TZInfo
699
698
  c.timezone 'Europe/Moscow', 223, 4, 451, 12, 'Moscow+00 - west Russia'
700
699
  c.timezone 'Europe/Volgograd', 731, 15, 533, 12, 'Moscow+00 - Caspian Sea'
701
700
  c.timezone 'Europe/Samara', 266, 5, 1003, 20, 'Moscow+00 - Samara, Udmurtia'
701
+ c.timezone 'Europe/Simferopol', 899, 20, 341, 10, 'Moscow+00 - Crimea'
702
702
  c.timezone 'Asia/Yekaterinburg', 1137, 20, 303, 5, 'Moscow+02 - Urals'
703
703
  c.timezone 'Asia/Omsk', 55, 1, 367, 5, 'Moscow+03 - west Siberia'
704
704
  c.timezone 'Asia/Novosibirsk', 1651, 30, 995, 12, 'Moscow+03 - Novosibirsk'
@@ -771,7 +771,7 @@ module TZInfo
771
771
  country 'SV', 'El Salvador' do |c|
772
772
  c.timezone 'America/El_Salvador', 137, 10, -446, 5
773
773
  end
774
- country 'SX', 'Sint Maarten' do |c|
774
+ country 'SX', 'St Maarten (Dutch part)' do |c|
775
775
  c.timezone 'America/Lower_Princes', 12997, 720, -22697, 360
776
776
  end
777
777
  country 'SY', 'Syria' do |c|
@@ -832,7 +832,6 @@ module TZInfo
832
832
  c.timezone 'Europe/Kiev', 1513, 30, 1831, 60, 'most locations'
833
833
  c.timezone 'Europe/Uzhgorod', 2917, 60, 223, 10, 'Ruthenia'
834
834
  c.timezone 'Europe/Zaporozhye', 287, 6, 211, 6, 'Zaporozh\'ye, E Lugansk / Zaporizhia, E Luhansk'
835
- c.timezone 'Europe/Simferopol', 899, 20, 341, 10, 'central Crimea'
836
835
  end
837
836
  country 'UG', 'Uganda' do |c|
838
837
  c.timezone 'Africa/Kampala', 19, 60, 389, 12
@@ -862,8 +861,7 @@ module TZInfo
862
861
  c.timezone 'America/North_Dakota/Beulah', 56717, 1200, -916, 9, 'Central Time - North Dakota - Mercer County'
863
862
  c.timezone 'America/Denver', 47687, 1200, -125981, 1200, 'Mountain Time'
864
863
  c.timezone 'America/Boise', 157009, 3600, -46481, 400, 'Mountain Time - south Idaho & east Oregon'
865
- c.timezone 'America/Shiprock', 33107, 900, -391271, 3600, 'Mountain Time - Navajo'
866
- c.timezone 'America/Phoenix', 20069, 600, -16811, 150, 'Mountain Standard Time - Arizona'
864
+ c.timezone 'America/Phoenix', 20069, 600, -16811, 150, 'Mountain Standard Time - Arizona (except Navajo)'
867
865
  c.timezone 'America/Los_Angeles', 30647, 900, -212837, 1800, 'Pacific Time'
868
866
  c.timezone 'America/Anchorage', 44077, 720, -539641, 3600, 'Alaska Time'
869
867
  c.timezone 'America/Juneau', 209887, 3600, -483911, 3600, 'Alaska Time - Alaska panhandle'
@@ -35,7 +35,7 @@ module TZInfo
35
35
  timezone 'Africa/Gaborone'
36
36
  timezone 'Africa/Harare'
37
37
  timezone 'Africa/Johannesburg'
38
- timezone 'Africa/Juba'
38
+ linked_timezone 'Africa/Juba'
39
39
  timezone 'Africa/Kampala'
40
40
  timezone 'Africa/Khartoum'
41
41
  timezone 'Africa/Kigali'
@@ -65,7 +65,7 @@ module TZInfo
65
65
  timezone 'Africa/Windhoek'
66
66
  timezone 'America/Adak'
67
67
  timezone 'America/Anchorage'
68
- timezone 'America/Anguilla'
68
+ linked_timezone 'America/Anguilla'
69
69
  timezone 'America/Antigua'
70
70
  timezone 'America/Araguaina'
71
71
  timezone 'America/Argentina/Buenos_Aires'
@@ -81,7 +81,7 @@ module TZInfo
81
81
  timezone 'America/Argentina/San_Luis'
82
82
  timezone 'America/Argentina/Tucuman'
83
83
  timezone 'America/Argentina/Ushuaia'
84
- timezone 'America/Aruba'
84
+ linked_timezone 'America/Aruba'
85
85
  timezone 'America/Asuncion'
86
86
  timezone 'America/Atikokan'
87
87
  linked_timezone 'America/Atka'
@@ -115,7 +115,7 @@ module TZInfo
115
115
  timezone 'America/Dawson_Creek'
116
116
  timezone 'America/Denver'
117
117
  timezone 'America/Detroit'
118
- timezone 'America/Dominica'
118
+ linked_timezone 'America/Dominica'
119
119
  timezone 'America/Edmonton'
120
120
  timezone 'America/Eirunepe'
121
121
  timezone 'America/El_Salvador'
@@ -126,8 +126,8 @@ module TZInfo
126
126
  timezone 'America/Godthab'
127
127
  timezone 'America/Goose_Bay'
128
128
  timezone 'America/Grand_Turk'
129
- timezone 'America/Grenada'
130
- timezone 'America/Guadeloupe'
129
+ linked_timezone 'America/Grenada'
130
+ linked_timezone 'America/Guadeloupe'
131
131
  timezone 'America/Guatemala'
132
132
  timezone 'America/Guayaquil'
133
133
  timezone 'America/Guyana'
@@ -174,7 +174,7 @@ module TZInfo
174
174
  timezone 'America/Monterrey'
175
175
  timezone 'America/Montevideo'
176
176
  timezone 'America/Montreal'
177
- timezone 'America/Montserrat'
177
+ linked_timezone 'America/Montserrat'
178
178
  timezone 'America/Nassau'
179
179
  timezone 'America/New_York'
180
180
  timezone 'America/Nipigon'
@@ -210,17 +210,17 @@ module TZInfo
210
210
  timezone 'America/Sitka'
211
211
  linked_timezone 'America/St_Barthelemy'
212
212
  timezone 'America/St_Johns'
213
- timezone 'America/St_Kitts'
214
- timezone 'America/St_Lucia'
215
- timezone 'America/St_Thomas'
216
- timezone 'America/St_Vincent'
213
+ linked_timezone 'America/St_Kitts'
214
+ linked_timezone 'America/St_Lucia'
215
+ linked_timezone 'America/St_Thomas'
216
+ linked_timezone 'America/St_Vincent'
217
217
  timezone 'America/Swift_Current'
218
218
  timezone 'America/Tegucigalpa'
219
219
  timezone 'America/Thule'
220
220
  timezone 'America/Thunder_Bay'
221
221
  timezone 'America/Tijuana'
222
222
  timezone 'America/Toronto'
223
- timezone 'America/Tortola'
223
+ linked_timezone 'America/Tortola'
224
224
  timezone 'America/Vancouver'
225
225
  linked_timezone 'America/Virgin'
226
226
  timezone 'America/Whitehorse'
@@ -232,11 +232,12 @@ module TZInfo
232
232
  timezone 'Antarctica/DumontDUrville'
233
233
  timezone 'Antarctica/Macquarie'
234
234
  timezone 'Antarctica/Mawson'
235
- timezone 'Antarctica/McMurdo'
235
+ linked_timezone 'Antarctica/McMurdo'
236
236
  timezone 'Antarctica/Palmer'
237
237
  timezone 'Antarctica/Rothera'
238
238
  linked_timezone 'Antarctica/South_Pole'
239
239
  timezone 'Antarctica/Syowa'
240
+ timezone 'Antarctica/Troll'
240
241
  timezone 'Antarctica/Vostok'
241
242
  linked_timezone 'Arctic/Longyearbyen'
242
243
  timezone 'Asia/Aden'
@@ -306,9 +307,6 @@ module TZInfo
306
307
  timezone 'Asia/Qyzylorda'
307
308
  timezone 'Asia/Rangoon'
308
309
  timezone 'Asia/Riyadh'
309
- timezone 'Asia/Riyadh87'
310
- timezone 'Asia/Riyadh88'
311
- timezone 'Asia/Riyadh89'
312
310
  linked_timezone 'Asia/Saigon'
313
311
  timezone 'Asia/Sakhalin'
314
312
  timezone 'Asia/Samarkand'
@@ -476,7 +474,7 @@ module TZInfo
476
474
  timezone 'Europe/Tirane'
477
475
  linked_timezone 'Europe/Tiraspol'
478
476
  timezone 'Europe/Uzhgorod'
479
- timezone 'Europe/Vaduz'
477
+ linked_timezone 'Europe/Vaduz'
480
478
  linked_timezone 'Europe/Vatican'
481
479
  timezone 'Europe/Vienna'
482
480
  timezone 'Europe/Vilnius'
@@ -518,9 +516,6 @@ module TZInfo
518
516
  linked_timezone 'Mexico/BajaNorte'
519
517
  linked_timezone 'Mexico/BajaSur'
520
518
  linked_timezone 'Mexico/General'
521
- linked_timezone 'Mideast/Riyadh87'
522
- linked_timezone 'Mideast/Riyadh88'
523
- linked_timezone 'Mideast/Riyadh89'
524
519
  linked_timezone 'NZ'
525
520
  linked_timezone 'NZ-CHAT'
526
521
  linked_timezone 'Navajo'
@@ -541,7 +536,7 @@ module TZInfo
541
536
  timezone 'Pacific/Guadalcanal'
542
537
  timezone 'Pacific/Guam'
543
538
  timezone 'Pacific/Honolulu'
544
- timezone 'Pacific/Johnston'
539
+ linked_timezone 'Pacific/Johnston'
545
540
  timezone 'Pacific/Kiritimati'
546
541
  timezone 'Pacific/Kosrae'
547
542
  timezone 'Pacific/Kwajalein'
@@ -8,7 +8,7 @@ module TZInfo
8
8
 
9
9
  # The version of the {IANA Time Zone Database}[http://www.iana.org/time-zones]
10
10
  # used to generate this version of TZInfo::Data.
11
- TZDATA = '2013c'
11
+ TZDATA = '2014d'
12
12
  end
13
13
  end
14
14
  end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,17 +1,15 @@
1
- # <pre>
1
+ # ISO 3166 alpha-2 country codes
2
+ #
2
3
  # This file is in the public domain, so clarified as of
3
4
  # 2009-05-17 by Arthur David Olson.
4
- # ISO 3166 alpha-2 country codes
5
5
  #
6
- # From Paul Eggert (2006-09-27):
6
+ # From Paul Eggert (2013-05-27):
7
7
  #
8
8
  # This file contains a table with the following columns:
9
9
  # 1. ISO 3166-1 alpha-2 country code, current as of
10
- # ISO 3166-1 Newsletter VI-1 (2007-09-21). See:
11
- # <a href="http://www.iso.org/iso/en/prods-services/iso3166ma/index.html">
12
- # ISO 3166 Maintenance agency (ISO 3166/MA)
13
- # </a>.
14
- # 2. The usual English name for the country,
10
+ # ISO 3166-1 Newsletter VI-15 (2013-05-10). See: Updates on ISO 3166
11
+ # http://www.iso.org/iso/home/standards/country_codes/updates_on_iso_3166.htm
12
+ # 2. The usual English name for the coded region,
15
13
  # chosen so that alphabetic sorting of subsets produces helpful lists.
16
14
  # This is not the same as the English name in the ISO 3166 tables.
17
15
  #
@@ -20,11 +18,12 @@
20
18
  #
21
19
  # Lines beginning with `#' are comments.
22
20
  #
23
- # From Arthur David Olson (2011-08-17):
24
- # Resynchronized today with the ISO 3166 site (adding SS for South Sudan).
21
+ # This table is intended as an aid for users, to help them select time
22
+ # zone data appropriate for their practical needs. It is not intended
23
+ # to take or endorse any position on legal or territorial claims.
25
24
  #
26
25
  #country-
27
- #code country name
26
+ #code name of country, territory, area, or subdivision
28
27
  AD Andorra
29
28
  AE United Arab Emirates
30
29
  AF Afghanistan
@@ -54,7 +53,7 @@ BL St Barthelemy
54
53
  BM Bermuda
55
54
  BN Brunei
56
55
  BO Bolivia
57
- BQ Bonaire Sint Eustatius & Saba
56
+ BQ Caribbean Netherlands
58
57
  BR Brazil
59
58
  BS Bahamas
60
59
  BT Bhutan
@@ -235,7 +234,7 @@ SR Suriname
235
234
  SS South Sudan
236
235
  ST Sao Tome & Principe
237
236
  SV El Salvador
238
- SX Sint Maarten
237
+ SX St Maarten (Dutch part)
239
238
  SY Syria
240
239
  SZ Swaziland
241
240
  TC Turks & Caicos Is
Binary file
@@ -1,26 +1,36 @@
1
- # <pre>
1
+ # TZ zone descriptions
2
+ #
2
3
  # This file is in the public domain, so clarified as of
3
4
  # 2009-05-17 by Arthur David Olson.
4
5
  #
5
- # TZ zone descriptions
6
+ # From Paul Eggert (2013-08-14):
6
7
  #
7
- # From Paul Eggert (1996-08-05):
8
+ # This file contains a table where each row stands for an area that is
9
+ # the intersection of a region identified by a country code and of a
10
+ # zone where civil clocks have agreed since 1970. The columns of the
11
+ # table are as follows:
8
12
  #
9
- # This file contains a table with the following columns:
10
- # 1. ISO 3166 2-character country code. See the file `iso3166.tab'.
11
- # 2. Latitude and longitude of the zone's principal location
13
+ # 1. ISO 3166 2-character country code. See the file 'iso3166.tab'.
14
+ # 2. Latitude and longitude of the area's principal location
12
15
  # in ISO 6709 sign-degrees-minutes-seconds format,
13
16
  # either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
14
17
  # first latitude (+ is north), then longitude (+ is east).
15
18
  # 3. Zone name used in value of TZ environment variable.
19
+ # Please see the 'Theory' file for how zone names are chosen.
20
+ # If multiple zones overlap a country, each has a row in the
21
+ # table, with column 1 being duplicated.
16
22
  # 4. Comments; present if and only if the country has multiple rows.
17
23
  #
18
24
  # Columns are separated by a single tab.
19
25
  # The table is sorted first by country, then an order within the country that
20
26
  # (1) makes some geographical sense, and
21
- # (2) puts the most populous zones first, where that does not contradict (1).
27
+ # (2) puts the most populous areas first, where that does not contradict (1).
28
+ #
29
+ # Lines beginning with '#' are comments.
22
30
  #
23
- # Lines beginning with `#' are comments.
31
+ # This table is intended as an aid for users, to help them select time
32
+ # zone data appropriate for their practical needs. It is not intended
33
+ # to take or endorse any position on legal or territorial claims.
24
34
  #
25
35
  #country-
26
36
  #code coordinates TZ comments
@@ -32,8 +42,7 @@ AI +1812-06304 America/Anguilla
32
42
  AL +4120+01950 Europe/Tirane
33
43
  AM +4011+04430 Asia/Yerevan
34
44
  AO -0848+01314 Africa/Luanda
35
- AQ -7750+16636 Antarctica/McMurdo McMurdo Station, Ross Island
36
- AQ -9000+00000 Antarctica/South_Pole Amundsen-Scott Station, South Pole
45
+ AQ -7750+16636 Antarctica/McMurdo McMurdo, South Pole, Scott (New Zealand time)
37
46
  AQ -6734-06808 Antarctica/Rothera Rothera Station, Adelaide Island
38
47
  AQ -6448-06406 Antarctica/Palmer Palmer Station, Anvers Island
39
48
  AQ -6736+06253 Antarctica/Mawson Mawson Station, Holme Bay
@@ -42,6 +51,7 @@ AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula
42
51
  AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok
43
52
  AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie
44
53
  AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I
54
+ AQ -720041+0023206 Antarctica/Troll Troll Station, Queen Maud Land
45
55
  AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF)
46
56
  AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF)
47
57
  AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN)
@@ -113,8 +123,7 @@ CA +4612-05957 America/Glace_Bay Atlantic Time - Nova Scotia - places that did n
113
123
  CA +4606-06447 America/Moncton Atlantic Time - New Brunswick
114
124
  CA +5320-06025 America/Goose_Bay Atlantic Time - Labrador - most locations
115
125
  CA +5125-05707 America/Blanc-Sablon Atlantic Standard Time - Quebec - Lower North Shore
116
- CA +4531-07334 America/Montreal Eastern Time - Quebec - most locations
117
- CA +4339-07923 America/Toronto Eastern Time - Ontario - most locations
126
+ CA +4339-07923 America/Toronto Eastern Time - Ontario & Quebec - most locations
118
127
  CA +4901-08816 America/Nipigon Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
119
128
  CA +4823-08915 America/Thunder_Bay Eastern Time - Thunder Bay, Ontario
120
129
  CA +6344-06828 America/Iqaluit Eastern Time - east Nunavut - most locations
@@ -216,7 +225,7 @@ ID -0002+10920 Asia/Pontianak west & central Borneo
216
225
  ID -0507+11924 Asia/Makassar east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
217
226
  ID -0232+14042 Asia/Jayapura west New Guinea (Irian Jaya) & Malukus (Moluccas)
218
227
  IE +5320-00615 Europe/Dublin
219
- IL +3146+03514 Asia/Jerusalem
228
+ IL +314650+0351326 Asia/Jerusalem
220
229
  IM +5409-00428 Europe/Isle_of_Man
221
230
  IN +2232+08822 Asia/Kolkata
222
231
  IO -0720+07225 Indian/Chagos
@@ -225,7 +234,7 @@ IR +3540+05126 Asia/Tehran
225
234
  IS +6409-02151 Atlantic/Reykjavik
226
235
  IT +4154+01229 Europe/Rome
227
236
  JE +4912-00207 Europe/Jersey
228
- JM +1800-07648 America/Jamaica
237
+ JM +175805-0764736 America/Jamaica
229
238
  JO +3157+03556 Asia/Amman
230
239
  JP +353916+1394441 Asia/Tokyo
231
240
  KE -0117+03649 Africa/Nairobi
@@ -335,6 +344,7 @@ RU +5443+02030 Europe/Kaliningrad Moscow-01 - Kaliningrad
335
344
  RU +5545+03735 Europe/Moscow Moscow+00 - west Russia
336
345
  RU +4844+04425 Europe/Volgograd Moscow+00 - Caspian Sea
337
346
  RU +5312+05009 Europe/Samara Moscow+00 - Samara, Udmurtia
347
+ RU +4457+03406 Europe/Simferopol Moscow+00 - Crimea
338
348
  RU +5651+06036 Asia/Yekaterinburg Moscow+02 - Urals
339
349
  RU +5500+07324 Asia/Omsk Moscow+03 - west Siberia
340
350
  RU +5502+08255 Asia/Novosibirsk Moscow+03 - Novosibirsk
@@ -390,7 +400,6 @@ TZ -0648+03917 Africa/Dar_es_Salaam
390
400
  UA +5026+03031 Europe/Kiev most locations
391
401
  UA +4837+02218 Europe/Uzhgorod Ruthenia
392
402
  UA +4750+03510 Europe/Zaporozhye Zaporozh'ye, E Lugansk / Zaporizhia, E Luhansk
393
- UA +4457+03406 Europe/Simferopol central Crimea
394
403
  UG +0019+03225 Africa/Kampala
395
404
  UM +1645-16931 Pacific/Johnston Johnston Atoll
396
405
  UM +2813-17722 Pacific/Midway Midway Islands
@@ -414,8 +423,7 @@ US +465042-1012439 America/North_Dakota/New_Salem Central Time - North Dakota -
414
423
  US +471551-1014640 America/North_Dakota/Beulah Central Time - North Dakota - Mercer County
415
424
  US +394421-1045903 America/Denver Mountain Time
416
425
  US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon
417
- US +364708-1084111 America/Shiprock Mountain Time - Navajo
418
- US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona
426
+ US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona (except Navajo)
419
427
  US +340308-1181434 America/Los_Angeles Pacific Time
420
428
  US +611305-1495401 America/Anchorage Alaska Time
421
429
  US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'tzinfo'
3
- s.version = '1.2.0'
3
+ s.version = '1.2.1'
4
4
  s.summary = 'Daylight savings aware timezone library'
5
5
  s.description = 'TZInfo provides daylight savings aware transformations between times in different time zones.'
6
6
  s.author = 'Philip Ross'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tzinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Ross
@@ -30,7 +30,7 @@ cert_chain:
30
30
  fs7XSYlwQp0zY7PFSMwJeBpQFDBnShcweRQ+0QdUUS4FHrwfXex0QsXp9UROUX+4
31
31
  6BVw9ZDNFnDH4PQjZGbdwanB7kzm+TEi
32
32
  -----END CERTIFICATE-----
33
- date: 2014-05-26 00:00:00.000000000 Z
33
+ date: 2014-06-01 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: thread_safe
metadata.gz.sig CHANGED
@@ -1 +1,2 @@
1
- %����xlVJ{��2�"dr�%�Co )���o0f��mi���
1
+ ;���g���Z)���(����lM�3�����샄-m�~LB\_��|7ooj�'mV6 ���@����J�܋�:����1uJ'G
2
+ ~���a_6�14���x���� �0��O&���AƏ�Ʌ��%������Ճ���.�a��=(V�WP�@��Q����k��b�#|d��=뀍k�iAޘtԂ]�����v�K]�ӓ"s���ӭh79����9��@�/� �������bô�&�L