tzinfo 1.2.11 → 2.0.0

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.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.yardopts +3 -0
  4. data/CHANGES.md +469 -431
  5. data/LICENSE +13 -13
  6. data/README.md +368 -114
  7. data/lib/tzinfo/country.rb +131 -129
  8. data/lib/tzinfo/country_timezone.rb +70 -112
  9. data/lib/tzinfo/data_source.rb +389 -144
  10. data/lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb +56 -0
  11. data/lib/tzinfo/data_sources/country_info.rb +42 -0
  12. data/lib/tzinfo/data_sources/data_timezone_info.rb +91 -0
  13. data/lib/tzinfo/data_sources/linked_timezone_info.rb +33 -0
  14. data/lib/tzinfo/data_sources/ruby_data_source.rb +141 -0
  15. data/lib/tzinfo/data_sources/timezone_info.rb +47 -0
  16. data/lib/tzinfo/data_sources/transitions_data_timezone_info.rb +214 -0
  17. data/lib/tzinfo/data_sources/zoneinfo_data_source.rb +573 -0
  18. data/lib/tzinfo/data_sources/zoneinfo_reader.rb +284 -0
  19. data/lib/tzinfo/data_sources.rb +8 -0
  20. data/lib/tzinfo/data_timezone.rb +33 -47
  21. data/lib/tzinfo/datetime_with_offset.rb +153 -0
  22. data/lib/tzinfo/format1/country_definer.rb +17 -0
  23. data/lib/tzinfo/format1/country_index_definition.rb +64 -0
  24. data/lib/tzinfo/format1/timezone_definer.rb +64 -0
  25. data/lib/tzinfo/format1/timezone_definition.rb +39 -0
  26. data/lib/tzinfo/format1/timezone_index_definition.rb +77 -0
  27. data/lib/tzinfo/format1.rb +10 -0
  28. data/lib/tzinfo/format2/country_definer.rb +68 -0
  29. data/lib/tzinfo/format2/country_index_definer.rb +68 -0
  30. data/lib/tzinfo/format2/country_index_definition.rb +46 -0
  31. data/lib/tzinfo/format2/timezone_definer.rb +94 -0
  32. data/lib/tzinfo/format2/timezone_definition.rb +73 -0
  33. data/lib/tzinfo/format2/timezone_index_definer.rb +45 -0
  34. data/lib/tzinfo/format2/timezone_index_definition.rb +55 -0
  35. data/lib/tzinfo/format2.rb +10 -0
  36. data/lib/tzinfo/info_timezone.rb +26 -21
  37. data/lib/tzinfo/linked_timezone.rb +33 -52
  38. data/lib/tzinfo/offset_timezone_period.rb +42 -0
  39. data/lib/tzinfo/string_deduper.rb +118 -0
  40. data/lib/tzinfo/time_with_offset.rb +128 -0
  41. data/lib/tzinfo/timestamp.rb +548 -0
  42. data/lib/tzinfo/timestamp_with_offset.rb +85 -0
  43. data/lib/tzinfo/timezone.rb +979 -502
  44. data/lib/tzinfo/timezone_offset.rb +84 -74
  45. data/lib/tzinfo/timezone_period.rb +151 -217
  46. data/lib/tzinfo/timezone_proxy.rb +70 -79
  47. data/lib/tzinfo/timezone_transition.rb +77 -109
  48. data/lib/tzinfo/transitions_timezone_period.rb +63 -0
  49. data/lib/tzinfo/version.rb +7 -0
  50. data/lib/tzinfo/with_offset.rb +61 -0
  51. data/lib/tzinfo.rb +60 -40
  52. data.tar.gz.sig +0 -0
  53. metadata +51 -115
  54. metadata.gz.sig +2 -3
  55. data/Rakefile +0 -107
  56. data/lib/tzinfo/annual_rules.rb +0 -51
  57. data/lib/tzinfo/country_index_definition.rb +0 -31
  58. data/lib/tzinfo/country_info.rb +0 -42
  59. data/lib/tzinfo/data_timezone_info.rb +0 -55
  60. data/lib/tzinfo/linked_timezone_info.rb +0 -26
  61. data/lib/tzinfo/offset_rationals.rb +0 -77
  62. data/lib/tzinfo/posix_time_zone_parser.rb +0 -136
  63. data/lib/tzinfo/ruby_core_support.rb +0 -176
  64. data/lib/tzinfo/ruby_country_info.rb +0 -74
  65. data/lib/tzinfo/ruby_data_source.rb +0 -136
  66. data/lib/tzinfo/time_or_datetime.rb +0 -351
  67. data/lib/tzinfo/timezone_definition.rb +0 -36
  68. data/lib/tzinfo/timezone_index_definition.rb +0 -54
  69. data/lib/tzinfo/timezone_info.rb +0 -30
  70. data/lib/tzinfo/timezone_transition_definition.rb +0 -104
  71. data/lib/tzinfo/transition_data_timezone_info.rb +0 -274
  72. data/lib/tzinfo/transition_rule.rb +0 -325
  73. data/lib/tzinfo/zoneinfo_country_info.rb +0 -37
  74. data/lib/tzinfo/zoneinfo_data_source.rb +0 -504
  75. data/lib/tzinfo/zoneinfo_timezone_info.rb +0 -516
  76. data/test/assets/payload.rb +0 -1
  77. data/test/tc_annual_rules.rb +0 -95
  78. data/test/tc_country.rb +0 -240
  79. data/test/tc_country_index_definition.rb +0 -69
  80. data/test/tc_country_info.rb +0 -16
  81. data/test/tc_country_timezone.rb +0 -173
  82. data/test/tc_data_source.rb +0 -218
  83. data/test/tc_data_timezone.rb +0 -99
  84. data/test/tc_data_timezone_info.rb +0 -18
  85. data/test/tc_info_timezone.rb +0 -34
  86. data/test/tc_linked_timezone.rb +0 -155
  87. data/test/tc_linked_timezone_info.rb +0 -23
  88. data/test/tc_offset_rationals.rb +0 -23
  89. data/test/tc_posix_time_zone_parser.rb +0 -261
  90. data/test/tc_ruby_core_support.rb +0 -168
  91. data/test/tc_ruby_country_info.rb +0 -110
  92. data/test/tc_ruby_data_source.rb +0 -175
  93. data/test/tc_time_or_datetime.rb +0 -674
  94. data/test/tc_timezone.rb +0 -1361
  95. data/test/tc_timezone_definition.rb +0 -113
  96. data/test/tc_timezone_index_definition.rb +0 -73
  97. data/test/tc_timezone_info.rb +0 -11
  98. data/test/tc_timezone_london.rb +0 -143
  99. data/test/tc_timezone_melbourne.rb +0 -142
  100. data/test/tc_timezone_new_york.rb +0 -142
  101. data/test/tc_timezone_offset.rb +0 -126
  102. data/test/tc_timezone_period.rb +0 -555
  103. data/test/tc_timezone_proxy.rb +0 -136
  104. data/test/tc_timezone_transition.rb +0 -366
  105. data/test/tc_timezone_transition_definition.rb +0 -295
  106. data/test/tc_timezone_utc.rb +0 -27
  107. data/test/tc_transition_data_timezone_info.rb +0 -433
  108. data/test/tc_transition_rule.rb +0 -663
  109. data/test/tc_zoneinfo_country_info.rb +0 -78
  110. data/test/tc_zoneinfo_data_source.rb +0 -1226
  111. data/test/tc_zoneinfo_timezone_info.rb +0 -2149
  112. data/test/test_utils.rb +0 -214
  113. data/test/ts_all.rb +0 -7
  114. data/test/ts_all_ruby.rb +0 -5
  115. data/test/ts_all_zoneinfo.rb +0 -9
  116. data/test/tzinfo-data/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb +0 -89
  117. data/test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb +0 -327
  118. data/test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb +0 -230
  119. data/test/tzinfo-data/tzinfo/data/definitions/EST.rb +0 -19
  120. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__m__1.rb +0 -21
  121. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__p__1.rb +0 -21
  122. data/test/tzinfo-data/tzinfo/data/definitions/Etc/UTC.rb +0 -21
  123. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb +0 -273
  124. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb +0 -198
  125. data/test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb +0 -333
  126. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb +0 -277
  127. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb +0 -235
  128. data/test/tzinfo-data/tzinfo/data/definitions/UTC.rb +0 -16
  129. data/test/tzinfo-data/tzinfo/data/indexes/countries.rb +0 -940
  130. data/test/tzinfo-data/tzinfo/data/indexes/timezones.rb +0 -609
  131. data/test/tzinfo-data/tzinfo/data/version.rb +0 -20
  132. data/test/tzinfo-data/tzinfo/data.rb +0 -8
  133. data/test/zoneinfo/America/Argentina/Buenos_Aires +0 -0
  134. data/test/zoneinfo/America/New_York +0 -0
  135. data/test/zoneinfo/Australia/Melbourne +0 -0
  136. data/test/zoneinfo/EST +0 -0
  137. data/test/zoneinfo/Etc/UTC +0 -0
  138. data/test/zoneinfo/Europe/Amsterdam +0 -0
  139. data/test/zoneinfo/Europe/Andorra +0 -0
  140. data/test/zoneinfo/Europe/London +0 -0
  141. data/test/zoneinfo/Europe/Paris +0 -0
  142. data/test/zoneinfo/Europe/Prague +0 -0
  143. data/test/zoneinfo/Factory +0 -0
  144. data/test/zoneinfo/iso3166.tab +0 -274
  145. data/test/zoneinfo/leapseconds +0 -78
  146. data/test/zoneinfo/posix/Europe/London +0 -0
  147. data/test/zoneinfo/posixrules +0 -0
  148. data/test/zoneinfo/right/Europe/London +0 -0
  149. data/test/zoneinfo/zone.tab +0 -452
  150. data/test/zoneinfo/zone1970.tab +0 -384
  151. data/tzinfo.gemspec +0 -21
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.11
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Ross
@@ -11,8 +11,8 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDPDCCAiSgAwIBAgIBATANBgkqhkiG9w0BAQsFADAkMSIwIAYDVQQDDBlwaGls
14
- LnJvc3MvREM9Z21haWwvREM9Y29tMB4XDTE5MTIyNDE0NTU0N1oXDTM5MTIyNDE0
15
- NTU0N1owJDEiMCAGA1UEAwwZcGhpbC5yb3NzL0RDPWdtYWlsL0RDPWNvbTCCASIw
14
+ LnJvc3MvREM9Z21haWwvREM9Y29tMB4XDTE4MTAyNzE3NTQyNVoXDTE5MTAyNzE3
15
+ NTQyNVowJDEiMCAGA1UEAwwZcGhpbC5yb3NzL0RDPWdtYWlsL0RDPWNvbTCCASIw
16
16
  DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJGcwfqn4ZsmPl0b1Lt9dCzExrE5
