tzinfo 0.3.37 → 0.3.38

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 (64) hide show
  1. data/.yardopts +8 -0
  2. data/CHANGES +6 -0
  3. data/README +13 -16
  4. data/Rakefile +126 -54
  5. data/lib/tzinfo/country.rb +5 -1
  6. data/lib/tzinfo/country_index_definition.rb +6 -1
  7. data/lib/tzinfo/country_info.rb +3 -1
  8. data/lib/tzinfo/country_timezone.rb +1 -1
  9. data/lib/tzinfo/data_timezone.rb +3 -1
  10. data/lib/tzinfo/data_timezone_info.rb +3 -1
  11. data/lib/tzinfo/definitions/Africa/Casablanca.rb +55 -74
  12. data/lib/tzinfo/definitions/Africa/Juba.rb +1 -41
  13. data/lib/tzinfo/definitions/America/Anguilla.rb +1 -6
  14. data/lib/tzinfo/definitions/America/Araguaina.rb +0 -74
  15. data/lib/tzinfo/definitions/America/Argentina/San_Luis.rb +1 -1
  16. data/lib/tzinfo/definitions/America/Aruba.rb +1 -8
  17. data/lib/tzinfo/definitions/America/Asuncion.rb +37 -37
  18. data/lib/tzinfo/definitions/America/Cayman.rb +2 -2
  19. data/lib/tzinfo/definitions/America/Dominica.rb +1 -6
  20. data/lib/tzinfo/definitions/America/Grand_Turk.rb +2 -2
  21. data/lib/tzinfo/definitions/America/Grenada.rb +1 -6
  22. data/lib/tzinfo/definitions/America/Guadeloupe.rb +1 -6
  23. data/lib/tzinfo/definitions/America/Jamaica.rb +4 -4
  24. data/lib/tzinfo/definitions/America/Marigot.rb +1 -1
  25. data/lib/tzinfo/definitions/America/Montserrat.rb +1 -6
  26. data/lib/tzinfo/definitions/America/St_Barthelemy.rb +1 -1
  27. data/lib/tzinfo/definitions/America/St_Kitts.rb +1 -6
  28. data/lib/tzinfo/definitions/America/St_Lucia.rb +1 -8
  29. data/lib/tzinfo/definitions/America/St_Thomas.rb +1 -6
  30. data/lib/tzinfo/definitions/America/St_Vincent.rb +1 -8
  31. data/lib/tzinfo/definitions/America/Tortola.rb +1 -6
  32. data/lib/tzinfo/definitions/America/Virgin.rb +1 -1
  33. data/lib/tzinfo/definitions/Antarctica/Macquarie.rb +3 -7
  34. data/lib/tzinfo/definitions/Antarctica/McMurdo.rb +1 -159
  35. data/lib/tzinfo/definitions/Antarctica/South_Pole.rb +1 -1
  36. data/lib/tzinfo/definitions/Asia/Amman.rb +2 -75
  37. data/lib/tzinfo/definitions/Asia/Dili.rb +1 -1
  38. data/lib/tzinfo/definitions/Asia/Gaza.rb +79 -3
  39. data/lib/tzinfo/definitions/Asia/Hebron.rb +81 -5
  40. data/lib/tzinfo/definitions/Asia/Jakarta.rb +4 -4
  41. data/lib/tzinfo/definitions/Asia/Jayapura.rb +1 -1
  42. data/lib/tzinfo/definitions/Asia/Jerusalem.rb +40 -40
  43. data/lib/tzinfo/definitions/Asia/Makassar.rb +1 -1
  44. data/lib/tzinfo/definitions/Asia/Pontianak.rb +4 -4
  45. data/lib/tzinfo/definitions/Europe/Vaduz.rb +1 -147
  46. data/lib/tzinfo/definitions/Europe/Zurich.rb +3 -3
  47. data/lib/tzinfo/definitions/Pacific/Fiji.rb +17 -17
  48. data/lib/tzinfo/definitions/Pacific/Johnston.rb +1 -4
  49. data/lib/tzinfo/indexes/countries.rb +8 -11
  50. data/lib/tzinfo/indexes/timezones.rb +15 -15
  51. data/lib/tzinfo/info_timezone.rb +3 -1
  52. data/lib/tzinfo/linked_timezone.rb +4 -1
  53. data/lib/tzinfo/linked_timezone_info.rb +3 -1
  54. data/lib/tzinfo/offset_rationals.rb +4 -2
  55. data/lib/tzinfo/ruby_core_support.rb +4 -2
  56. data/lib/tzinfo/time_or_datetime.rb +3 -1
  57. data/lib/tzinfo/timezone.rb +7 -1
  58. data/lib/tzinfo/timezone_definition.rb +5 -1
  59. data/lib/tzinfo/timezone_index_definition.rb +6 -1
  60. data/lib/tzinfo/timezone_info.rb +3 -1
  61. data/lib/tzinfo/timezone_offset_info.rb +3 -1
  62. data/lib/tzinfo/timezone_transition_info.rb +3 -1
  63. data/lib/tzinfo/tzdataparser.rb +48 -13
  64. metadata +6 -5