17
17
  EeP/CRQjBdGHkF+mSpi69XysxdwLdfg5SPr9LfxthUug4nNFd5fDCiXM8hYe9jQD
18
18
  TmkIQKNBh4fFpGngn9gyy+SumCXi6b5L6d/aMc59NAOM6LJ88TOdH1648dh5rq3C
@@ -22,31 +22,31 @@ cert_chain:
22
22
  AaN5MHcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFA+Z8zvfzBuA
23
23
  esoHIfz7+jxfUOcfMB4GA1UdEQQXMBWBE3BoaWwucm9zc0BnbWFpbC5jb20wHgYD
24
24
  VR0SBBcwFYETcGhpbC5yb3NzQGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEA
25
- J80xgZ3gGdQVA8N+8NJANU5HLuZIU9jOaAlziU9ImoTgPiOHKGZC4as1TwT4kBt1
26
- Qcnu7YSANYRrxP5tpOHsWPF/MQYgerAFCZS5+PzOTudwZ+7OsMW4/EMHy6aCVHEd
27
- c7HzQRC4mSrDRpWxzyBnZ5nX5OAmIkKA8NgeKybT/4Ku6iFPPUQwlyxQaO+Wlxdo
28
- FqHwpjRyoiVSpe4RUTNK3d3qesWPYi7Lxn6k6ZZeEdvG6ya33AXktE3jmmF+jPR1
29
- J3Zn/kSTjTekiaspyGbczC3PUaeJNxr+yCvR4sk71Xmk/GaKKGOHedJ1uj/LAXrA
30
- MR0mpl7b8zCg0PFC1J73uw==
25
+ G7spOhX+wjEVvsn5KAqbeDXcRhnuAzz/DbAq8xkG84etG4HNNdGxe8z7DY0YuqQQ
26
+ uau4AXpjQwtXRp6wYrzLjpn6Gsj0NGcv9TOcxHPPpr/cZnFuLdN5Sk7Q1sK8OuJ1
27
+ 7JSj/nRsuNVgoo5dSAghVbCUNd2Ch31oDGPQFzedmKo09mNTd72CfcjzrjXaHDIB
28
+ ObXSs1zIhlYXDJGC5Dpr1/fG2W7bd8xt4UwQBH8u53KKYbHjHcbF+9x3O9TDweZq
29
+ lDDjxNrOZq4IuD3jrJI+T95Lo5RSCenQmPnJIGtfaoN+omC2q0HMFNx31TcWCcC8
30
+ Y2Wt5gQskVrMQo+j0zgJcw==
31
31
  -----END CERTIFICATE-----
32
- date: 2023-01-28 00:00:00.000000000 Z
32
+ date: 2018-12-26 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
- name: thread_safe
35
+ name: concurrent-ruby
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.1'
40
+ version: '1.0'
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.1'
48
- description: TZInfo provides daylight savings aware transformations between times
49
- in different time zones.
47
+ version: '1.0'
48
+ description: TZInfo provides access to time zone data and allows times to be converted
49
+ using time zone rules.
50
50
  email: phil.ross@gmail.com
51
51
  executables: []
52
52
  extensions: []
@@ -59,115 +59,51 @@ files:
59
59
  - CHANGES.md
60
60
  - LICENSE
61
61
  - README.md
62
- - Rakefile
63
62
  - lib/tzinfo.rb
64
- - lib/tzinfo/annual_rules.rb
65
63
  - lib/tzinfo/country.rb
66
- - lib/tzinfo/country_index_definition.rb
67
- - lib/tzinfo/country_info.rb
68
64
  - lib/tzinfo/country_timezone.rb
69
65
  - lib/tzinfo/data_source.rb
66
+ - lib/tzinfo/data_sources.rb
67
+ - lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb
68
+ - lib/tzinfo/data_sources/country_info.rb
69
+ - lib/tzinfo/data_sources/data_timezone_info.rb
70
+ - lib/tzinfo/data_sources/linked_timezone_info.rb
71
+ - lib/tzinfo/data_sources/ruby_data_source.rb
72
+ - lib/tzinfo/data_sources/timezone_info.rb
73
+ - lib/tzinfo/data_sources/transitions_data_timezone_info.rb
74
+ - lib/tzinfo/data_sources/zoneinfo_data_source.rb
75
+ - lib/tzinfo/data_sources/zoneinfo_reader.rb
70
76
  - lib/tzinfo/data_timezone.rb