@@ -4,10 +4,7 @@ module TZInfo
4
4
  module Johnston
5
5
  include TimezoneDefinition
6
6
 
7
- timezone 'Pacific/Johnston' do |tz|
8
- tz.offset :o0, -36000, 0, :HST
9
-
10
- end
7
+ linked_timezone 'Pacific/Johnston', 'Pacific/Honolulu'
11
8
  end
12
9
  end
13
10
  end
@@ -28,8 +28,7 @@ module TZInfo
28
28
  c.timezone 'Africa/Luanda', -44, 5, 397, 30
29
29
  end
30
30
  country 'AQ', 'Antarctica' do |c|
31
- c.timezone 'Antarctica/McMurdo', -467, 6, 833, 5, 'McMurdo Station, Ross Island'
32
- c.timezone 'Antarctica/South_Pole', -90, 1, 0, 1, 'Amundsen-Scott Station, South Pole'
31
+ c.timezone 'Antarctica/McMurdo', -467, 6, 833, 5, 'McMurdo, South Pole, Scott (New Zealand time)'
33
32
  c.timezone 'Antarctica/Rothera', -2027, 30, -1022, 15, 'Rothera Station, Adelaide Island'
34
33
  c.timezone 'Antarctica/Palmer', -324, 5, -641, 10, 'Palmer Station, Anvers Island'
35
34
  c.timezone 'Antarctica/Mawson', -338, 5, 3773, 60, 'Mawson Station, Holme Bay'
@@ -38,7 +37,6 @@ module TZInfo
38
37
  c.timezone 'Antarctica/Vostok', -392, 5, 1069, 10, 'Vostok Station, Lake Vostok'
39
38
  c.timezone 'Antarctica/DumontDUrville', -200, 3, 8401, 60, 'Dumont-d\'Urville Station, Terre Adelie'
40
39
  c.timezone 'Antarctica/Syowa', -124211, 1800, 3959, 100, 'Syowa Station, E Ongul I'
41
- c.timezone 'Antarctica/Macquarie', -109, 2, 3179, 20, 'Macquarie Island Station, Macquarie Island'
42
40
  end
43
41
  country 'AR', 'Argentina' do |c|
44
42
  c.timezone 'America/Argentina/Buenos_Aires', -173, 5, -1169, 20, 'Buenos Aires (BA, CF)'
@@ -62,6 +60,7 @@ module TZInfo
62
60
  end
63
61
  country 'AU', 'Australia' do |c|
64
62
  c.timezone 'Australia/Lord_Howe', -631, 20, 1909, 12, 'Lord Howe Island'
63
+ c.timezone 'Antarctica/Macquarie', -109, 2, 3179, 20, 'Macquarie Island'
65
64
  c.timezone 'Australia/Hobart', -2573, 60, 8839, 60, 'Tasmania - most locations'
66
65
  c.timezone 'Australia/Currie', -599, 15, 2158, 15, 'Tasmania - King Island'