71
- - lib/tzinfo/data_timezone_info.rb
77
+ - lib/tzinfo/datetime_with_offset.rb
78
+ - lib/tzinfo/format1.rb
79
+ - lib/tzinfo/format1/country_definer.rb
80
+ - lib/tzinfo/format1/country_index_definition.rb
81
+ - lib/tzinfo/format1/timezone_definer.rb
82
+ - lib/tzinfo/format1/timezone_definition.rb
83
+ - lib/tzinfo/format1/timezone_index_definition.rb
84
+ - lib/tzinfo/format2.rb
85
+ - lib/tzinfo/format2/country_definer.rb
86
+ - lib/tzinfo/format2/country_index_definer.rb
87
+ - lib/tzinfo/format2/country_index_definition.rb
88
+ - lib/tzinfo/format2/timezone_definer.rb
89
+ - lib/tzinfo/format2/timezone_definition.rb
90
+ - lib/tzinfo/format2/timezone_index_definer.rb
91
+ - lib/tzinfo/format2/timezone_index_definition.rb
72
92
  - lib/tzinfo/info_timezone.rb
73
93
  - lib/tzinfo/linked_timezone.rb
74
- - lib/tzinfo/linked_timezone_info.rb
75
- - lib/tzinfo/offset_rationals.rb
76
- - lib/tzinfo/posix_time_zone_parser.rb
77
- - lib/tzinfo/ruby_core_support.rb
78
- - lib/tzinfo/ruby_country_info.rb
79
- - lib/tzinfo/ruby_data_source.rb
80
- - lib/tzinfo/time_or_datetime.rb
94
+ - lib/tzinfo/offset_timezone_period.rb
95
+ - lib/tzinfo/string_deduper.rb
96
+ - lib/tzinfo/time_with_offset.rb
97
+ - lib/tzinfo/timestamp.rb
98
+ - lib/tzinfo/timestamp_with_offset.rb
81
99
  - lib/tzinfo/timezone.rb
82
- - lib/tzinfo/timezone_definition.rb
83
- - lib/tzinfo/timezone_index_definition.rb
84
- - lib/tzinfo/timezone_info.rb
85
100
  - lib/tzinfo/timezone_offset.rb
86
101
  - lib/tzinfo/timezone_period.rb
87
102
  - lib/tzinfo/timezone_proxy.rb
88
103
  - lib/tzinfo/timezone_transition.rb
89
- - lib/tzinfo/timezone_transition_definition.rb
90
- - lib/tzinfo/transition_data_timezone_info.rb
91
- - lib/tzinfo/transition_rule.rb
92
- - lib/tzinfo/zoneinfo_country_info.rb
93
- - lib/tzinfo/zoneinfo_data_source.rb
94
- - lib/tzinfo/zoneinfo_timezone_info.rb
95
- - test/assets/payload.rb
96
- - test/tc_annual_rules.rb
97
- - test/tc_country.rb
98
- - test/tc_country_index_definition.rb
99
- - test/tc_country_info.rb
100
- - test/tc_country_timezone.rb
101
- - test/tc_data_source.rb
102
- - test/tc_data_timezone.rb
103
- - test/tc_data_timezone_info.rb
104
- - test/tc_info_timezone.rb
105
- - test/tc_linked_timezone.rb
106
- - test/tc_linked_timezone_info.rb
107
- - test/tc_offset_rationals.rb
108
- - test/tc_posix_time_zone_parser.rb
109
- - test/tc_ruby_core_support.rb
110
- - test/tc_ruby_country_info.rb
111
- - test/tc_ruby_data_source.rb
112
- - test/tc_time_or_datetime.rb
113
- - test/tc_timezone.rb
114
- - test/tc_timezone_definition.rb
115
- - test/tc_timezone_index_definition.rb
116
- - test/tc_timezone_info.rb
117
- - test/tc_timezone_london.rb
118
- - test/tc_timezone_melbourne.rb
119
- - test/tc_timezone_new_york.rb
120
- - test/tc_timezone_offset.rb
121
- - test/tc_timezone_period.rb
122
- - test/tc_timezone_proxy.rb
123
- - test/tc_timezone_transition.rb
124
- - test/tc_timezone_transition_definition.rb
125
- - test/tc_timezone_utc.rb
126
- - test/tc_transition_data_timezone_info.rb
127
- - test/tc_transition_rule.rb
128
- - test/tc_zoneinfo_country_info.rb
129
- - test/tc_zoneinfo_data_source.rb
130
- - test/tc_zoneinfo_timezone_info.rb
131
- - test/test_utils.rb
132
- - test/ts_all.rb
133
- - test/ts_all_ruby.rb
134
- - test/ts_all_zoneinfo.rb
135
- - test/tzinfo-data/tzinfo/data.rb
136
- - test/tzinfo-data/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb
137
- - test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb
138
- - test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb
139
- - test/tzinfo-data/tzinfo/data/definitions/EST.rb
140
- - test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__m__1.rb
141
- - test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__p__1.rb
142
- - test/tzinfo-data/tzinfo/data/definitions/Etc/UTC.rb
143
- - test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb
144
- - test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb
145
- - test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb
146
- - test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb
147
- - test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb
148
- - test/tzinfo-data/tzinfo/data/definitions/UTC.rb
149
- - test/tzinfo-data/tzinfo/data/indexes/countries.rb
150
- - test/tzinfo-data/tzinfo/data/indexes/timezones.rb
151
- - test/tzinfo-data/tzinfo/data/version.rb
152
- - test/zoneinfo/America/Argentina/Buenos_Aires
153
- - test/zoneinfo/America/New_York
154
- - test/zoneinfo/Australia/Melbourne
155
- - test/zoneinfo/EST
156
- - test/zoneinfo/Etc/UTC
157
- - test/zoneinfo/Europe/Amsterdam
158
- - test/zoneinfo/Europe/Andorra
159
- - test/zoneinfo/Europe/London
160
- - test/zoneinfo/Europe/Paris
161
- - test/zoneinfo/Europe/Prague
162
- - test/zoneinfo/Factory
163
- - test/zoneinfo/iso3166.tab
164
- - test/zoneinfo/leapseconds
165
- - test/zoneinfo/posix/Europe/London
166
- - test/zoneinfo/posixrules
167
- - test/zoneinfo/right/Europe/London
168
- - test/zoneinfo/zone.tab
169
- - test/zoneinfo/zone1970.tab
170
- - tzinfo.gemspec
104
+ - lib/tzinfo/transitions_timezone_period.rb
105
+ - lib/tzinfo/version.rb
106
+ - lib/tzinfo/with_offset.rb
171
107
  homepage: https://tzinfo.github.io