67
66
  c.timezone 'Australia/Melbourne', -2269, 60, 4349, 30, 'Victoria'
@@ -122,7 +121,7 @@ module TZInfo
122
121
  country 'BO', 'Bolivia' do |c|
123
122
  c.timezone 'America/La_Paz', -33, 2, -1363, 20
124
123
  end
125
- country 'BQ', 'Bonaire Sint Eustatius & Saba' do |c|
124
+ country 'BQ', 'Caribbean Netherlands' do |c|
126
125
  c.timezone 'America/Kralendijk', 14581, 1200, -20483, 300
127
126
  end
128
127
  country 'BR', 'Brazil' do |c|
@@ -166,8 +165,7 @@ module TZInfo
166
165
  c.timezone 'America/Moncton', 461, 10, -3887, 60, 'Atlantic Time - New Brunswick'
167
166
  c.timezone 'America/Goose_Bay', 160, 3, -725, 12, 'Atlantic Time - Labrador - most locations'
168
167
  c.timezone 'America/Blanc-Sablon', 617, 12, -3427, 60, 'Atlantic Standard Time - Quebec - Lower North Shore'
169
- c.timezone 'America/Montreal', 2731, 60, -2207, 30, 'Eastern Time - Quebec - most locations'
170
- c.timezone 'America/Toronto', 873, 20, -4763, 60, 'Eastern Time - Ontario - most locations'
168
+ c.timezone 'America/Toronto', 873, 20, -4763, 60, 'Eastern Time - Ontario & Quebec - most locations'
171
169
  c.timezone 'America/Nipigon', 2941, 60, -1324, 15, 'Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973'
172
170
  c.timezone 'America/Thunder_Bay', 2903, 60, -357, 4, 'Eastern Time - Thunder Bay, Ontario'
173
171
  c.timezone 'America/Iqaluit', 956, 15, -1027, 15, 'Eastern Time - east Nunavut - most locations'
@@ -398,7 +396,7 @@ module TZInfo
398
396
  c.timezone 'Europe/Dublin', 160, 3, -25, 4
399
397
  end
400
398
  country 'IL', 'Israel' do |c|
401
- c.timezone 'Asia/Jerusalem', 953, 30, 1057, 30
399
+ c.timezone 'Asia/Jerusalem', 11441, 360, 63403, 1800
402
400
  end
403
401
  country 'IM', 'Isle of Man' do |c|
404
402
  c.timezone 'Europe/Isle_of_Man', 1083, 20, -67, 15
@@ -425,7 +423,7 @@ module TZInfo
425
423
  c.timezone 'Europe/Jersey', 246, 5, -127, 60
426
424
  end
427
425
  country 'JM', 'Jamaica' do |c|
428
- c.timezone 'America/Jamaica', 18, 1, -384, 5
426
+ c.timezone 'America/Jamaica', 12937, 720, -11519, 150
429
427
  end
430
428
  country 'JO', 'Jordan' do |c|
431
429
  c.timezone 'Asia/Amman', 639, 20, 539, 15
@@ -765,7 +763,7 @@ module TZInfo
765
763
  country 'SV', 'El Salvador' do |c|
766
764
  c.timezone 'America/El_Salvador', 137, 10, -446, 5
767
765
  end
768
- country 'SX', 'Sint Maarten' do |c|
766
+ country 'SX', 'St Maarten (Dutch part)' do |c|
769
767
  c.timezone 'America/Lower_Princes', 12997, 720, -22697, 360
770
768
  end
771
769
  country 'SY', 'Syria' do |c|
@@ -856,8 +854,7 @@ module TZInfo
856
854
  c.timezone 'America/North_Dakota/Beulah', 56717, 1200, -916, 9, 'Central Time - North Dakota - Mercer County'
857
855
  c.timezone 'America/Denver', 47687, 1200, -125981, 1200, 'Mountain Time'
858
856
  c.timezone 'America/Boise', 157009, 3600, -46481, 400, 'Mountain Time - south Idaho & east Oregon'
859
- c.timezone 'America/Shiprock', 33107, 900, -391271, 3600, 'Mountain Time - Navajo'
860
- c.timezone 'America/Phoenix', 20069, 600, -16811, 150, 'Mountain Standard Time - Arizona'
857
+ c.timezone 'America/Phoenix', 20069, 600, -16811, 150, 'Mountain Standard Time - Arizona (except Navajo)'
861
858
  c.timezone 'America/Los_Angeles', 30647, 900, -212837, 1800, 'Pacific Time'
862
859
  c.timezone 'America/Anchorage', 44077, 720, -539641, 3600, 'Alaska Time'
863
860
  c.timezone 'America/Juneau', 209887, 3600, -483911, 3600, 'Alaska Time - Alaska panhandle'
@@ -29,7 +29,7 @@ module TZInfo
29
29
  timezone 'Africa/Gaborone'
30
30
  timezone 'Africa/Harare'
31
31
  timezone 'Africa/Johannesburg'
32
- timezone 'Africa/Juba'
32
+ linked_timezone 'Africa/Juba'
33
33
  timezone 'Africa/Kampala'
34
34
  timezone 'Africa/Khartoum'
35
35
  timezone 'Africa/Kigali'
@@ -59,7 +59,7 @@ module TZInfo
59
59
  timezone 'Africa/Windhoek'
60
60
  timezone 'America/Adak'
61
61
  timezone 'America/Anchorage'
62
- timezone 'America/Anguilla'
62
+ linked_timezone 'America/Anguilla'
63
63
  timezone 'America/Antigua'
64
64
  timezone 'America/Araguaina'
65
65
  timezone 'America/Argentina/Buenos_Aires'
@@ -75,7 +75,7 @@ module TZInfo
75
75
  timezone 'America/Argentina/San_Luis'
76
76
  timezone 'America/Argentina/Tucuman'
77
77
  timezone 'America/Argentina/Ushuaia'
78
- timezone 'America/Aruba'
78
+ linked_timezone 'America/Aruba'
79
79
  timezone 'America/Asuncion'
80
80
  timezone 'America/Atikokan'
81
81
  linked_timezone 'America/Atka'
@@ -109,7 +109,7 @@ module TZInfo
109
109
  timezone 'America/Dawson_Creek'
110
110
  timezone 'America/Denver'
111
111
  timezone 'America/Detroit'
112
- timezone 'America/Dominica'
112
+ linked_timezone 'America/Dominica'
113
113
  timezone 'America/Edmonton'
114
114
  timezone 'America/Eirunepe'
115
115
  timezone 'America/El_Salvador'
@@ -120,8 +120,8 @@ module TZInfo
120
120
  timezone 'America/Godthab'
121
121
  timezone 'America/Goose_Bay'
122
122
  timezone 'America/Grand_Turk'
123
- timezone 'America/Grenada'
124
- timezone 'America/Guadeloupe'
123
+ linked_timezone 'America/Grenada'
124
+ linked_timezone 'America/Guadeloupe'
125
125
  timezone 'America/Guatemala'
126
126
  timezone 'America/Guayaquil'
127
127
  timezone 'America/Guyana'
@@ -168,7 +168,7 @@ module TZInfo
168
168
  timezone 'America/Monterrey'
169
169
  timezone 'America/Montevideo'
170
170
  timezone 'America/Montreal'
171
- timezone 'America/Montserrat'
171
+ linked_timezone 'America/Montserrat'
172
172
  timezone 'America/Nassau'
173
173
  timezone 'America/New_York'
174
174
  timezone 'America/Nipigon'
@@ -204,17 +204,17 @@ module TZInfo
204
204
  timezone 'America/Sitka'
205
205
  linked_timezone 'America/St_Barthelemy'
206
206
  timezone 'America/St_Johns'