172
108
  licenses:
173
109
  - MIT
@@ -184,15 +120,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
184
120
  requirements:
185
121
  - - ">="
186
122
  - !ruby/object:Gem::Version
187
- version: 1.8.7
123
+ version: 1.9.3
188
124
  required_rubygems_version: !ruby/object:Gem::Requirement
189
125
  requirements:
190
126
  - - ">="
191
127
  - !ruby/object:Gem::Version
192
128
  version: '0'
193
129
  requirements: []
194
- rubygems_version: 3.4.5
130
+ rubygems_version: 3.0.1
195
131
  signing_key:
196
132
  specification_version: 4
197
- summary: Daylight savings aware timezone library
133
+ summary: Time Zone Library
198
134
  test_files: []
metadata.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- p����Ӳ��R��.�7��[�u��U9Rf��6���\@���mg��/��찐������.ǫ
2
- &N��Ln�6Z�~���M4~PlԱ�٬�Z~�,C�7;��l�!k�����s���H*���U�踥�0<*k ���vIs22�q���t��a� ����u2�z=<���=�h�rN:f�Ӏ<�;�l��C��-ݐ֡ʐ��M�)���^O��6 �!A'(��n�
3
- W�8���
1
+ x��^ ����zt��CR�n4"f܀��E���S��׺;�yUQKɪGI$��lz3�o��xuؙ��8����������i};���{�j������Ly�r�L�|.�U8<X�1q���d���?td1T��zS���i��u��0��n�\AQ�;J��"
2
+ `f����㛌���W��*���ʃ� ���yNfO�j�a��a��^)ۮ��2�ꇄ�'뉩JW]${i+���4il�����A��z�>
data/Rakefile DELETED
@@ -1,107 +0,0 @@
1
- require 'rubygems'
2
- require 'rubygems/package_task'
3
- require 'fileutils'
4
- require 'rake/testtask'
5
-
6
- # Ignore errors loading rdoc/task (the rdoc tasks will be excluded if
7
- # rdoc is unavailable).
8
- begin
9
- require 'rdoc/task'
10
- rescue LoadError, RuntimeError
11
- end
12
-
13
- BASE_DIR = File.expand_path(File.dirname(__FILE__))
14
-
15
- task :default => [:test]
16
-
17
- spec = eval(File.read('tzinfo.gemspec'))
18
-
19
- class TZInfoPackageTask < Gem::PackageTask
20
- alias_method :orig_sh, :sh
21
- private :orig_sh
22
-
23
- def sh(*cmd, &block)
24
- if cmd[0] == '__tar_with_owner__' && cmd[1] =~ /\A-?[zjcvf]+\z/
25
- opts = cmd[1]
26
- cmd = ['tar', 'c', '--owner', '0', '--group', '0', "#{opts.start_with?('-') ? '' : '-'}#{opts.gsub('c', '')}"] + cmd.drop(2)
27
- elsif cmd.first =~ /\A__tar_with_owner__ -?([zjcvf]+)(.*)\z/
28
- opts = $1
29
- args = $2
30
- cmd[0] = "tar c --owner 0 --group 0 -#{opts.gsub('c', '')}#{args}"
31
- end
32
-
33
- orig_sh(*cmd, &block)
34
- end
35
- end
36
-
37
- def add_signing_key(spec)
38
- # Attempt to find the private key and add options to sign the gem if found.
39
- private_key_path = File.expand_path(File.join(BASE_DIR, '..', 'key', 'gem-private_key.pem'))
40
-
41
- if File.exist?(private_key_path)
42
- spec = spec.clone
43
- spec.signing_key = private_key_path
44
- spec.cert_chain = [File.join(BASE_DIR, 'gem-public_cert.pem')]
45
- else
46
- puts 'WARNING: Private key not found. Not signing gem file.'
47
- end
48
-
49
- spec
50
- end
51
-
52
- package_task = TZInfoPackageTask.new(add_signing_key(spec)) do |pkg|
53
- pkg.need_zip = true
54
- pkg.need_tar_gz = true
55
- pkg.tar_command = '__tar_with_owner__'
56
- end
57
-
58
- # Skip the rdoc task if RDoc::Task is unavailable
59
- if defined?(RDoc) && defined?(RDoc::Task)
60
- RDoc::Task.new do |rdoc|
61
- rdoc.rdoc_dir = 'doc'
62
- rdoc.options.concat spec.rdoc_options
63
- rdoc.rdoc_files.include(spec.extra_rdoc_files)
64
- rdoc.rdoc_files.include('lib')
65
- end
66
- end
67
-
68
- Rake::Task[package_task.package_dir_path].enhance do
69
- recurse_chmod(package_task.package_dir_path)
70
- end
71
-
72
- Rake::Task[:package].enhance do
73
- FileUtils.rm_rf(package_task.package_dir_path)
74
- end
75
-
76
- def recurse_chmod(dir)
77
- File.chmod(0755, dir)
78
-
79
- Dir.entries(dir).each do |entry|
80
- if entry != '.' && entry != '..'
81
- path = File.join(dir, entry)
82
- if File.directory?(path)
83
- recurse_chmod(path)
84
- else
85
- File.chmod(0644, path)
86
- end
87
- end
88
- end
89
- end
90
-
91
- desc 'Run tests using RubyDataSource, then ZoneinfoDataSource'
92
- task :test => [:test_ruby, :test_zoneinfo] do
93
- end
94
-
95
- def setup_tests(test_task, type)
96
- test_task.libs = [File.join(BASE_DIR, 'lib')]
97
- test_task.pattern = File.join(BASE_DIR, 'test', "ts_all_#{type}.rb")
98
- test_task.warning = true
99
- end
100
-
101
- Rake::TestTask.new(:test_ruby) do |t|
102
- setup_tests(t, :ruby)
103
- end
104
-
105
- Rake::TestTask.new(:test_zoneinfo) do |t|
106
- setup_tests(t, :zoneinfo)
107
- end
@@ -1,51 +0,0 @@
1
- module TZInfo
2
- # A set of rules that define when transitions occur in time zones with
3
- # annually occurring daylight savings time.
4
- #
5
- # @private
6
- class AnnualRules #:nodoc:
7
- # Returned by #transitions. #offset is the TimezoneOffset that applies
8
- # from the UTC TimeOrDateTime #at. #previous_offset is the prior
9
- # TimezoneOffset.
10
- Transition = Struct.new(:offset, :previous_offset, :at)
11
-
12
- # The standard offset that applies when daylight savings time is not in
13
- # force.
14
- attr_reader :std_offset
15
-
16
- # The offset that applies when daylight savings time is in force.
17
- attr_reader :dst_offset
18
-
19
- # The rule that determines when daylight savings time starts.
20
- attr_reader :dst_start_rule
21
-
22
- # The rule that determines when daylight savings time ends.
23
- attr_reader :dst_end_rule
24
-
25
- # Initializes a new {AnnualRules} instance.
26
- def initialize(std_offset, dst_offset, dst_start_rule, dst_end_rule)
27
- @std_offset = std_offset
28
- @dst_offset = dst_offset
29
- @dst_start_rule = dst_start_rule
30
- @dst_end_rule = dst_end_rule
31
- end
32
-
33
- # Returns the transitions between standard and daylight savings time for a
34
- # given year. The results are ordered by time of occurrence (earliest to
35
- # latest).
36
- def transitions(year)
37
- start_dst = apply_rule(@dst_start_rule, @std_offset, @dst_offset, year)
38
- end_dst = apply_rule(@dst_end_rule, @dst_offset, @std_offset, year)
39
-
40
- end_dst.at < start_dst.at ? [end_dst, start_dst] : [start_dst, end_dst]
41
- end
42
-
43
- private
44
-
45
- # Applies a given rule between offsets on a year.
46
- def apply_rule(rule, from_offset, to_offset, year)
47
- at = rule.at(from_offset, year)
48
- Transition.new(to_offset, from_offset, at)
49
- end
50
- end
51
- end
@@ -1,31 +0,0 @@
1
- module TZInfo
2
- # The country index file includes CountryIndexDefinition which provides
3
- # a country method used to define each country in the index.
4
- #
5
- # @private
6
- module CountryIndexDefinition #:nodoc:
7
- def self.append_features(base)
8
- super
9
- base.extend(ClassMethods)
10
- base.instance_eval { @countries = {} }
11
- end
12
-
13
- # Class methods for inclusion.
14
- #
15
- # @private
16
- module ClassMethods #:nodoc:
17
- # Defines a country with an ISO 3166 country code, name and block. The
18
- # block will be evaluated to obtain all the timezones for the country.
19
- # Calls Country.country_defined with the definition of each country.
20
- def country(code, name, &block)
21
- @countries[code] = RubyCountryInfo.new(code, name, &block)
22
- end
23
-
24
- # Returns a frozen hash of all the countries that have been defined in
25
- # the index.
26
- def countries
27
- @countries.freeze
28
- end
29
- end
30
- end
31
- end
@@ -1,42 +0,0 @@
1
- module TZInfo
2
- # Represents a country and references to its timezones as returned by a
3
- # DataSource.
4
- class CountryInfo
5
- # The ISO 3166 country code.
6
- attr_reader :code
7
-
8
- # The name of the country.
9
- attr_reader :name
10
-
11
- # Constructs a new CountryInfo with an ISO 3166 country code and name
12
- def initialize(code, name)
13
- @code = code
14
- @name = name
15
- end
16
-
17
- # Returns internal object state as a programmer-readable string.
18
- def inspect
19
- "#<#{self.class}: #@code>"
20
- end
21
-
22
- # Returns a frozen array of all the zone identifiers for the country.
23
- # The identifiers are ordered by importance according to the DataSource.
24
- def zone_identifiers
25
- raise_not_implemented('zone_identifiers')
26
- end
27
-
28
- # Returns a frozen array of all the timezones for the for the country as
29
- # CountryTimezone instances.
30
- #
31
- # The timezones are ordered by importance according to the DataSource.
32
- def zones
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}"
40
- end
41
- end
42
- end
@@ -1,55 +0,0 @@
1
- module TZInfo
2
- # Represents a defined timezone containing transition data.
3
- class DataTimezoneInfo < TimezoneInfo
4
-
5
- # Returns the TimezonePeriod for the given UTC time.
6
- def period_for_utc(utc)
7
- raise_not_implemented('period_for_utc')
8
- end
9
-
10
- # Returns the set of TimezonePeriods for the given local time as an array.
11
- # Results returned are ordered by increasing UTC start date.
12
- # Returns an empty array if no periods are found for the given time.
13
- def periods_for_local(local)
14
- raise_not_implemented('periods_for_local')
15
- end
16
-
17
- # Returns an Array of TimezoneTransition instances representing the times
18
- # where the UTC offset of the timezone changes.
19
- #
20
- # Transitions are returned up to a given date and time up to a given date
21
- # and time, specified in UTC (utc_to).
22
- #
23
- # A from date and time may also be supplied using the utc_from parameter
24
- # (also specified in UTC). If utc_from is not nil, only transitions from
25
- # that date and time onwards will be returned.
26
- #
27
- # Comparisons with utc_to are exclusive. Comparisons with utc_from are
28
- # inclusive. If a transition falls precisely on utc_to, it will be excluded.
29
- # If a transition falls on utc_from, it will be included.
30
- #
31
- # Transitions returned are ordered by when they occur, from earliest to
32
- # latest.
33
- #
34
- # utc_to and utc_from can be specified using either DateTime, Time or
35
- # integer timestamps (Time.to_i).
36
- #
37
- # If utc_from is specified and utc_to is not greater than utc_from, then
38
- # transitions_up_to raises an ArgumentError exception.
39
- def transitions_up_to(utc_to, utc_from = nil)
40
- raise_not_implemented('transitions_up_to')
41
- end
42
-
43
- # Constructs a Timezone instance for the timezone represented by this
44
- # DataTimezoneInfo.
45
- def create_timezone
46
- DataTimezone.new(self)
47
- end
48
-
49
- private
50
-
51
- def raise_not_implemented(method_name)
52
- raise NotImplementedError, "Subclasses must override #{method_name}"
53
- end
54
- end
55
- end
@@ -1,26 +0,0 @@
1
- module TZInfo
2
- # Represents a timezone that is defined as a link or alias to another zone.
3
- class LinkedTimezoneInfo < TimezoneInfo
4
-
5
- # The zone that provides the data (that this zone is an alias for).
6
- attr_reader :link_to_identifier
7
-
8
- # Constructs a new LinkedTimezoneInfo with an identifier and the identifier
9
- # of the zone linked to.
10
- def initialize(identifier, link_to_identifier)
11
- super(identifier)
12
- @link_to_identifier = link_to_identifier
13
- end
14
-
15
- # Returns internal object state as a programmer-readable string.
16
- def inspect
17
- "#<#{self.class}: #@identifier,#@link_to_identifier>"
18
- end
19
-
20
- # Constructs a Timezone instance for the timezone represented by this
21
- # DataTimezoneInfo.
22
- def create_timezone
23
- LinkedTimezone.new(self)
24
- end
25
- end
26
- end
@@ -1,77 +0,0 @@
1
- require 'rational' unless defined?(Rational)
2
-
3
- module TZInfo
4
-
5
- # Provides a method for getting Rationals for a timezone offset in seconds.
6
- # Pre-reduced rationals are returned for all the half-hour intervals between
7
- # -14 and +14 hours to avoid having to call gcd at runtime.
8
- #
9
- # @private
10
- module OffsetRationals #:nodoc:
11
- @@rational_cache = {
12
- -50400 => RubyCoreSupport.rational_new!(-7,12),
13
- -48600 => RubyCoreSupport.rational_new!(-9,16),
14
- -46800 => RubyCoreSupport.rational_new!(-13,24),
15
- -45000 => RubyCoreSupport.rational_new!(-25,48),
16
- -43200 => RubyCoreSupport.rational_new!(-1,2),
17
- -41400 => RubyCoreSupport.rational_new!(-23,48),
18
- -39600 => RubyCoreSupport.rational_new!(-11,24),
19
- -37800 => RubyCoreSupport.rational_new!(-7,16),
20
- -36000 => RubyCoreSupport.rational_new!(-5,12),
21
- -34200 => RubyCoreSupport.rational_new!(-19,48),
22
- -32400 => RubyCoreSupport.rational_new!(-3,8),
23
- -30600 => RubyCoreSupport.rational_new!(-17,48),
24
- -28800 => RubyCoreSupport.rational_new!(-1,3),
25
- -27000 => RubyCoreSupport.rational_new!(-5,16),
26
- -25200 => RubyCoreSupport.rational_new!(-7,24),
27
- -23400 => RubyCoreSupport.rational_new!(-13,48),
28
- -21600 => RubyCoreSupport.rational_new!(-1,4),
29
- -19800 => RubyCoreSupport.rational_new!(-11,48),
30
- -18000 => RubyCoreSupport.rational_new!(-5,24),
31
- -16200 => RubyCoreSupport.rational_new!(-3,16),
32
- -14400 => RubyCoreSupport.rational_new!(-1,6),
33
- -12600 => RubyCoreSupport.rational_new!(-7,48),
34
- -10800 => RubyCoreSupport.rational_new!(-1,8),
35
- -9000 => RubyCoreSupport.rational_new!(-5,48),
36
- -7200 => RubyCoreSupport.rational_new!(-1,12),
37
- -5400 => RubyCoreSupport.rational_new!(-1,16),
38
- -3600 => RubyCoreSupport.rational_new!(-1,24),
39
- -1800 => RubyCoreSupport.rational_new!(-1,48),
40
- 0 => RubyCoreSupport.rational_new!(0,1),
41
- 1800 => RubyCoreSupport.rational_new!(1,48),
42
- 3600 => RubyCoreSupport.rational_new!(1,24),
43
- 5400 => RubyCoreSupport.rational_new!(1,16),
44
- 7200 => RubyCoreSupport.rational_new!(1,12),
45
- 9000 => RubyCoreSupport.rational_new!(5,48),
46
- 10800 => RubyCoreSupport.rational_new!(1,8),
47
- 12600 => RubyCoreSupport.rational_new!(7,48),
48
- 14400 => RubyCoreSupport.rational_new!(1,6),
49
- 16200 => RubyCoreSupport.rational_new!(3,16),
50
- 18000 => RubyCoreSupport.rational_new!(5,24),
51
- 19800 => RubyCoreSupport.rational_new!(11,48),
52
- 21600 => RubyCoreSupport.rational_new!(1,4),
53
- 23400 => RubyCoreSupport.rational_new!(13,48),
54
- 25200 => RubyCoreSupport.rational_new!(7,24),
55
- 27000 => RubyCoreSupport.rational_new!(5,16),
56
- 28800 => RubyCoreSupport.rational_new!(1,3),
57
- 30600 => RubyCoreSupport.rational_new!(17,48),
58
- 32400 => RubyCoreSupport.rational_new!(3,8),
59
- 34200 => RubyCoreSupport.rational_new!(19,48),
60
- 36000 => RubyCoreSupport.rational_new!(5,12),
61
- 37800 => RubyCoreSupport.rational_new!(7,16),
62
- 39600 => RubyCoreSupport.rational_new!(11,24),
63
- 41400 => RubyCoreSupport.rational_new!(23,48),
64
- 43200 => RubyCoreSupport.rational_new!(1,2),
65
- 45000 => RubyCoreSupport.rational_new!(25,48),
66
- 46800 => RubyCoreSupport.rational_new!(13,24),
67
- 48600 => RubyCoreSupport.rational_new!(9,16),
68
- 50400 => RubyCoreSupport.rational_new!(7,12)}.freeze
69
-
70
- # Returns a Rational expressing the fraction of a day that offset in
71
- # seconds represents (i.e. equivalent to Rational(offset, 86400)).
72
- def rational_for_offset(offset)
73
- @@rational_cache[offset] || Rational(offset, 86400)
74
- end
75
- module_function :rational_for_offset
76
- end
77
- end