207
- timezone 'America/St_Kitts'
208
- timezone 'America/St_Lucia'
209
- timezone 'America/St_Thomas'
210
- timezone 'America/St_Vincent'
207
+ linked_timezone 'America/St_Kitts'
208
+ linked_timezone 'America/St_Lucia'
209
+ linked_timezone 'America/St_Thomas'
210
+ linked_timezone 'America/St_Vincent'
211
211
  timezone 'America/Swift_Current'
212
212
  timezone 'America/Tegucigalpa'
213
213
  timezone 'America/Thule'
214
214
  timezone 'America/Thunder_Bay'
215
215
  timezone 'America/Tijuana'
216
216
  timezone 'America/Toronto'
217
- timezone 'America/Tortola'
217
+ linked_timezone 'America/Tortola'
218
218
  timezone 'America/Vancouver'
219
219
  linked_timezone 'America/Virgin'
220
220
  timezone 'America/Whitehorse'
@@ -226,7 +226,7 @@ module TZInfo
226
226
  timezone 'Antarctica/DumontDUrville'
227
227
  timezone 'Antarctica/Macquarie'
228
228
  timezone 'Antarctica/Mawson'
229
- timezone 'Antarctica/McMurdo'
229
+ linked_timezone 'Antarctica/McMurdo'
230
230
  timezone 'Antarctica/Palmer'
231
231
  timezone 'Antarctica/Rothera'
232
232
  linked_timezone 'Antarctica/South_Pole'
@@ -470,7 +470,7 @@ module TZInfo
470
470
  timezone 'Europe/Tirane'
471
471
  linked_timezone 'Europe/Tiraspol'
472
472
  timezone 'Europe/Uzhgorod'
473
- timezone 'Europe/Vaduz'
473
+ linked_timezone 'Europe/Vaduz'
474
474
  linked_timezone 'Europe/Vatican'
475
475
  timezone 'Europe/Vienna'
476
476
  timezone 'Europe/Vilnius'
@@ -535,7 +535,7 @@ module TZInfo
535
535
  timezone 'Pacific/Guadalcanal'
536
536
  timezone 'Pacific/Guam'
537
537
  timezone 'Pacific/Honolulu'
538
- timezone 'Pacific/Johnston'
538
+ linked_timezone 'Pacific/Johnston'
539
539
  timezone 'Pacific/Kiritimati'
540
540
  timezone 'Pacific/Kosrae'
541
541
  timezone 'Pacific/Kwajalein'
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2010 Philip Ross
2
+ # Copyright (c) 2006-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -23,6 +23,8 @@
23
23
  module TZInfo
24
24
 
25
25
  # A Timezone based on a TimezoneInfo.
26
+ #
27
+ # @private
26
28
  class InfoTimezone < Timezone #:nodoc:
27
29
 
28
30
  # Constructs a new InfoTimezone with a TimezoneInfo instance.
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2010 Philip Ross
2
+ # Copyright (c) 2006-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -22,6 +22,9 @@
22
22
 
23
23
  module TZInfo
24
24
 
25
+ # A Timezone based on a LinkedTimezoneInfo.
26
+ #
27
+ # @private
25
28
  class LinkedTimezone < InfoTimezone #:nodoc:
26
29
  # Returns the TimezonePeriod for the given UTC time. utc can either be
27
30
  # a DateTime, Time or integer timestamp (Time.to_i). Any timezone
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2010 Philip Ross
2
+ # Copyright (c) 2006-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -22,6 +22,8 @@
22
22
 
23
23
  module TZInfo
24
24
  # Represents a linked timezone defined in a data module.
25
+ #
26
+ # @private
25
27
  class LinkedTimezoneInfo < TimezoneInfo #:nodoc:
26
28
 
27
29
  # The zone that provides the data (that this zone is an alias for).
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2010 Philip Ross
2
+ # Copyright (c) 2006-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -26,7 +26,9 @@ module TZInfo
26
26
 
27
27
  # Provides a method for getting Rationals for a timezone offset in seconds.
28
28
  # Pre-reduced rationals are returned for all the half-hour intervals between
29
- # -14 and +14 hours to avoid having to call gcd at runtime.
29
+ # -14 and +14 hours to avoid having to call gcd at runtime.
30
+ #
31
+ # @private
30
32
  module OffsetRationals #:nodoc:
31
33
  @@rational_cache = {
32
34
  -50400 => RubyCoreSupport.rational_new!(-7,12),
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2008-2010 Philip Ross
2
+ # Copyright (c) 2008-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -26,6 +26,8 @@ require 'rational' unless defined?(Rational)
26
26
  module TZInfo
27
27
 
28
28
  # Methods to support different versions of Ruby.
29
+ #
30
+ # @private
29
31
  module RubyCoreSupport #:nodoc:
30
32
 
31
33
  # Use Rational.new! for performance reasons in Ruby 1.8.
@@ -77,4 +79,4 @@ module TZInfo
77
79
  end
78
80
  end
79
81
  end
80
- end
82
+ end
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2012 Philip Ross
2
+ # Copyright (c) 2006-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -26,6 +26,8 @@ require 'time'
26
26
  module TZInfo
27
27
  # Used by TZInfo internally to represent either a Time, DateTime or integer
28
28
  # timestamp (seconds since 1970-01-01 00:00:00).
29
+ #
30
+ # @private
29
31
  class TimeOrDateTime #:nodoc:
30
32
  include Comparable
31
33
 
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005-2010 Philip Ross
2
+ # Copyright (c) 2005-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -63,13 +63,19 @@ module TZInfo
63
63
 
64
64
  # Cache of loaded zones by identifier to avoid using require if a zone
65
65
  # has already been loaded.
66
+ #
67
+ # @!visibility private
66
68
  @@loaded_zones = {}
67
69
 
68
70
  # Whether the timezones index has been loaded yet.
71
+ #
72
+ # @!visibility private
69
73
  @@index_loaded = false
70
74
 
71
75
  # Default value of the dst parameter of the local_to_utc and
72
76
  # period_for_local methods.
77
+ #
78
+ # @!visibility private
73
79
  @@default_dst = nil
74
80
 
75
81
  # Sets the default value of the optional dst parameter of the
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2010 Philip Ross
2
+ # Copyright (c) 2006-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -24,6 +24,8 @@ module TZInfo
24
24
 
25
25
  # TimezoneDefinition is included into Timezone definition modules.
26
26
  # TimezoneDefinition provides the methods for defining timezones.
27
+ #
28
+ # @private
27
29
  module TimezoneDefinition #:nodoc:
28
30
  # Add class methods to the includee.
29
31
  def self.append_features(base)
@@ -32,6 +34,8 @@ module TZInfo
32
34
  end
33
35
 
34
36
  # Class methods for inclusion.
37
+ #
38
+ # @private
35
39
  module ClassMethods #:nodoc:
36
40
  # Returns and yields a DataTimezoneInfo object to define a timezone.
37
41
  def timezone(identifier)
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006 Philip Ross
2
+ # Copyright (c) 2006-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -23,6 +23,8 @@
23
23
  module TZInfo
24
24
  # The timezone index file includes TimezoneIndexDefinition which provides
25
25
  # methods used to define timezones in the index.
26
+ #
27
+ # @private
26
28
  module TimezoneIndexDefinition #:nodoc:
27
29
  def self.append_features(base)
28
30
  super
@@ -34,6 +36,9 @@ module TZInfo
34
36
  end
35
37
  end
36
38
 
39
+ # Class methods for inclusion.
40
+ #
41
+ # @private
37
42
  module ClassMethods #:nodoc:
38
43
  # Defines a timezone based on data.
39
44
  def timezone(identifier)
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006 Philip Ross
2
+ # Copyright (c) 2006-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -22,6 +22,8 @@
22
22
 
23
23
  module TZInfo
24
24
  # Represents a timezone defined in a data module.
25
+ #
26
+ # @private
25
27
  class TimezoneInfo #:nodoc:
26
28
 
27
29
  # The timezone identifier.
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2012 Philip Ross
2
+ # Copyright (c) 2006-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -22,6 +22,8 @@
22
22
 
23
23
  module TZInfo
24
24
  # Represents an offset defined in a Timezone data file.
25
+ #
26
+ # @private
25
27
  class TimezoneOffsetInfo #:nodoc:
26
28
  # The base offset of the timezone from UTC in seconds.
27
29
  attr_reader :utc_offset
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2012 Philip Ross
2
+ # Copyright (c) 2006-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -24,6 +24,8 @@ require 'date'
24
24
 
25
25
  module TZInfo
26
26
  # Represents an offset defined in a Timezone data file.
27
+ #
28
+ # @private
27
29
  class TimezoneTransitionInfo #:nodoc:
28
30
  # The offset this transition changes to (a TimezoneOffsetInfo instance).
29
31
  attr_reader :offset
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005-2010 Philip Ross
2
+ # Copyright (c) 2005-2013 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -73,17 +73,15 @@ module TZInfo
73
73
  # Reads the tzdata source and generates the classes. Takes a long time
74
74
  # to run. Currently outputs debugging information to standard out.
75
75
  def execute
76
- Dir.foreach(@input_dir) {|file|
77
- load_rules(file) if file =~ /^[^\.]+$/
78
- }
79
-
80
- Dir.foreach(@input_dir) {|file|
81
- load_zones(file) if file =~ /^[^\.]+$/
82
- }
83
-
84
- Dir.foreach(@input_dir) {|file|
85
- load_links(file) if file =~ /^[^\.]+$/
86
- }
76
+ files = Dir.entries(@input_dir).select do |file|
77
+ file =~ /\A[^\.]+\z/ &&
78
+ !%w(leapseconds leapseconds.awk leap-seconds.list Makefile README SOURCE).include?(file) &&
79
+ File.file?(File.join(@input_dir, file))
80
+ end
81
+
82
+ files.each {|file| load_rules(file) }
83
+ files.each {|file| load_zones(file) }
84
+ files.each {|file| load_links(file) }
87
85
 
88
86
  load_countries
89
87
 
@@ -341,6 +339,8 @@ module TZInfo
341
339
  end
342
340
 
343
341
  # Base class for all rule sets.
342
+ #
343
+ # @private
344
344
  class TZDataRules #:nodoc:
345
345
  # Name of the rule set, e.g. EU.
346
346
  attr_reader :name
@@ -355,6 +355,8 @@ module TZInfo
355
355
  end
356
356
 
357
357
  # Empty rule set with a fixed daylight savings (std) offset.
358
+ #
359
+ # @private
358
360
  class TZDataFixedOffsetRules < TZDataRules #:nodoc:
359
361
  attr_reader :offset
360
362
 
@@ -365,6 +367,8 @@ module TZInfo
365
367
  end
366
368
 
367
369
  # An empty set of rules.
370
+ #
371
+ # @private
368
372
  class TZDataNoRules < TZDataRules #:nodoc:
369
373
  def initialize
370
374
  super('-')
@@ -372,6 +376,8 @@ module TZInfo
372
376
  end
373
377
 
374
378
  # A rule set (as defined by Rule name in the tz data).
379
+ #
380
+ # @private
375
381
  class TZDataRuleSet < TZDataRules #:nodoc:
376
382
  attr_reader :rules
377
383
 
@@ -395,6 +401,8 @@ module TZInfo
395
401
  end
396
402
 
397
403
  # A rule in a RuleSet (a single Rule line in the tz data).
404
+ #
405
+ # @private
398
406
  class TZDataRule #:nodoc:
399
407
  attr_reader :from
400
408
  attr_reader :to
@@ -476,6 +484,8 @@ module TZInfo
476
484
  end
477
485
 
478
486
  # Base class for Zones and Links.
487
+ #
488
+ # @private
479
489
  class TZDataDefinition #:nodoc:
480
490
  attr_reader :name
481
491
  attr_reader :name_elements
@@ -539,6 +549,8 @@ module TZInfo
539
549
  end
540
550
 
541
551
  # A tz data Link.
552
+ #
553
+ # @private
542
554
  class TZDataLink < TZDataDefinition #:nodoc:
543
555
  attr_reader :link_to
544
556
 
@@ -563,6 +575,8 @@ module TZInfo
563
575
  end
564
576
 
565
577
  # A tz data Zone. Each line from the tz data is loaded as a TZDataObservance.
578
+ #
579
+ # @private
566
580
  class TZDataZone < TZDataDefinition #:nodoc:
567
581
  attr_reader :observances
568
582
 
@@ -693,6 +707,8 @@ module TZInfo
693
707
  end
694
708
 
695
709
  # A observance within a zone (a line within the zone definition).
710
+ #
711
+ # @private
696
712
  class TZDataObservance #:nodoc:
697
713
  attr_reader :utc_offset
698
714
  attr_reader :rule_set
@@ -716,6 +732,8 @@ module TZInfo
716
732
  end
717
733
 
718
734
  # Collection of TZDataTransition instances used when building a zone class.
735
+ #
736
+ # @private
719
737
  class TZDataTransitions #:nodoc:
720
738
 
721
739
  def initialize
@@ -850,6 +868,8 @@ module TZInfo
850
868
  end
851
869
 
852
870
  # A transition that will be used to write the periods in a zone class.
871
+ #
872
+ # @private
853
873
  class TZDataTransition #:nodoc:
854
874
  include Comparable
855
875
 
@@ -908,6 +928,8 @@ module TZInfo
908
928
  end
909
929
 
910
930
  # An instance of a rule for a year.
931
+ #
932
+ # @private
911
933
  class TZDataActivatedRule #:nodoc:
912
934
  attr_reader :rule
913
935
  attr_reader :year
@@ -926,6 +948,8 @@ module TZInfo
926
948
 
927
949
  # A tz data time definition - an hour, minute, second and reference. Reference
928
950
  # is either :utc, :standard or :wall_clock.
951
+ #
952
+ # @private
929
953
  class TZDataTime #:nodoc:
930
954
  attr_reader :hour
931
955
  attr_reader :minute
@@ -960,6 +984,8 @@ module TZInfo
960
984
 
961
985
  # A tz data day of the month reference. Can either be an absolute day,
962
986
  # a last week day or a week day >= or <= than a specific day of month.
987
+ #
988
+ # @private
963
989
  class TZDataDayOfMonth #:nodoc:
964
990
  attr_reader :type
965
991
  attr_reader :day_of_month
@@ -1044,6 +1070,8 @@ module TZInfo
1044
1070
  end
1045
1071
 
1046
1072
  # A tz data Zone until reference.
1073
+ #
1074
+ # @private
1047
1075
  class TZDataUntil #:nodoc:
1048
1076
  attr_reader :year
1049
1077
  attr_reader :month
@@ -1068,6 +1096,8 @@ module TZInfo
1068
1096
 
1069
1097
  # A tz data Zone format string. Either alternate standard/daylight-savings,
1070
1098
  # substitution (%s) format or a fixed string.
1099
+ #
1100
+ # @private
1071
1101
  class TZDataFormat #:nodoc:
1072
1102
  def initialize(spec)
1073
1103
  if spec =~ /([A-z]+)\/([A-z]+)/
@@ -1110,6 +1140,8 @@ module TZInfo
1110
1140
  end
1111
1141
 
1112
1142
  # A location (latitude + longitude)
1143
+ #
1144
+ # @private
1113
1145
  class TZDataLocation #:nodoc:
1114
1146
  attr_reader :latitude
1115
1147
  attr_reader :longitude
@@ -1132,10 +1164,13 @@ module TZInfo
1132
1164
  @longitude = -@longitude if $5 == '-'
1133
1165
  end
1134
1166
  end
1135
-
1167
+
1168
+ # @private
1136
1169
  TZDataCountryTimezone = Struct.new(:timezone, :description, :location)
1137
1170
 
1138
1171
  # An ISO 3166 country.
1172
+ #
1173
+ # @private
1139
1174
  class TZDataCountry #:nodoc:
1140
1175
  attr_reader :code
1141
1176
  attr_reader :name