tzinfo 0.3.61 → 1.0.0

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 (704) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES +25 -150
  3. data/LICENSE +1 -1
  4. data/README +89 -55
  5. data/Rakefile +87 -282
  6. data/lib/tzinfo/country.rb +28 -34
  7. data/lib/tzinfo/country_index_definition.rb +2 -7
  8. data/lib/tzinfo/country_info.rb +20 -44
  9. data/lib/tzinfo/country_timezone.rb +1 -1
  10. data/lib/tzinfo/data_source.rb +182 -0
  11. data/lib/tzinfo/data_timezone.rb +1 -3
  12. data/lib/tzinfo/data_timezone_info.rb +11 -190
  13. data/lib/tzinfo/info_timezone.rb +1 -3
  14. data/lib/tzinfo/linked_timezone.rb +1 -4
  15. data/lib/tzinfo/linked_timezone_info.rb +9 -5
  16. data/lib/tzinfo/offset_rationals.rb +2 -4
  17. data/lib/tzinfo/ruby_core_support.rb +152 -82
  18. data/lib/tzinfo/ruby_country_info.rb +78 -0
  19. data/lib/tzinfo/ruby_data_source.rb +153 -0
  20. data/lib/tzinfo/time_or_datetime.rb +83 -52
  21. data/lib/tzinfo/timezone.rb +27 -69
  22. data/lib/tzinfo/timezone_definition.rb +4 -7
  23. data/lib/tzinfo/timezone_index_definition.rb +1 -6
  24. data/lib/tzinfo/timezone_info.rb +8 -4
  25. data/lib/tzinfo/timezone_offset_info.rb +1 -3
  26. data/lib/tzinfo/timezone_period.rb +31 -6
  27. data/lib/tzinfo/timezone_transition_info.rb +42 -12
  28. data/lib/tzinfo/transition_data_timezone_info.rb +223 -0
  29. data/lib/tzinfo/zoneinfo_country_info.rb +50 -0
  30. data/lib/tzinfo/zoneinfo_data_source.rb +297 -0
  31. data/lib/tzinfo/zoneinfo_timezone_info.rb +226 -0
  32. data/lib/tzinfo.rb +9 -7
  33. data/test/tc_country.rb +65 -9
  34. data/test/tc_country_index_definition.rb +27 -6
  35. data/test/tc_country_info.rb +23 -57
  36. data/test/tc_country_timezone.rb +23 -3
  37. data/test/tc_data_source.rb +194 -0
  38. data/test/tc_data_timezone.rb +23 -3
  39. data/test/tc_data_timezone_info.rb +30 -272
  40. data/test/tc_info_timezone.rb +23 -3
  41. data/test/tc_linked_timezone.rb +23 -4
  42. data/test/tc_linked_timezone_info.rb +30 -3
  43. data/test/tc_offset_rationals.rb +23 -3
  44. data/test/tc_ruby_core_support.rb +117 -31
  45. data/test/tc_ruby_country_info.rb +102 -0
  46. data/test/tc_ruby_data_source.rb +145 -0
  47. data/test/tc_time_or_datetime.rb +222 -19
  48. data/test/tc_timezone.rb +187 -57
  49. data/test/tc_timezone_definition.rb +26 -6
  50. data/test/tc_timezone_index_definition.rb +23 -3
  51. data/test/tc_timezone_info.rb +23 -3
  52. data/test/tc_timezone_london.rb +89 -56
  53. data/test/tc_timezone_melbourne.rb +88 -62
  54. data/test/tc_timezone_new_york.rb +73 -47
  55. data/test/tc_timezone_offset_info.rb +36 -4
  56. data/test/tc_timezone_period.rb +60 -22
  57. data/test/tc_timezone_proxy.rb +24 -4
  58. data/test/tc_timezone_transition_info.rb +305 -28
  59. data/test/tc_timezone_utc.rb +24 -4
  60. data/test/tc_transition_data_timezone_info.rb +345 -0
  61. data/test/tc_zoneinfo_country_info.rb +86 -0
  62. data/test/tc_zoneinfo_data_source.rb +601 -0
  63. data/test/tc_zoneinfo_timezone_info.rb +663 -0
  64. data/test/test_utils.rb +116 -21
  65. data/test/ts_all.rb +24 -4
  66. data/test/ts_all_ruby.rb +27 -0
  67. data/test/ts_all_zoneinfo.rb +29 -0
  68. data/test/tzinfo-data/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb +89 -0
  69. data/test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb +313 -0
  70. data/test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb +216 -0
  71. data/test/tzinfo-data/tzinfo/data/definitions/EST.rb +19 -0
  72. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__m__1.rb +21 -0
  73. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__p__1.rb +21 -0
  74. data/test/tzinfo-data/tzinfo/data/definitions/Etc/UTC.rb +21 -0
  75. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb +259 -0
  76. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb +184 -0
  77. data/test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb +319 -0
  78. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb +263 -0
  79. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb +218 -0
  80. data/test/tzinfo-data/tzinfo/data/definitions/UTC.rb +16 -0
  81. data/test/tzinfo-data/tzinfo/data/indexes/countries.rb +929 -0
  82. data/test/tzinfo-data/tzinfo/data/indexes/timezones.rb +599 -0
  83. data/test/tzinfo-data/tzinfo/data/version.rb +36 -0
  84. data/test/tzinfo-data/tzinfo/data.rb +23 -0
  85. data/test/zoneinfo/America/Argentina/Buenos_Aires +0 -0
  86. data/test/zoneinfo/America/New_York +0 -0
  87. data/test/zoneinfo/Australia/Melbourne +0 -0
  88. data/test/zoneinfo/EST +0 -0
  89. data/test/zoneinfo/Etc/UTC +0 -0
  90. data/test/zoneinfo/Europe/Amsterdam +0 -0
  91. data/test/zoneinfo/Europe/Andorra +0 -0
  92. data/test/zoneinfo/Europe/London +0 -0
  93. data/test/zoneinfo/Europe/Paris +0 -0
  94. data/test/zoneinfo/Europe/Prague +0 -0
  95. data/test/zoneinfo/Factory +0 -0
  96. data/test/zoneinfo/UTC +0 -0
  97. data/test/zoneinfo/iso3166.tab +276 -0
  98. data/test/zoneinfo/localtime +0 -0
  99. data/test/zoneinfo/posix/Europe/London +0 -0
  100. data/test/zoneinfo/posixrules +0 -0
  101. data/test/zoneinfo/right/Europe/London +0 -0
  102. data/test/zoneinfo/zone.tab +444 -0
  103. metadata +134 -714
  104. data/.yardopts +0 -8
  105. data/lib/tzinfo/definitions/Africa/Abidjan.rb +0 -18
  106. data/lib/tzinfo/definitions/Africa/Accra.rb +0 -13
  107. data/lib/tzinfo/definitions/Africa/Addis_Ababa.rb +0 -13
  108. data/lib/tzinfo/definitions/Africa/Algiers.rb +0 -55
  109. data/lib/tzinfo/definitions/Africa/Asmara.rb +0 -13
  110. data/lib/tzinfo/definitions/Africa/Asmera.rb +0 -13
  111. data/lib/tzinfo/definitions/Africa/Bamako.rb +0 -13
  112. data/lib/tzinfo/definitions/Africa/Bangui.rb +0 -13
  113. data/lib/tzinfo/definitions/Africa/Banjul.rb +0 -13
  114. data/lib/tzinfo/definitions/Africa/Bissau.rb +0 -20
  115. data/lib/tzinfo/definitions/Africa/Blantyre.rb +0 -13
  116. data/lib/tzinfo/definitions/Africa/Brazzaville.rb +0 -13
  117. data/lib/tzinfo/definitions/Africa/Bujumbura.rb +0 -13
  118. data/lib/tzinfo/definitions/Africa/Cairo.rb +0 -145
  119. data/lib/tzinfo/definitions/Africa/Casablanca.rb +0 -141
  120. data/lib/tzinfo/definitions/Africa/Ceuta.rb +0 -172
  121. data/lib/tzinfo/definitions/Africa/Conakry.rb +0 -13
  122. data/lib/tzinfo/definitions/Africa/Dakar.rb +0 -13
  123. data/lib/tzinfo/definitions/Africa/Dar_es_Salaam.rb +0 -13
  124. data/lib/tzinfo/definitions/Africa/Djibouti.rb +0 -13
  125. data/lib/tzinfo/definitions/Africa/Douala.rb +0 -13
  126. data/lib/tzinfo/definitions/Africa/El_Aaiun.rb +0 -131
  127. data/lib/tzinfo/definitions/Africa/Freetown.rb +0 -13
  128. data/lib/tzinfo/definitions/Africa/Gaborone.rb +0 -13
  129. data/lib/tzinfo/definitions/Africa/Harare.rb +0 -13
  130. data/lib/tzinfo/definitions/Africa/Johannesburg.rb +0 -25
  131. data/lib/tzinfo/definitions/Africa/Juba.rb +0 -54
  132. data/lib/tzinfo/definitions/Africa/Kampala.rb +0 -13
  133. data/lib/tzinfo/definitions/Africa/Khartoum.rb +0 -54
  134. data/lib/tzinfo/definitions/Africa/Kigali.rb +0 -13
  135. data/lib/tzinfo/definitions/Africa/Kinshasa.rb +0 -13
  136. data/lib/tzinfo/definitions/Africa/Lagos.rb +0 -23
  137. data/lib/tzinfo/definitions/Africa/Libreville.rb +0 -13
  138. data/lib/tzinfo/definitions/Africa/Lome.rb +0 -13
  139. data/lib/tzinfo/definitions/Africa/Luanda.rb +0 -13
  140. data/lib/tzinfo/definitions/Africa/Lubumbashi.rb +0 -13
  141. data/lib/tzinfo/definitions/Africa/Lusaka.rb +0 -13
  142. data/lib/tzinfo/definitions/Africa/Malabo.rb +0 -13
  143. data/lib/tzinfo/definitions/Africa/Maputo.rb +0 -18
  144. data/lib/tzinfo/definitions/Africa/Maseru.rb +0 -13
  145. data/lib/tzinfo/definitions/Africa/Mbabane.rb +0 -13
  146. data/lib/tzinfo/definitions/Africa/Mogadishu.rb +0 -13
  147. data/lib/tzinfo/definitions/Africa/Monrovia.rb +0 -22
  148. data/lib/tzinfo/definitions/Africa/Nairobi.rb +0 -24
  149. data/lib/tzinfo/definitions/Africa/Ndjamena.rb +0 -21
  150. data/lib/tzinfo/definitions/Africa/Niamey.rb +0 -13
  151. data/lib/tzinfo/definitions/Africa/Nouakchott.rb +0 -13
  152. data/lib/tzinfo/definitions/Africa/Ouagadougou.rb +0 -13
  153. data/lib/tzinfo/definitions/Africa/Porto__m__Novo.rb +0 -13
  154. data/lib/tzinfo/definitions/Africa/Sao_Tome.rb +0 -23
  155. data/lib/tzinfo/definitions/Africa/Timbuktu.rb +0 -13
  156. data/lib/tzinfo/definitions/Africa/Tripoli.rb +0 -51
  157. data/lib/tzinfo/definitions/Africa/Tunis.rb +0 -53
  158. data/lib/tzinfo/definitions/Africa/Windhoek.rb +0 -74
  159. data/lib/tzinfo/definitions/America/Adak.rb +0 -196
  160. data/lib/tzinfo/definitions/America/Anchorage.rb +0 -196
  161. data/lib/tzinfo/definitions/America/Anguilla.rb +0 -13
  162. data/lib/tzinfo/definitions/America/Antigua.rb +0 -13
  163. data/lib/tzinfo/definitions/America/Araguaina.rb +0 -69
  164. data/lib/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +0 -84
  165. data/lib/tzinfo/definitions/America/Argentina/Catamarca.rb +0 -84
  166. data/lib/tzinfo/definitions/America/Argentina/ComodRivadavia.rb +0 -15
  167. data/lib/tzinfo/definitions/America/Argentina/Cordoba.rb +0 -84
  168. data/lib/tzinfo/definitions/America/Argentina/Jujuy.rb +0 -82
  169. data/lib/tzinfo/definitions/America/Argentina/La_Rioja.rb +0 -85
  170. data/lib/tzinfo/definitions/America/Argentina/Mendoza.rb +0 -84
  171. data/lib/tzinfo/definitions/America/Argentina/Rio_Gallegos.rb +0 -84
  172. data/lib/tzinfo/definitions/America/Argentina/Salta.rb +0 -82
  173. data/lib/tzinfo/definitions/America/Argentina/San_Juan.rb +0 -85
  174. data/lib/tzinfo/definitions/America/Argentina/San_Luis.rb +0 -85
  175. data/lib/tzinfo/definitions/America/Argentina/Tucuman.rb +0 -86
  176. data/lib/tzinfo/definitions/America/Argentina/Ushuaia.rb +0 -84
  177. data/lib/tzinfo/definitions/America/Aruba.rb +0 -13
  178. data/lib/tzinfo/definitions/America/Asuncion.rb +0 -174
  179. data/lib/tzinfo/definitions/America/Atikokan.rb +0 -13
  180. data/lib/tzinfo/definitions/America/Atka.rb +0 -13
  181. data/lib/tzinfo/definitions/America/Bahia.rb +0 -79
  182. data/lib/tzinfo/definitions/America/Bahia_Banderas.rb +0 -140
  183. data/lib/tzinfo/definitions/America/Barbados.rb +0 -34
  184. data/lib/tzinfo/definitions/America/Belem.rb +0 -47
  185. data/lib/tzinfo/definitions/America/Belize.rb +0 -119
  186. data/lib/tzinfo/definitions/America/Blanc__m__Sablon.rb +0 -13
  187. data/lib/tzinfo/definitions/America/Boa_Vista.rb +0 -51
  188. data/lib/tzinfo/definitions/America/Bogota.rb +0 -23
  189. data/lib/tzinfo/definitions/America/Boise.rb +0 -199
  190. data/lib/tzinfo/definitions/America/Buenos_Aires.rb +0 -13
  191. data/lib/tzinfo/definitions/America/Cambridge_Bay.rb +0 -173
  192. data/lib/tzinfo/definitions/America/Campo_Grande.rb +0 -109
  193. data/lib/tzinfo/definitions/America/Cancun.rb +0 -62
  194. data/lib/tzinfo/definitions/America/Caracas.rb +0 -24
  195. data/lib/tzinfo/definitions/America/Catamarca.rb +0 -13
  196. data/lib/tzinfo/definitions/America/Cayenne.rb +0 -20
  197. data/lib/tzinfo/definitions/America/Cayman.rb +0 -13
  198. data/lib/tzinfo/definitions/America/Chicago.rb +0 -283
  199. data/lib/tzinfo/definitions/America/Chihuahua.rb +0 -136
  200. data/lib/tzinfo/definitions/America/Coral_Harbour.rb +0 -13
  201. data/lib/tzinfo/definitions/America/Cordoba.rb +0 -13
  202. data/lib/tzinfo/definitions/America/Costa_Rica.rb +0 -29
  203. data/lib/tzinfo/definitions/America/Creston.rb +0 -13
  204. data/lib/tzinfo/definitions/America/Cuiaba.rb +0 -107
  205. data/lib/tzinfo/definitions/America/Curacao.rb +0 -13
  206. data/lib/tzinfo/definitions/America/Danmarkshavn.rb +0 -53
  207. data/lib/tzinfo/definitions/America/Dawson.rb +0 -117
  208. data/lib/tzinfo/definitions/America/Dawson_Creek.rb +0 -79
  209. data/lib/tzinfo/definitions/America/Denver.rb +0 -204
  210. data/lib/tzinfo/definitions/America/Detroit.rb +0 -188
  211. data/lib/tzinfo/definitions/America/Dominica.rb +0 -13
  212. data/lib/tzinfo/definitions/America/Edmonton.rb +0 -196
  213. data/lib/tzinfo/definitions/America/Eirunepe.rb +0 -52
  214. data/lib/tzinfo/definitions/America/El_Salvador.rb +0 -23
  215. data/lib/tzinfo/definitions/America/Ensenada.rb +0 -13
  216. data/lib/tzinfo/definitions/America/Fort_Nelson.rb +0 -164
  217. data/lib/tzinfo/definitions/America/Fort_Wayne.rb +0 -13
  218. data/lib/tzinfo/definitions/America/Fortaleza.rb +0 -57
  219. data/lib/tzinfo/definitions/America/Glace_Bay.rb +0 -186
  220. data/lib/tzinfo/definitions/America/Godthab.rb +0 -13
  221. data/lib/tzinfo/definitions/America/Goose_Bay.rb +0 -255
  222. data/lib/tzinfo/definitions/America/Grand_Turk.rb +0 -161
  223. data/lib/tzinfo/definitions/America/Grenada.rb +0 -13
  224. data/lib/tzinfo/definitions/America/Guadeloupe.rb +0 -13
  225. data/lib/tzinfo/definitions/America/Guatemala.rb +0 -27
  226. data/lib/tzinfo/definitions/America/Guayaquil.rb +0 -23
  227. data/lib/tzinfo/definitions/America/Guyana.rb +0 -23
  228. data/lib/tzinfo/definitions/America/Halifax.rb +0 -274
  229. data/lib/tzinfo/definitions/America/Havana.rb +0 -201
  230. data/lib/tzinfo/definitions/America/Hermosillo.rb +0 -35
  231. data/lib/tzinfo/definitions/America/Indiana/Indianapolis.rb +0 -149
  232. data/lib/tzinfo/definitions/America/Indiana/Knox.rb +0 -203
  233. data/lib/tzinfo/definitions/America/Indiana/Marengo.rb +0 -153
  234. data/lib/tzinfo/definitions/America/Indiana/Petersburg.rb +0 -166
  235. data/lib/tzinfo/definitions/America/Indiana/Tell_City.rb +0 -148
  236. data/lib/tzinfo/definitions/America/Indiana/Vevay.rb +0 -131
  237. data/lib/tzinfo/definitions/America/Indiana/Vincennes.rb +0 -151
  238. data/lib/tzinfo/definitions/America/Indiana/Winamac.rb +0 -157
  239. data/lib/tzinfo/definitions/America/Indianapolis.rb +0 -13
  240. data/lib/tzinfo/definitions/America/Inuvik.rb +0 -166
  241. data/lib/tzinfo/definitions/America/Iqaluit.rb +0 -170
  242. data/lib/tzinfo/definitions/America/Jamaica.rb +0 -41
  243. data/lib/tzinfo/definitions/America/Jujuy.rb +0 -13
  244. data/lib/tzinfo/definitions/America/Juneau.rb +0 -195
  245. data/lib/tzinfo/definitions/America/Kentucky/Louisville.rb +0 -228
  246. data/lib/tzinfo/definitions/America/Kentucky/Monticello.rb +0 -198
  247. data/lib/tzinfo/definitions/America/Knox_IN.rb +0 -13
  248. data/lib/tzinfo/definitions/America/Kralendijk.rb +0 -13
  249. data/lib/tzinfo/definitions/America/La_Paz.rb +0 -22
  250. data/lib/tzinfo/definitions/America/Lima.rb +0 -35
  251. data/lib/tzinfo/definitions/America/Los_Angeles.rb +0 -232
  252. data/lib/tzinfo/definitions/America/Louisville.rb +0 -13
  253. data/lib/tzinfo/definitions/America/Lower_Princes.rb +0 -13
  254. data/lib/tzinfo/definitions/America/Maceio.rb +0 -59
  255. data/lib/tzinfo/definitions/America/Managua.rb +0 -36
  256. data/lib/tzinfo/definitions/America/Manaus.rb +0 -49
  257. data/lib/tzinfo/definitions/America/Marigot.rb +0 -13
  258. data/lib/tzinfo/definitions/America/Martinique.rb +0 -23
  259. data/lib/tzinfo/definitions/America/Matamoros.rb +0 -131
  260. data/lib/tzinfo/definitions/America/Mazatlan.rb +0 -139
  261. data/lib/tzinfo/definitions/America/Mendoza.rb +0 -13
  262. data/lib/tzinfo/definitions/America/Menominee.rb +0 -190
  263. data/lib/tzinfo/definitions/America/Merida.rb +0 -132
  264. data/lib/tzinfo/definitions/America/Metlakatla.rb +0 -130
  265. data/lib/tzinfo/definitions/America/Mexico_City.rb +0 -144
  266. data/lib/tzinfo/definitions/America/Miquelon.rb +0 -149
  267. data/lib/tzinfo/definitions/America/Moncton.rb +0 -254
  268. data/lib/tzinfo/definitions/America/Monterrey.rb +0 -131
  269. data/lib/tzinfo/definitions/America/Montevideo.rb +0 -110
  270. data/lib/tzinfo/definitions/America/Montreal.rb +0 -13
  271. data/lib/tzinfo/definitions/America/Montserrat.rb +0 -13
  272. data/lib/tzinfo/definitions/America/Nassau.rb +0 -13
  273. data/lib/tzinfo/definitions/America/New_York.rb +0 -282
  274. data/lib/tzinfo/definitions/America/Nipigon.rb +0 -181
  275. data/lib/tzinfo/definitions/America/Nome.rb +0 -196
  276. data/lib/tzinfo/definitions/America/Noronha.rb +0 -57
  277. data/lib/tzinfo/definitions/America/North_Dakota/Beulah.rb +0 -200
  278. data/lib/tzinfo/definitions/America/North_Dakota/Center.rb +0 -200
  279. data/lib/tzinfo/definitions/America/North_Dakota/New_Salem.rb +0 -200
  280. data/lib/tzinfo/definitions/America/Nuuk.rb +0 -161
  281. data/lib/tzinfo/definitions/America/Ojinaga.rb +0 -136
  282. data/lib/tzinfo/definitions/America/Panama.rb +0 -20
  283. data/lib/tzinfo/definitions/America/Pangnirtung.rb +0 -173
  284. data/lib/tzinfo/definitions/America/Paramaribo.rb +0 -24
  285. data/lib/tzinfo/definitions/America/Phoenix.rb +0 -30
  286. data/lib/tzinfo/definitions/America/Port__m__au__m__Prince.rb +0 -131
  287. data/lib/tzinfo/definitions/America/Port_of_Spain.rb +0 -13
  288. data/lib/tzinfo/definitions/America/Porto_Acre.rb +0 -13
  289. data/lib/tzinfo/definitions/America/Porto_Velho.rb +0 -47
  290. data/lib/tzinfo/definitions/America/Puerto_Rico.rb +0 -23
  291. data/lib/tzinfo/definitions/America/Punta_Arenas.rb +0 -138
  292. data/lib/tzinfo/definitions/America/Rainy_River.rb +0 -181
  293. data/lib/tzinfo/definitions/America/Rankin_Inlet.rb +0 -165
  294. data/lib/tzinfo/definitions/America/Recife.rb +0 -57
  295. data/lib/tzinfo/definitions/America/Regina.rb +0 -74
  296. data/lib/tzinfo/definitions/America/Resolute.rb +0 -165
  297. data/lib/tzinfo/definitions/America/Rio_Branco.rb +0 -50
  298. data/lib/tzinfo/definitions/America/Rosario.rb +0 -13
  299. data/lib/tzinfo/definitions/America/Santa_Isabel.rb +0 -13
  300. data/lib/tzinfo/definitions/America/Santarem.rb +0 -49
  301. data/lib/tzinfo/definitions/America/Santiago.rb +0 -205
  302. data/lib/tzinfo/definitions/America/Santo_Domingo.rb +0 -38
  303. data/lib/tzinfo/definitions/America/Sao_Paulo.rb +0 -109
  304. data/lib/tzinfo/definitions/America/Scoresbysund.rb +0 -163
  305. data/lib/tzinfo/definitions/America/Shiprock.rb +0 -13
  306. data/lib/tzinfo/definitions/America/Sitka.rb +0 -194
  307. data/lib/tzinfo/definitions/America/St_Barthelemy.rb +0 -13
  308. data/lib/tzinfo/definitions/America/St_Johns.rb +0 -288
  309. data/lib/tzinfo/definitions/America/St_Kitts.rb +0 -13
  310. data/lib/tzinfo/definitions/America/St_Lucia.rb +0 -13
  311. data/lib/tzinfo/definitions/America/St_Thomas.rb +0 -13
  312. data/lib/tzinfo/definitions/America/St_Vincent.rb +0 -13
  313. data/lib/tzinfo/definitions/America/Swift_Current.rb +0 -44
  314. data/lib/tzinfo/definitions/America/Tegucigalpa.rb +0 -25
  315. data/lib/tzinfo/definitions/America/Thule.rb +0 -139
  316. data/lib/tzinfo/definitions/America/Thunder_Bay.rb +0 -186
  317. data/lib/tzinfo/definitions/America/Tijuana.rb +0 -196
  318. data/lib/tzinfo/definitions/America/Toronto.rb +0 -279
  319. data/lib/tzinfo/definitions/America/Tortola.rb +0 -13
  320. data/lib/tzinfo/definitions/America/Vancouver.rb +0 -236
  321. data/lib/tzinfo/definitions/America/Virgin.rb +0 -13
  322. data/lib/tzinfo/definitions/America/Whitehorse.rb +0 -117
  323. data/lib/tzinfo/definitions/America/Winnipeg.rb +0 -232
  324. data/lib/tzinfo/definitions/America/Yakutat.rb +0 -193
  325. data/lib/tzinfo/definitions/America/Yellowknife.rb +0 -169
  326. data/lib/tzinfo/definitions/Antarctica/Casey.rb +0 -30
  327. data/lib/tzinfo/definitions/Antarctica/Davis.rb +0 -25
  328. data/lib/tzinfo/definitions/Antarctica/DumontDUrville.rb +0 -13
  329. data/lib/tzinfo/definitions/Antarctica/Macquarie.rb +0 -187
  330. data/lib/tzinfo/definitions/Antarctica/Mawson.rb +0 -20
  331. data/lib/tzinfo/definitions/Antarctica/McMurdo.rb +0 -13
  332. data/lib/tzinfo/definitions/Antarctica/Palmer.rb +0 -102
  333. data/lib/tzinfo/definitions/Antarctica/Rothera.rb +0 -18
  334. data/lib/tzinfo/definitions/Antarctica/South_Pole.rb +0 -13
  335. data/lib/tzinfo/definitions/Antarctica/Syowa.rb +0 -13
  336. data/lib/tzinfo/definitions/Antarctica/Troll.rb +0 -111
  337. data/lib/tzinfo/definitions/Antarctica/Vostok.rb +0 -18
  338. data/lib/tzinfo/definitions/Arctic/Longyearbyen.rb +0 -13
  339. data/lib/tzinfo/definitions/Asia/Aden.rb +0 -13
  340. data/lib/tzinfo/definitions/Asia/Almaty.rb +0 -71
  341. data/lib/tzinfo/definitions/Asia/Amman.rb +0 -161
  342. data/lib/tzinfo/definitions/Asia/Anadyr.rb +0 -86
  343. data/lib/tzinfo/definitions/Asia/Aqtau.rb +0 -71
  344. data/lib/tzinfo/definitions/Asia/Aqtobe.rb +0 -72
  345. data/lib/tzinfo/definitions/Asia/Ashgabat.rb +0 -45
  346. data/lib/tzinfo/definitions/Asia/Ashkhabad.rb +0 -13
  347. data/lib/tzinfo/definitions/Asia/Atyrau.rb +0 -72
  348. data/lib/tzinfo/definitions/Asia/Baghdad.rb +0 -73
  349. data/lib/tzinfo/definitions/Asia/Bahrain.rb +0 -13
  350. data/lib/tzinfo/definitions/Asia/Baku.rb +0 -86
  351. data/lib/tzinfo/definitions/Asia/Bangkok.rb +0 -20
  352. data/lib/tzinfo/definitions/Asia/Barnaul.rb +0 -87
  353. data/lib/tzinfo/definitions/Asia/Beirut.rb +0 -185
  354. data/lib/tzinfo/definitions/Asia/Bishkek.rb +0 -72
  355. data/lib/tzinfo/definitions/Asia/Brunei.rb +0 -20
  356. data/lib/tzinfo/definitions/Asia/Calcutta.rb +0 -13
  357. data/lib/tzinfo/definitions/Asia/Chita.rb +0 -87
  358. data/lib/tzinfo/definitions/Asia/Choibalsan.rb +0 -72
  359. data/lib/tzinfo/definitions/Asia/Chongqing.rb +0 -13
  360. data/lib/tzinfo/definitions/Asia/Chungking.rb +0 -13
  361. data/lib/tzinfo/definitions/Asia/Colombo.rb +0 -30
  362. data/lib/tzinfo/definitions/Asia/Dacca.rb +0 -13
  363. data/lib/tzinfo/definitions/Asia/Damascus.rb +0 -195
  364. data/lib/tzinfo/definitions/Asia/Dhaka.rb +0 -28
  365. data/lib/tzinfo/definitions/Asia/Dili.rb +0 -22
  366. data/lib/tzinfo/definitions/Asia/Dubai.rb +0 -18
  367. data/lib/tzinfo/definitions/Asia/Dushanbe.rb +0 -44
  368. data/lib/tzinfo/definitions/Asia/Famagusta.rb +0 -171
  369. data/lib/tzinfo/definitions/Asia/Gaza.rb +0 -196
  370. data/lib/tzinfo/definitions/Asia/Harbin.rb +0 -13
  371. data/lib/tzinfo/definitions/Asia/Hebron.rb +0 -198
  372. data/lib/tzinfo/definitions/Asia/Ho_Chi_Minh.rb +0 -29
  373. data/lib/tzinfo/definitions/Asia/Hong_Kong.rb +0 -89
  374. data/lib/tzinfo/definitions/Asia/Hovd.rb +0 -69
  375. data/lib/tzinfo/definitions/Asia/Irkutsk.rb +0 -88
  376. data/lib/tzinfo/definitions/Asia/Istanbul.rb +0 -13
  377. data/lib/tzinfo/definitions/Asia/Jakarta.rb +0 -30
  378. data/lib/tzinfo/definitions/Asia/Jayapura.rb +0 -22
  379. data/lib/tzinfo/definitions/Asia/Jerusalem.rb +0 -195
  380. data/lib/tzinfo/definitions/Asia/Kabul.rb +0 -20
  381. data/lib/tzinfo/definitions/Asia/Kamchatka.rb +0 -84
  382. data/lib/tzinfo/definitions/Asia/Karachi.rb +0 -32
  383. data/lib/tzinfo/definitions/Asia/Kashgar.rb +0 -13
  384. data/lib/tzinfo/definitions/Asia/Kathmandu.rb +0 -20
  385. data/lib/tzinfo/definitions/Asia/Katmandu.rb +0 -13
  386. data/lib/tzinfo/definitions/Asia/Khandyga.rb +0 -90
  387. data/lib/tzinfo/definitions/Asia/Kolkata.rb +0 -27
  388. data/lib/tzinfo/definitions/Asia/Krasnoyarsk.rb +0 -86
  389. data/lib/tzinfo/definitions/Asia/Kuala_Lumpur.rb +0 -31
  390. data/lib/tzinfo/definitions/Asia/Kuching.rb +0 -38
  391. data/lib/tzinfo/definitions/Asia/Kuwait.rb +0 -13
  392. data/lib/tzinfo/definitions/Asia/Macao.rb +0 -13
  393. data/lib/tzinfo/definitions/Asia/Macau.rb +0 -91
  394. data/lib/tzinfo/definitions/Asia/Magadan.rb +0 -87
  395. data/lib/tzinfo/definitions/Asia/Makassar.rb +0 -24
  396. data/lib/tzinfo/definitions/Asia/Manila.rb +0 -30
  397. data/lib/tzinfo/definitions/Asia/Muscat.rb +0 -13
  398. data/lib/tzinfo/definitions/Asia/Nicosia.rb +0 -171
  399. data/lib/tzinfo/definitions/Asia/Novokuznetsk.rb +0 -84
  400. data/lib/tzinfo/definitions/Asia/Novosibirsk.rb +0 -87
  401. data/lib/tzinfo/definitions/Asia/Omsk.rb +0 -86
  402. data/lib/tzinfo/definitions/Asia/Oral.rb +0 -73
  403. data/lib/tzinfo/definitions/Asia/Phnom_Penh.rb +0 -13
  404. data/lib/tzinfo/definitions/Asia/Pontianak.rb +0 -30
  405. data/lib/tzinfo/definitions/Asia/Pyongyang.rb +0 -24
  406. data/lib/tzinfo/definitions/Asia/Qatar.rb +0 -20
  407. data/lib/tzinfo/definitions/Asia/Qostanay.rb +0 -72
  408. data/lib/tzinfo/definitions/Asia/Qyzylorda.rb +0 -73
  409. data/lib/tzinfo/definitions/Asia/Rangoon.rb +0 -13
  410. data/lib/tzinfo/definitions/Asia/Riyadh.rb +0 -18
  411. data/lib/tzinfo/definitions/Asia/Saigon.rb +0 -13
  412. data/lib/tzinfo/definitions/Asia/Sakhalin.rb +0 -87
  413. data/lib/tzinfo/definitions/Asia/Samarkand.rb +0 -44
  414. data/lib/tzinfo/definitions/Asia/Seoul.rb +0 -50
  415. data/lib/tzinfo/definitions/Asia/Shanghai.rb +0 -47
  416. data/lib/tzinfo/definitions/Asia/Singapore.rb +0 -31
  417. data/lib/tzinfo/definitions/Asia/Srednekolymsk.rb +0 -86
  418. data/lib/tzinfo/definitions/Asia/Taipei.rb +0 -60
  419. data/lib/tzinfo/definitions/Asia/Tashkent.rb +0 -44
  420. data/lib/tzinfo/definitions/Asia/Tbilisi.rb +0 -73
  421. data/lib/tzinfo/definitions/Asia/Tehran.rb +0 -147
  422. data/lib/tzinfo/definitions/Asia/Tel_Aviv.rb +0 -13
  423. data/lib/tzinfo/definitions/Asia/Thimbu.rb +0 -13
  424. data/lib/tzinfo/definitions/Asia/Thimphu.rb +0 -20
  425. data/lib/tzinfo/definitions/Asia/Tokyo.rb +0 -27
  426. data/lib/tzinfo/definitions/Asia/Tomsk.rb +0 -87
  427. data/lib/tzinfo/definitions/Asia/Ujung_Pandang.rb +0 -13
  428. data/lib/tzinfo/definitions/Asia/Ulaanbaatar.rb +0 -69
  429. data/lib/tzinfo/definitions/Asia/Ulan_Bator.rb +0 -13
  430. data/lib/tzinfo/definitions/Asia/Urumqi.rb +0 -18
  431. data/lib/tzinfo/definitions/Asia/Ust__m__Nera.rb +0 -89
  432. data/lib/tzinfo/definitions/Asia/Vientiane.rb +0 -13
  433. data/lib/tzinfo/definitions/Asia/Vladivostok.rb +0 -86
  434. data/lib/tzinfo/definitions/Asia/Yakutsk.rb +0 -86
  435. data/lib/tzinfo/definitions/Asia/Yangon.rb +0 -23
  436. data/lib/tzinfo/definitions/Asia/Yekaterinburg.rb +0 -88
  437. data/lib/tzinfo/definitions/Asia/Yerevan.rb +0 -82
  438. data/lib/tzinfo/definitions/Atlantic/Azores.rb +0 -272
  439. data/lib/tzinfo/definitions/Atlantic/Bermuda.rb +0 -202
  440. data/lib/tzinfo/definitions/Atlantic/Canary.rb +0 -163
  441. data/lib/tzinfo/definitions/Atlantic/Cape_Verde.rb +0 -23
  442. data/lib/tzinfo/definitions/Atlantic/Faeroe.rb +0 -13
  443. data/lib/tzinfo/definitions/Atlantic/Faroe.rb +0 -159
  444. data/lib/tzinfo/definitions/Atlantic/Jan_Mayen.rb +0 -13
  445. data/lib/tzinfo/definitions/Atlantic/Madeira.rb +0 -271
  446. data/lib/tzinfo/definitions/Atlantic/Reykjavik.rb +0 -87
  447. data/lib/tzinfo/definitions/Atlantic/South_Georgia.rb +0 -18
  448. data/lib/tzinfo/definitions/Atlantic/St_Helena.rb +0 -13
  449. data/lib/tzinfo/definitions/Atlantic/Stanley.rb +0 -91
  450. data/lib/tzinfo/definitions/Australia/ACT.rb +0 -13
  451. data/lib/tzinfo/definitions/Australia/Adelaide.rb +0 -187
  452. data/lib/tzinfo/definitions/Australia/Brisbane.rb +0 -35
  453. data/lib/tzinfo/definitions/Australia/Broken_Hill.rb +0 -189
  454. data/lib/tzinfo/definitions/Australia/Canberra.rb +0 -13
  455. data/lib/tzinfo/definitions/Australia/Currie.rb +0 -13
  456. data/lib/tzinfo/definitions/Australia/Darwin.rb +0 -29
  457. data/lib/tzinfo/definitions/Australia/Eucla.rb +0 -37
  458. data/lib/tzinfo/definitions/Australia/Hobart.rb +0 -197
  459. data/lib/tzinfo/definitions/Australia/LHI.rb +0 -13
  460. data/lib/tzinfo/definitions/Australia/Lindeman.rb +0 -39
  461. data/lib/tzinfo/definitions/Australia/Lord_Howe.rb +0 -160
  462. data/lib/tzinfo/definitions/Australia/Melbourne.rb +0 -185
  463. data/lib/tzinfo/definitions/Australia/NSW.rb +0 -13
  464. data/lib/tzinfo/definitions/Australia/North.rb +0 -13
  465. data/lib/tzinfo/definitions/Australia/Perth.rb +0 -37
  466. data/lib/tzinfo/definitions/Australia/Queensland.rb +0 -13
  467. data/lib/tzinfo/definitions/Australia/South.rb +0 -13
  468. data/lib/tzinfo/definitions/Australia/Sydney.rb +0 -185
  469. data/lib/tzinfo/definitions/Australia/Tasmania.rb +0 -13
  470. data/lib/tzinfo/definitions/Australia/Victoria.rb +0 -13
  471. data/lib/tzinfo/definitions/Australia/West.rb +0 -13
  472. data/lib/tzinfo/definitions/Australia/Yancowinna.rb +0 -13
  473. data/lib/tzinfo/definitions/Brazil/Acre.rb +0 -13
  474. data/lib/tzinfo/definitions/Brazil/DeNoronha.rb +0 -13
  475. data/lib/tzinfo/definitions/Brazil/East.rb +0 -13
  476. data/lib/tzinfo/definitions/Brazil/West.rb +0 -13
  477. data/lib/tzinfo/definitions/CET.rb +0 -177
  478. data/lib/tzinfo/definitions/CST6CDT.rb +0 -192
  479. data/lib/tzinfo/definitions/Canada/Atlantic.rb +0 -13
  480. data/lib/tzinfo/definitions/Canada/Central.rb +0 -13
  481. data/lib/tzinfo/definitions/Canada/Eastern.rb +0 -13
  482. data/lib/tzinfo/definitions/Canada/Mountain.rb +0 -13
  483. data/lib/tzinfo/definitions/Canada/Newfoundland.rb +0 -13
  484. data/lib/tzinfo/definitions/Canada/Pacific.rb +0 -13
  485. data/lib/tzinfo/definitions/Canada/Saskatchewan.rb +0 -13
  486. data/lib/tzinfo/definitions/Canada/Yukon.rb +0 -13
  487. data/lib/tzinfo/definitions/Chile/Continental.rb +0 -13
  488. data/lib/tzinfo/definitions/Chile/EasterIsland.rb +0 -13
  489. data/lib/tzinfo/definitions/Cuba.rb +0 -11
  490. data/lib/tzinfo/definitions/EET.rb +0 -163
  491. data/lib/tzinfo/definitions/EST.rb +0 -14
  492. data/lib/tzinfo/definitions/EST5EDT.rb +0 -192
  493. data/lib/tzinfo/definitions/Egypt.rb +0 -11
  494. data/lib/tzinfo/definitions/Eire.rb +0 -11
  495. data/lib/tzinfo/definitions/Etc/GMT.rb +0 -16
  496. data/lib/tzinfo/definitions/Etc/GMT0.rb +0 -13
  497. data/lib/tzinfo/definitions/Etc/GMT__m__0.rb +0 -13
  498. data/lib/tzinfo/definitions/Etc/GMT__m__1.rb +0 -16
  499. data/lib/tzinfo/definitions/Etc/GMT__m__10.rb +0 -16
  500. data/lib/tzinfo/definitions/Etc/GMT__m__11.rb +0 -16
  501. data/lib/tzinfo/definitions/Etc/GMT__m__12.rb +0 -16
  502. data/lib/tzinfo/definitions/Etc/GMT__m__13.rb +0 -16
  503. data/lib/tzinfo/definitions/Etc/GMT__m__14.rb +0 -16
  504. data/lib/tzinfo/definitions/Etc/GMT__m__2.rb +0 -16
  505. data/lib/tzinfo/definitions/Etc/GMT__m__3.rb +0 -16
  506. data/lib/tzinfo/definitions/Etc/GMT__m__4.rb +0 -16
  507. data/lib/tzinfo/definitions/Etc/GMT__m__5.rb +0 -16
  508. data/lib/tzinfo/definitions/Etc/GMT__m__6.rb +0 -16
  509. data/lib/tzinfo/definitions/Etc/GMT__m__7.rb +0 -16
  510. data/lib/tzinfo/definitions/Etc/GMT__m__8.rb +0 -16
  511. data/lib/tzinfo/definitions/Etc/GMT__m__9.rb +0 -16
  512. data/lib/tzinfo/definitions/Etc/GMT__p__0.rb +0 -13
  513. data/lib/tzinfo/definitions/Etc/GMT__p__1.rb +0 -16
  514. data/lib/tzinfo/definitions/Etc/GMT__p__10.rb +0 -16
  515. data/lib/tzinfo/definitions/Etc/GMT__p__11.rb +0 -16
  516. data/lib/tzinfo/definitions/Etc/GMT__p__12.rb +0 -16
  517. data/lib/tzinfo/definitions/Etc/GMT__p__2.rb +0 -16
  518. data/lib/tzinfo/definitions/Etc/GMT__p__3.rb +0 -16
  519. data/lib/tzinfo/definitions/Etc/GMT__p__4.rb +0 -16
  520. data/lib/tzinfo/definitions/Etc/GMT__p__5.rb +0 -16
  521. data/lib/tzinfo/definitions/Etc/GMT__p__6.rb +0 -16
  522. data/lib/tzinfo/definitions/Etc/GMT__p__7.rb +0 -16
  523. data/lib/tzinfo/definitions/Etc/GMT__p__8.rb +0 -16
  524. data/lib/tzinfo/definitions/Etc/GMT__p__9.rb +0 -16
  525. data/lib/tzinfo/definitions/Etc/Greenwich.rb +0 -13
  526. data/lib/tzinfo/definitions/Etc/UCT.rb +0 -13
  527. data/lib/tzinfo/definitions/Etc/UTC.rb +0 -16
  528. data/lib/tzinfo/definitions/Etc/Universal.rb +0 -13
  529. data/lib/tzinfo/definitions/Etc/Zulu.rb +0 -13
  530. data/lib/tzinfo/definitions/Europe/Amsterdam.rb +0 -228
  531. data/lib/tzinfo/definitions/Europe/Andorra.rb +0 -153
  532. data/lib/tzinfo/definitions/Europe/Astrakhan.rb +0 -84
  533. data/lib/tzinfo/definitions/Europe/Athens.rb +0 -185
  534. data/lib/tzinfo/definitions/Europe/Belfast.rb +0 -13
  535. data/lib/tzinfo/definitions/Europe/Belgrade.rb +0 -163
  536. data/lib/tzinfo/definitions/Europe/Berlin.rb +0 -188
  537. data/lib/tzinfo/definitions/Europe/Bratislava.rb +0 -13
  538. data/lib/tzinfo/definitions/Europe/Brussels.rb +0 -232
  539. data/lib/tzinfo/definitions/Europe/Bucharest.rb +0 -181
  540. data/lib/tzinfo/definitions/Europe/Budapest.rb +0 -195
  541. data/lib/tzinfo/definitions/Europe/Busingen.rb +0 -13
  542. data/lib/tzinfo/definitions/Europe/Chisinau.rb +0 -191
  543. data/lib/tzinfo/definitions/Europe/Copenhagen.rb +0 -179
  544. data/lib/tzinfo/definitions/Europe/Dublin.rb +0 -276
  545. data/lib/tzinfo/definitions/Europe/Gibraltar.rb +0 -245
  546. data/lib/tzinfo/definitions/Europe/Guernsey.rb +0 -13
  547. data/lib/tzinfo/definitions/Europe/Helsinki.rb +0 -163
  548. data/lib/tzinfo/definitions/Europe/Isle_of_Man.rb +0 -13
  549. data/lib/tzinfo/definitions/Europe/Istanbul.rb +0 -136
  550. data/lib/tzinfo/definitions/Europe/Jersey.rb +0 -13
  551. data/lib/tzinfo/definitions/Europe/Kaliningrad.rb +0 -103
  552. data/lib/tzinfo/definitions/Europe/Kiev.rb +0 -170
  553. data/lib/tzinfo/definitions/Europe/Kirov.rb +0 -83
  554. data/lib/tzinfo/definitions/Europe/Lisbon.rb +0 -270
  555. data/lib/tzinfo/definitions/Europe/Ljubljana.rb +0 -13
  556. data/lib/tzinfo/definitions/Europe/London.rb +0 -288
  557. data/lib/tzinfo/definitions/Europe/Luxembourg.rb +0 -231
  558. data/lib/tzinfo/definitions/Europe/Madrid.rb +0 -209
  559. data/lib/tzinfo/definitions/Europe/Malta.rb +0 -213
  560. data/lib/tzinfo/definitions/Europe/Mariehamn.rb +0 -13
  561. data/lib/tzinfo/definitions/Europe/Minsk.rb +0 -92
  562. data/lib/tzinfo/definitions/Europe/Monaco.rb +0 -233
  563. data/lib/tzinfo/definitions/Europe/Moscow.rb +0 -104
  564. data/lib/tzinfo/definitions/Europe/Nicosia.rb +0 -13
  565. data/lib/tzinfo/definitions/Europe/Oslo.rb +0 -185
  566. data/lib/tzinfo/definitions/Europe/Paris.rb +0 -232
  567. data/lib/tzinfo/definitions/Europe/Podgorica.rb +0 -13
  568. data/lib/tzinfo/definitions/Europe/Prague.rb +0 -190
  569. data/lib/tzinfo/definitions/Europe/Riga.rb +0 -176
  570. data/lib/tzinfo/definitions/Europe/Rome.rb +0 -215
  571. data/lib/tzinfo/definitions/Europe/Samara.rb +0 -85
  572. data/lib/tzinfo/definitions/Europe/San_Marino.rb +0 -13
  573. data/lib/tzinfo/definitions/Europe/Sarajevo.rb +0 -13
  574. data/lib/tzinfo/definitions/Europe/Saratov.rb +0 -84
  575. data/lib/tzinfo/definitions/Europe/Simferopol.rb +0 -99
  576. data/lib/tzinfo/definitions/Europe/Skopje.rb +0 -13
  577. data/lib/tzinfo/definitions/Europe/Sofia.rb +0 -173
  578. data/lib/tzinfo/definitions/Europe/Stockholm.rb +0 -165
  579. data/lib/tzinfo/definitions/Europe/Tallinn.rb +0 -172
  580. data/lib/tzinfo/definitions/Europe/Tirane.rb +0 -177
  581. data/lib/tzinfo/definitions/Europe/Tiraspol.rb +0 -13
  582. data/lib/tzinfo/definitions/Europe/Ulyanovsk.rb +0 -88
  583. data/lib/tzinfo/definitions/Europe/Uzhgorod.rb +0 -168
  584. data/lib/tzinfo/definitions/Europe/Vaduz.rb +0 -13
  585. data/lib/tzinfo/definitions/Europe/Vatican.rb +0 -13
  586. data/lib/tzinfo/definitions/Europe/Vienna.rb +0 -183
  587. data/lib/tzinfo/definitions/Europe/Vilnius.rb +0 -170
  588. data/lib/tzinfo/definitions/Europe/Volgograd.rb +0 -85
  589. data/lib/tzinfo/definitions/Europe/Warsaw.rb +0 -212
  590. data/lib/tzinfo/definitions/Europe/Zagreb.rb +0 -13
  591. data/lib/tzinfo/definitions/Europe/Zaporozhye.rb +0 -171
  592. data/lib/tzinfo/definitions/Europe/Zurich.rb +0 -165
  593. data/lib/tzinfo/definitions/Factory.rb +0 -14
  594. data/lib/tzinfo/definitions/GB.rb +0 -11
  595. data/lib/tzinfo/definitions/GB__m__Eire.rb +0 -11
  596. data/lib/tzinfo/definitions/GMT.rb +0 -11
  597. data/lib/tzinfo/definitions/GMT0.rb +0 -11
  598. data/lib/tzinfo/definitions/GMT__m__0.rb +0 -11
  599. data/lib/tzinfo/definitions/GMT__p__0.rb +0 -11
  600. data/lib/tzinfo/definitions/Greenwich.rb +0 -11
  601. data/lib/tzinfo/definitions/HST.rb +0 -14
  602. data/lib/tzinfo/definitions/Hongkong.rb +0 -11
  603. data/lib/tzinfo/definitions/Iceland.rb +0 -11
  604. data/lib/tzinfo/definitions/Indian/Antananarivo.rb +0 -13
  605. data/lib/tzinfo/definitions/Indian/Chagos.rb +0 -20
  606. data/lib/tzinfo/definitions/Indian/Christmas.rb +0 -18
  607. data/lib/tzinfo/definitions/Indian/Cocos.rb +0 -18
  608. data/lib/tzinfo/definitions/Indian/Comoro.rb +0 -13
  609. data/lib/tzinfo/definitions/Indian/Kerguelen.rb +0 -18
  610. data/lib/tzinfo/definitions/Indian/Mahe.rb +0 -18
  611. data/lib/tzinfo/definitions/Indian/Maldives.rb +0 -20
  612. data/lib/tzinfo/definitions/Indian/Mauritius.rb +0 -23
  613. data/lib/tzinfo/definitions/Indian/Mayotte.rb +0 -13
  614. data/lib/tzinfo/definitions/Indian/Reunion.rb +0 -18
  615. data/lib/tzinfo/definitions/Iran.rb +0 -11
  616. data/lib/tzinfo/definitions/Israel.rb +0 -11
  617. data/lib/tzinfo/definitions/Jamaica.rb +0 -11
  618. data/lib/tzinfo/definitions/Japan.rb +0 -11
  619. data/lib/tzinfo/definitions/Kwajalein.rb +0 -11
  620. data/lib/tzinfo/definitions/Libya.rb +0 -11
  621. data/lib/tzinfo/definitions/MET.rb +0 -177
  622. data/lib/tzinfo/definitions/MST.rb +0 -14
  623. data/lib/tzinfo/definitions/MST7MDT.rb +0 -192
  624. data/lib/tzinfo/definitions/Mexico/BajaNorte.rb +0 -13
  625. data/lib/tzinfo/definitions/Mexico/BajaSur.rb +0 -13
  626. data/lib/tzinfo/definitions/Mexico/General.rb +0 -13
  627. data/lib/tzinfo/definitions/NZ.rb +0 -11
  628. data/lib/tzinfo/definitions/NZ__m__CHAT.rb +0 -11
  629. data/lib/tzinfo/definitions/Navajo.rb +0 -11
  630. data/lib/tzinfo/definitions/PRC.rb +0 -11
  631. data/lib/tzinfo/definitions/PST8PDT.rb +0 -192
  632. data/lib/tzinfo/definitions/Pacific/Apia.rb +0 -48
  633. data/lib/tzinfo/definitions/Pacific/Auckland.rb +0 -202
  634. data/lib/tzinfo/definitions/Pacific/Bougainville.rb +0 -25
  635. data/lib/tzinfo/definitions/Pacific/Chatham.rb +0 -173
  636. data/lib/tzinfo/definitions/Pacific/Chuuk.rb +0 -25
  637. data/lib/tzinfo/definitions/Pacific/Easter.rb +0 -185
  638. data/lib/tzinfo/definitions/Pacific/Efate.rb +0 -41
  639. data/lib/tzinfo/definitions/Pacific/Enderbury.rb +0 -13
  640. data/lib/tzinfo/definitions/Pacific/Fakaofo.rb +0 -20
  641. data/lib/tzinfo/definitions/Pacific/Fiji.rb +0 -103
  642. data/lib/tzinfo/definitions/Pacific/Funafuti.rb +0 -18
  643. data/lib/tzinfo/definitions/Pacific/Galapagos.rb +0 -23
  644. data/lib/tzinfo/definitions/Pacific/Gambier.rb +0 -18
  645. data/lib/tzinfo/definitions/Pacific/Guadalcanal.rb +0 -18
  646. data/lib/tzinfo/definitions/Pacific/Guam.rb +0 -42
  647. data/lib/tzinfo/definitions/Pacific/Honolulu.rb +0 -28
  648. data/lib/tzinfo/definitions/Pacific/Johnston.rb +0 -13
  649. data/lib/tzinfo/definitions/Pacific/Kanton.rb +0 -22
  650. data/lib/tzinfo/definitions/Pacific/Kiritimati.rb +0 -22
  651. data/lib/tzinfo/definitions/Pacific/Kosrae.rb +0 -30
  652. data/lib/tzinfo/definitions/Pacific/Kwajalein.rb +0 -27
  653. data/lib/tzinfo/definitions/Pacific/Majuro.rb +0 -27
  654. data/lib/tzinfo/definitions/Pacific/Marquesas.rb +0 -18
  655. data/lib/tzinfo/definitions/Pacific/Midway.rb +0 -13
  656. data/lib/tzinfo/definitions/Pacific/Nauru.rb +0 -23
  657. data/lib/tzinfo/definitions/Pacific/Niue.rb +0 -20
  658. data/lib/tzinfo/definitions/Pacific/Norfolk.rb +0 -88
  659. data/lib/tzinfo/definitions/Pacific/Noumea.rb +0 -25
  660. data/lib/tzinfo/definitions/Pacific/Pago_Pago.rb +0 -20
  661. data/lib/tzinfo/definitions/Pacific/Palau.rb +0 -20
  662. data/lib/tzinfo/definitions/Pacific/Pitcairn.rb +0 -20
  663. data/lib/tzinfo/definitions/Pacific/Pohnpei.rb +0 -27
  664. data/lib/tzinfo/definitions/Pacific/Ponape.rb +0 -13
  665. data/lib/tzinfo/definitions/Pacific/Port_Moresby.rb +0 -20
  666. data/lib/tzinfo/definitions/Pacific/Rarotonga.rb +0 -48
  667. data/lib/tzinfo/definitions/Pacific/Saipan.rb +0 -13
  668. data/lib/tzinfo/definitions/Pacific/Samoa.rb +0 -13
  669. data/lib/tzinfo/definitions/Pacific/Tahiti.rb +0 -18
  670. data/lib/tzinfo/definitions/Pacific/Tarawa.rb +0 -18
  671. data/lib/tzinfo/definitions/Pacific/Tongatapu.rb +0 -29
  672. data/lib/tzinfo/definitions/Pacific/Truk.rb +0 -13
  673. data/lib/tzinfo/definitions/Pacific/Wake.rb +0 -18
  674. data/lib/tzinfo/definitions/Pacific/Wallis.rb +0 -18
  675. data/lib/tzinfo/definitions/Pacific/Yap.rb +0 -13
  676. data/lib/tzinfo/definitions/Poland.rb +0 -11
  677. data/lib/tzinfo/definitions/Portugal.rb +0 -11
  678. data/lib/tzinfo/definitions/ROC.rb +0 -11
  679. data/lib/tzinfo/definitions/ROK.rb +0 -11
  680. data/lib/tzinfo/definitions/Singapore.rb +0 -11
  681. data/lib/tzinfo/definitions/Turkey.rb +0 -11
  682. data/lib/tzinfo/definitions/UCT.rb +0 -11
  683. data/lib/tzinfo/definitions/US/Alaska.rb +0 -13
  684. data/lib/tzinfo/definitions/US/Aleutian.rb +0 -13
  685. data/lib/tzinfo/definitions/US/Arizona.rb +0 -13
  686. data/lib/tzinfo/definitions/US/Central.rb +0 -13
  687. data/lib/tzinfo/definitions/US/East__m__Indiana.rb +0 -13
  688. data/lib/tzinfo/definitions/US/Eastern.rb +0 -13
  689. data/lib/tzinfo/definitions/US/Hawaii.rb +0 -13
  690. data/lib/tzinfo/definitions/US/Indiana__m__Starke.rb +0 -13
  691. data/lib/tzinfo/definitions/US/Michigan.rb +0 -13
  692. data/lib/tzinfo/definitions/US/Mountain.rb +0 -13
  693. data/lib/tzinfo/definitions/US/Pacific.rb +0 -13
  694. data/lib/tzinfo/definitions/US/Samoa.rb +0 -13
  695. data/lib/tzinfo/definitions/UTC.rb +0 -11
  696. data/lib/tzinfo/definitions/Universal.rb +0 -11
  697. data/lib/tzinfo/definitions/WET.rb +0 -163
  698. data/lib/tzinfo/definitions/W__m__SU.rb +0 -11
  699. data/lib/tzinfo/definitions/Zulu.rb +0 -11
  700. data/lib/tzinfo/indexes/countries.rb +0 -930
  701. data/lib/tzinfo/indexes/timezones.rb +0 -605
  702. data/lib/tzinfo/tzdataparser.rb +0 -1287
  703. data/test/in_load_path/payload.rb +0 -1
  704. data/tzinfo.gemspec +0 -19
@@ -1,6 +1,26 @@
1
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
2
- require 'test/unit'
3
- require 'tzinfo'
1
+ #--
2
+ # Copyright (c) 2005-2013 Philip Ross
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in all
12
+ # copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ # THE SOFTWARE.
21
+ #++
22
+
23
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'test_utils')
4
24
 
5
25
  include TZInfo
6
26
 
@@ -53,62 +73,75 @@ class TCTimezoneLondon < Test::Unit::TestCase
53
73
  end
54
74
 
55
75
  def test_1961
56
- #Europe/London Sun Mar 26 01:59:59 1961 UTC = Sun Mar 26 01:59:59 1961 GMT isdst=0 gmtoff=0
57
- #Europe/London Sun Mar 26 02:00:00 1961 UTC = Sun Mar 26 03:00:00 1961 BST isdst=1 gmtoff=3600
58
- #Europe/London Sun Oct 29 01:59:59 1961 UTC = Sun Oct 29 02:59:59 1961 BST isdst=1 gmtoff=3600
59
- #Europe/London Sun Oct 29 02:00:00 1961 UTC = Sun Oct 29 02:00:00 1961 GMT isdst=0 gmtoff=0
60
-
61
- tz = Timezone.get('Europe/London')
62
- assert_equal(DateTime.new(1961,3,26,1,59,59), tz.utc_to_local(DateTime.new(1961,3,26,1,59,59)))
63
- assert_equal(DateTime.new(1961,3,26,3,0,0), tz.utc_to_local(DateTime.new(1961,3,26,2,0,0)))
64
- assert_equal(DateTime.new(1961,10,29,2,59,59), tz.utc_to_local(DateTime.new(1961,10,29,1,59,59)))
65
- assert_equal(DateTime.new(1961,10,29,2,0,0), tz.utc_to_local(DateTime.new(1961,10,29,2,0,0)))
66
-
67
- assert_equal(DateTime.new(1961,3,26,1,59,59), tz.local_to_utc(DateTime.new(1961,3,26,1,59,59)))
68
- assert_equal(DateTime.new(1961,3,26,2,0,0), tz.local_to_utc(DateTime.new(1961,3,26,3,0,0)))
69
- assert_equal(DateTime.new(1961,10,29,1,59,59), tz.local_to_utc(DateTime.new(1961,10,29,2,59,59), true))
70
- assert_equal(DateTime.new(1961,10,29,2,59,59), tz.local_to_utc(DateTime.new(1961,10,29,2,59,59), false))
71
- assert_equal(DateTime.new(1961,10,29,1,0,0), tz.local_to_utc(DateTime.new(1961,10,29,2,0,0), true))
72
- assert_equal(DateTime.new(1961,10,29,2,0,0), tz.local_to_utc(DateTime.new(1961,10,29,2,0,0), false))
73
-
74
- assert_raises(PeriodNotFound) { tz.local_to_utc(DateTime.new(1961,3,26,2,0,0)) }
75
- assert_raises(AmbiguousTime) { tz.local_to_utc(DateTime.new(1961,10,29,2,0,0)) }
76
-
77
- assert_equal(:GMT, tz.period_for_utc(DateTime.new(1961,3,26,1,59,59)).zone_identifier)
78
- assert_equal(:BST, tz.period_for_utc(DateTime.new(1961,3,26,2,0,0)).zone_identifier)
79
- assert_equal(:BST, tz.period_for_utc(DateTime.new(1961,10,29,1,59,59)).zone_identifier)
80
- assert_equal(:GMT, tz.period_for_utc(DateTime.new(1961,10,29,2,0,0)).zone_identifier)
81
-
82
- assert_equal(:GMT, tz.period_for_local(DateTime.new(1961,3,26,1,59,59)).zone_identifier)
83
- assert_equal(:BST, tz.period_for_local(DateTime.new(1961,3,26,3,0,0)).zone_identifier)
84
- assert_equal(:BST, tz.period_for_local(DateTime.new(1961,10,29,2,59,59), true).zone_identifier)
85
- assert_equal(:GMT, tz.period_for_local(DateTime.new(1961,10,29,2,59,59), false).zone_identifier)
86
- assert_equal(:BST, tz.period_for_local(DateTime.new(1961,10,29,2,0,0), true).zone_identifier)
87
- assert_equal(:GMT, tz.period_for_local(DateTime.new(1961,10,29,2,0,0), false).zone_identifier)
88
-
89
- assert_equal(0, tz.period_for_utc(DateTime.new(1961,3,26,1,59,59)).utc_total_offset)
90
- assert_equal(3600, tz.period_for_utc(DateTime.new(1961,3,26,2,0,0)).utc_total_offset)
91
- assert_equal(3600, tz.period_for_utc(DateTime.new(1961,10,29,1,59,59)).utc_total_offset)
92
- assert_equal(0, tz.period_for_utc(DateTime.new(1961,10,29,2,0,0)).utc_total_offset)
76
+ # This test cannot be run when using ZoneinfoDataSource on platforms
77
+ # that don't support Times before the epoch (i.e. Ruby < 1.9 on Windows)
78
+ # because it relates to the year 1961.
93
79
 
94
- assert_equal(0, tz.period_for_local(DateTime.new(1961,3,26,1,59,59)).utc_total_offset)
95
- assert_equal(3600, tz.period_for_local(DateTime.new(1961,3,26,3,0,0)).utc_total_offset)
96
- assert_equal(3600, tz.period_for_local(DateTime.new(1961,10,29,2,59,59), true).utc_total_offset)
97
- assert_equal(0, tz.period_for_local(DateTime.new(1961,10,29,2,59,59), false).utc_total_offset)
98
- assert_equal(3600, tz.period_for_local(DateTime.new(1961,10,29,2,0,0), true).utc_total_offset)
99
- assert_equal(0, tz.period_for_local(DateTime.new(1961,10,29,2,0,0), false).utc_total_offset)
80
+ if !DataSource.get.kind_of?(ZoneinfoDataSource) || RubyCoreSupport.time_supports_negative
81
+ #Europe/London Sun Mar 26 01:59:59 1961 UTC = Sun Mar 26 01:59:59 1961 GMT isdst=0 gmtoff=0
82
+ #Europe/London Sun Mar 26 02:00:00 1961 UTC = Sun Mar 26 03:00:00 1961 BST isdst=1 gmtoff=3600
83
+ #Europe/London Sun Oct 29 01:59:59 1961 UTC = Sun Oct 29 02:59:59 1961 BST isdst=1 gmtoff=3600
84
+ #Europe/London Sun Oct 29 02:00:00 1961 UTC = Sun Oct 29 02:00:00 1961 GMT isdst=0 gmtoff=0
85
+
86
+ tz = Timezone.get('Europe/London')
87
+ assert_equal(DateTime.new(1961,3,26,1,59,59), tz.utc_to_local(DateTime.new(1961,3,26,1,59,59)))
88
+ assert_equal(DateTime.new(1961,3,26,3,0,0), tz.utc_to_local(DateTime.new(1961,3,26,2,0,0)))
89
+ assert_equal(DateTime.new(1961,10,29,2,59,59), tz.utc_to_local(DateTime.new(1961,10,29,1,59,59)))
90
+ assert_equal(DateTime.new(1961,10,29,2,0,0), tz.utc_to_local(DateTime.new(1961,10,29,2,0,0)))
91
+
92
+ assert_equal(DateTime.new(1961,3,26,1,59,59), tz.local_to_utc(DateTime.new(1961,3,26,1,59,59)))
93
+ assert_equal(DateTime.new(1961,3,26,2,0,0), tz.local_to_utc(DateTime.new(1961,3,26,3,0,0)))
94
+ assert_equal(DateTime.new(1961,10,29,1,59,59), tz.local_to_utc(DateTime.new(1961,10,29,2,59,59), true))
95
+ assert_equal(DateTime.new(1961,10,29,2,59,59), tz.local_to_utc(DateTime.new(1961,10,29,2,59,59), false))
96
+ assert_equal(DateTime.new(1961,10,29,1,0,0), tz.local_to_utc(DateTime.new(1961,10,29,2,0,0), true))
97
+ assert_equal(DateTime.new(1961,10,29,2,0,0), tz.local_to_utc(DateTime.new(1961,10,29,2,0,0), false))
98
+
99
+ assert_raises(PeriodNotFound) { tz.local_to_utc(DateTime.new(1961,3,26,2,0,0)) }
100
+ assert_raises(AmbiguousTime) { tz.local_to_utc(DateTime.new(1961,10,29,2,0,0)) }
101
+
102
+ assert_equal(:GMT, tz.period_for_utc(DateTime.new(1961,3,26,1,59,59)).zone_identifier)
103
+ assert_equal(:BST, tz.period_for_utc(DateTime.new(1961,3,26,2,0,0)).zone_identifier)
104
+ assert_equal(:BST, tz.period_for_utc(DateTime.new(1961,10,29,1,59,59)).zone_identifier)
105
+ assert_equal(:GMT, tz.period_for_utc(DateTime.new(1961,10,29,2,0,0)).zone_identifier)
106
+
107
+ assert_equal(:GMT, tz.period_for_local(DateTime.new(1961,3,26,1,59,59)).zone_identifier)
108
+ assert_equal(:BST, tz.period_for_local(DateTime.new(1961,3,26,3,0,0)).zone_identifier)
109
+ assert_equal(:BST, tz.period_for_local(DateTime.new(1961,10,29,2,59,59), true).zone_identifier)
110
+ assert_equal(:GMT, tz.period_for_local(DateTime.new(1961,10,29,2,59,59), false).zone_identifier)
111
+ assert_equal(:BST, tz.period_for_local(DateTime.new(1961,10,29,2,0,0), true).zone_identifier)
112
+ assert_equal(:GMT, tz.period_for_local(DateTime.new(1961,10,29,2,0,0), false).zone_identifier)
113
+
114
+ assert_equal(0, tz.period_for_utc(DateTime.new(1961,3,26,1,59,59)).utc_total_offset)
115
+ assert_equal(3600, tz.period_for_utc(DateTime.new(1961,3,26,2,0,0)).utc_total_offset)
116
+ assert_equal(3600, tz.period_for_utc(DateTime.new(1961,10,29,1,59,59)).utc_total_offset)
117
+ assert_equal(0, tz.period_for_utc(DateTime.new(1961,10,29,2,0,0)).utc_total_offset)
118
+
119
+ assert_equal(0, tz.period_for_local(DateTime.new(1961,3,26,1,59,59)).utc_total_offset)
120
+ assert_equal(3600, tz.period_for_local(DateTime.new(1961,3,26,3,0,0)).utc_total_offset)
121
+ assert_equal(3600, tz.period_for_local(DateTime.new(1961,10,29,2,59,59), true).utc_total_offset)
122
+ assert_equal(0, tz.period_for_local(DateTime.new(1961,10,29,2,59,59), false).utc_total_offset)
123
+ assert_equal(3600, tz.period_for_local(DateTime.new(1961,10,29,2,0,0), true).utc_total_offset)
124
+ assert_equal(0, tz.period_for_local(DateTime.new(1961,10,29,2,0,0), false).utc_total_offset)
125
+ end
100
126
  end
101
127
 
102
128
  def test_time_boundary
103
- #Europe/London Sat Oct 26 23:00:00 1968 UTC = Sun Oct 27 00:00:00 1968 GMT isdst=0 gmtoff=3600
104
- #Europe/London Sun Oct 31 01:59:59 1971 UTC = Sun Oct 31 02:59:59 1971 GMT isdst=0 gmtoff=3600
129
+ # This test cannot be run when using ZoneinfoDataSource on platforms
130
+ # that don't support Times before the epoch (i.e. Ruby < 1.9 on Windows)
131
+ # because it relates to the period following the transition prior to the
132
+ # epoch.
105
133
 
106
- tz = Timezone.get('Europe/London')
107
- assert_equal(DateTime.new(1970,1,1,1,0,0), tz.utc_to_local(DateTime.new(1970,1,1,0,0,0)))
108
- assert_equal(DateTime.new(1970,1,1,0,0,0), tz.local_to_utc(DateTime.new(1970,1,1,1,0,0)))
109
- assert_equal(Time.utc(1970,1,1,1,0,0), tz.utc_to_local(Time.utc(1970,1,1,0,0,0)))
110
- assert_equal(Time.utc(1970,1,1,0,0,0), tz.local_to_utc(Time.utc(1970,1,1,1,0,0)))
111
- assert_equal(3600, tz.utc_to_local(0))
112
- assert_equal(0, tz.local_to_utc(3600))
134
+ if !DataSource.get.kind_of?(ZoneinfoDataSource) || RubyCoreSupport.time_supports_negative
135
+ #Europe/London Sat Oct 26 23:00:00 1968 UTC = Sun Oct 27 00:00:00 1968 GMT isdst=0 gmtoff=3600
136
+ #Europe/London Sun Oct 31 01:59:59 1971 UTC = Sun Oct 31 02:59:59 1971 GMT isdst=0 gmtoff=3600
137
+
138
+ tz = Timezone.get('Europe/London')
139
+ assert_equal(DateTime.new(1970,1,1,1,0,0), tz.utc_to_local(DateTime.new(1970,1,1,0,0,0)))
140
+ assert_equal(DateTime.new(1970,1,1,0,0,0), tz.local_to_utc(DateTime.new(1970,1,1,1,0,0)))
141
+ assert_equal(Time.utc(1970,1,1,1,0,0), tz.utc_to_local(Time.utc(1970,1,1,0,0,0)))
142
+ assert_equal(Time.utc(1970,1,1,0,0,0), tz.local_to_utc(Time.utc(1970,1,1,1,0,0)))
143
+ assert_equal(3600, tz.utc_to_local(0))
144
+ assert_equal(0, tz.local_to_utc(3600))
145
+ end
113
146
  end
114
- end
147
+ end
@@ -1,15 +1,35 @@
1
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
2
- require 'test/unit'
3
- require 'tzinfo'
1
+ #--
2
+ # Copyright (c) 2005-2013 Philip Ross
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in all
12
+ # copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ # THE SOFTWARE.
21
+ #++
22
+
23
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'test_utils')
4
24
 
5
25
  include TZInfo
6
26
 
7
27
  class TCTimezoneMelbourne < Test::Unit::TestCase
8
28
  def test_2004
9
- #Australia/Melbourne Sat Mar 27 15:59:59 2004 UTC = Sun Mar 28 02:59:59 2004 AEDT isdst=1 gmtoff=39600
10
- #Australia/Melbourne Sat Mar 27 16:00:00 2004 UTC = Sun Mar 28 02:00:00 2004 AEST isdst=0 gmtoff=36000
11
- #Australia/Melbourne Sat Oct 30 15:59:59 2004 UTC = Sun Oct 31 01:59:59 2004 AEST isdst=0 gmtoff=36000
12
- #Australia/Melbourne Sat Oct 30 16:00:00 2004 UTC = Sun Oct 31 03:00:00 2004 AEDT isdst=1 gmtoff=39600
29
+ #Australia/Melbourne Sat Mar 27 15:59:59 2004 UTC = Sun Mar 28 02:59:59 2004 EST isdst=1 gmtoff=39600
30
+ #Australia/Melbourne Sat Mar 27 16:00:00 2004 UTC = Sun Mar 28 02:00:00 2004 EST isdst=0 gmtoff=36000
31
+ #Australia/Melbourne Sat Oct 30 15:59:59 2004 UTC = Sun Oct 31 01:59:59 2004 EST isdst=0 gmtoff=36000
32
+ #Australia/Melbourne Sat Oct 30 16:00:00 2004 UTC = Sun Oct 31 03:00:00 2004 EST isdst=1 gmtoff=39600
13
33
 
14
34
  tz = Timezone.get('Australia/Melbourne')
15
35
  assert_equal(DateTime.new(2004,3,28,2,59,59), tz.utc_to_local(DateTime.new(2004,3,27,15,59,59)))
@@ -27,17 +47,17 @@ class TCTimezoneMelbourne < Test::Unit::TestCase
27
47
  assert_raises(PeriodNotFound) { tz.local_to_utc(DateTime.new(2004,10,31,2,0,0)) }
28
48
  assert_raises(AmbiguousTime) { tz.local_to_utc(DateTime.new(2004,3,28,2,0,0)) }
29
49
 
30
- assert_equal(:AEDT, tz.period_for_utc(DateTime.new(2004,3,27,15,59,59)).zone_identifier)
31
- assert_equal(:AEST, tz.period_for_utc(DateTime.new(2004,3,27,16,0,0)).zone_identifier)
32
- assert_equal(:AEST, tz.period_for_utc(DateTime.new(2004,10,30,15,59,59)).zone_identifier)
33
- assert_equal(:AEDT, tz.period_for_utc(DateTime.new(2004,10,30,16,0,0)).zone_identifier)
50
+ assert_equal(:EST, tz.period_for_utc(DateTime.new(2004,3,27,15,59,59)).zone_identifier)
51
+ assert_equal(:EST, tz.period_for_utc(DateTime.new(2004,3,27,16,0,0)).zone_identifier)
52
+ assert_equal(:EST, tz.period_for_utc(DateTime.new(2004,10,30,15,59,59)).zone_identifier)
53
+ assert_equal(:EST, tz.period_for_utc(DateTime.new(2004,10,30,16,0,0)).zone_identifier)
34
54
 
35
- assert_equal(:AEDT, tz.period_for_local(DateTime.new(2004,3,28,2,59,59), true).zone_identifier)
36
- assert_equal(:AEST, tz.period_for_local(DateTime.new(2004,3,28,2,59,59), false).zone_identifier)
37
- assert_equal(:AEDT, tz.period_for_local(DateTime.new(2004,3,28,2,0,0), true).zone_identifier)
38
- assert_equal(:AEST, tz.period_for_local(DateTime.new(2004,3,28,2,0,0), false).zone_identifier)
39
- assert_equal(:AEST, tz.period_for_local(DateTime.new(2004,10,31,1,59,59)).zone_identifier)
40
- assert_equal(:AEDT, tz.period_for_local(DateTime.new(2004,10,31,3,0,0)).zone_identifier)
55
+ assert_equal(:EST, tz.period_for_local(DateTime.new(2004,3,28,2,59,59), true).zone_identifier)
56
+ assert_equal(:EST, tz.period_for_local(DateTime.new(2004,3,28,2,59,59), false).zone_identifier)
57
+ assert_equal(:EST, tz.period_for_local(DateTime.new(2004,3,28,2,0,0), true).zone_identifier)
58
+ assert_equal(:EST, tz.period_for_local(DateTime.new(2004,3,28,2,0,0), false).zone_identifier)
59
+ assert_equal(:EST, tz.period_for_local(DateTime.new(2004,10,31,1,59,59)).zone_identifier)
60
+ assert_equal(:EST, tz.period_for_local(DateTime.new(2004,10,31,3,0,0)).zone_identifier)
41
61
 
42
62
  assert_equal(39600, tz.period_for_utc(DateTime.new(2004,3,27,15,59,59)).utc_total_offset)
43
63
  assert_equal(36000, tz.period_for_utc(DateTime.new(2004,3,27,16,0,0)).utc_total_offset)
@@ -53,55 +73,61 @@ class TCTimezoneMelbourne < Test::Unit::TestCase
53
73
  end
54
74
 
55
75
  def test_1942
56
- #Australia/Melbourne Sat Mar 28 15:59:59 1942 UTC = Sun Mar 29 02:59:59 1942 AEDT isdst=1 gmtoff=39600
57
- #Australia/Melbourne Sat Mar 28 16:00:00 1942 UTC = Sun Mar 29 02:00:00 1942 AEST isdst=0 gmtoff=36000
58
- #Australia/Melbourne Sat Sep 26 15:59:59 1942 UTC = Sun Sep 27 01:59:59 1942 AEST isdst=0 gmtoff=36000
59
- #Australia/Melbourne Sat Sep 26 16:00:00 1942 UTC = Sun Sep 27 03:00:00 1942 AEDT isdst=1 gmtoff=39600
60
-
61
- tz = Timezone.get('Australia/Melbourne')
62
- assert_equal(DateTime.new(1942,3,29,2,59,59), tz.utc_to_local(DateTime.new(1942,3,28,15,59,59)))
63
- assert_equal(DateTime.new(1942,3,29,2,0,0), tz.utc_to_local(DateTime.new(1942,3,28,16,0,0)))
64
- assert_equal(DateTime.new(1942,9,27,1,59,59), tz.utc_to_local(DateTime.new(1942,9,26,15,59,59)))
65
- assert_equal(DateTime.new(1942,9,27,3,0,0), tz.utc_to_local(DateTime.new(1942,9,26,16,0,0)))
66
-
67
- assert_equal(DateTime.new(1942,3,28,15,59,59), tz.local_to_utc(DateTime.new(1942,3,29,2,59,59), true))
68
- assert_equal(DateTime.new(1942,3,28,16,59,59), tz.local_to_utc(DateTime.new(1942,3,29,2,59,59), false))
69
- assert_equal(DateTime.new(1942,3,28,15,0,0), tz.local_to_utc(DateTime.new(1942,3,29,2,0,0), true))
70
- assert_equal(DateTime.new(1942,3,28,16,0,0), tz.local_to_utc(DateTime.new(1942,3,29,2,0,0), false))
71
- assert_equal(DateTime.new(1942,9,26,15,59,59), tz.local_to_utc(DateTime.new(1942,9,27,1,59,59)))
72
- assert_equal(DateTime.new(1942,9,26,16,0,0), tz.local_to_utc(DateTime.new(1942,9,27,3,0,0)))
73
-
74
- assert_raises(PeriodNotFound) { tz.local_to_utc(DateTime.new(1942,9,27,2,0,0)) }
75
- assert_raises(AmbiguousTime) { tz.local_to_utc(DateTime.new(1942,3,29,2,0,0)) }
76
-
77
- assert_equal(:AEDT, tz.period_for_utc(DateTime.new(1942,3,28,15,59,59)).zone_identifier)
78
- assert_equal(:AEST, tz.period_for_utc(DateTime.new(1942,3,28,16,0,0)).zone_identifier)
79
- assert_equal(:AEST, tz.period_for_utc(DateTime.new(1942,9,26,15,59,59)).zone_identifier)
80
- assert_equal(:AEDT, tz.period_for_utc(DateTime.new(1942,9,26,16,0,0)).zone_identifier)
81
-
82
- assert_equal(:AEDT, tz.period_for_local(DateTime.new(1942,3,29,2,59,59), true).zone_identifier)
83
- assert_equal(:AEST, tz.period_for_local(DateTime.new(1942,3,29,2,59,59), false).zone_identifier)
84
- assert_equal(:AEDT, tz.period_for_local(DateTime.new(1942,3,29,2,0,0), true).zone_identifier)
85
- assert_equal(:AEST, tz.period_for_local(DateTime.new(1942,3,29,2,0,0), false).zone_identifier)
86
- assert_equal(:AEST, tz.period_for_local(DateTime.new(1942,9,27,1,59,59)).zone_identifier)
87
- assert_equal(:AEDT, tz.period_for_local(DateTime.new(1942,9,27,3,0,0)).zone_identifier)
88
-
89
- assert_equal(39600, tz.period_for_utc(DateTime.new(1942,3,28,15,59,59)).utc_total_offset)
90
- assert_equal(36000, tz.period_for_utc(DateTime.new(1942,3,28,16,0,0)).utc_total_offset)
91
- assert_equal(36000, tz.period_for_utc(DateTime.new(1942,9,26,15,59,59)).utc_total_offset)
92
- assert_equal(39600, tz.period_for_utc(DateTime.new(1942,9,26,16,0,0)).utc_total_offset)
76
+ # This test cannot be run when using ZoneinfoDataSource on platforms
77
+ # that don't support Times before the epoch (i.e. Ruby < 1.9 on Windows)
78
+ # because it relates to the year 1942.
93
79
 
94
- assert_equal(39600, tz.period_for_local(DateTime.new(1942,3,29,2,59,59), true).utc_total_offset)
95
- assert_equal(36000, tz.period_for_local(DateTime.new(1942,3,29,2,59,59), false).utc_total_offset)
96
- assert_equal(39600, tz.period_for_local(DateTime.new(1942,3,29,2,0,0), true).utc_total_offset)
97
- assert_equal(36000, tz.period_for_local(DateTime.new(1942,3,29,2,0,0), false).utc_total_offset)
98
- assert_equal(36000, tz.period_for_local(DateTime.new(1942,9,27,1,59,59)).utc_total_offset)
99
- assert_equal(39600, tz.period_for_local(DateTime.new(1942,9,27,3,0,0)).utc_total_offset)
80
+ if !DataSource.get.kind_of?(ZoneinfoDataSource) || RubyCoreSupport.time_supports_negative
81
+ #Australia/Melbourne Sat Mar 28 14:59:59 1942 UTC = Sun Mar 29 01:59:59 1942 EST isdst=1 gmtoff=39600
82
+ #Australia/Melbourne Sat Mar 28 15:00:00 1942 UTC = Sun Mar 29 01:00:00 1942 EST isdst=0 gmtoff=36000
83
+ #Australia/Melbourne Sat Sep 26 15:59:59 1942 UTC = Sun Sep 27 01:59:59 1942 EST isdst=0 gmtoff=36000
84
+ #Australia/Melbourne Sat Sep 26 16:00:00 1942 UTC = Sun Sep 27 03:00:00 1942 EST isdst=1 gmtoff=39600
85
+
86
+ tz = Timezone.get('Australia/Melbourne')
87
+ assert_equal(DateTime.new(1942,3,29,1,59,59), tz.utc_to_local(DateTime.new(1942,3,28,14,59,59)))
88
+ assert_equal(DateTime.new(1942,3,29,1,0,0), tz.utc_to_local(DateTime.new(1942,3,28,15,0,0)))
89
+ assert_equal(DateTime.new(1942,9,27,1,59,59), tz.utc_to_local(DateTime.new(1942,9,26,15,59,59)))
90
+ assert_equal(DateTime.new(1942,9,27,3,0,0), tz.utc_to_local(DateTime.new(1942,9,26,16,0,0)))
91
+
92
+ assert_equal(DateTime.new(1942,3,28,14,59,59), tz.local_to_utc(DateTime.new(1942,3,29,1,59,59), true))
93
+ assert_equal(DateTime.new(1942,3,28,15,59,59), tz.local_to_utc(DateTime.new(1942,3,29,1,59,59), false))
94
+ assert_equal(DateTime.new(1942,3,28,14,0,0), tz.local_to_utc(DateTime.new(1942,3,29,1,0,0), true))
95
+ assert_equal(DateTime.new(1942,3,28,15,0,0), tz.local_to_utc(DateTime.new(1942,3,29,1,0,0), false))
96
+ assert_equal(DateTime.new(1942,9,26,15,59,59), tz.local_to_utc(DateTime.new(1942,9,27,1,59,59)))
97
+ assert_equal(DateTime.new(1942,9,26,16,0,0), tz.local_to_utc(DateTime.new(1942,9,27,3,0,0)))
98
+
99
+ assert_raises(PeriodNotFound) { tz.local_to_utc(DateTime.new(1942,9,27,2,0,0)) }
100
+ assert_raises(AmbiguousTime) { tz.local_to_utc(DateTime.new(1942,3,29,1,0,0)) }
101
+
102
+ assert_equal(:EST, tz.period_for_utc(DateTime.new(1942,3,28,14,59,59)).zone_identifier)
103
+ assert_equal(:EST, tz.period_for_utc(DateTime.new(1942,3,28,15,0,0)).zone_identifier)
104
+ assert_equal(:EST, tz.period_for_utc(DateTime.new(1942,9,26,15,59,59)).zone_identifier)
105
+ assert_equal(:EST, tz.period_for_utc(DateTime.new(1942,9,26,16,0,0)).zone_identifier)
106
+
107
+ assert_equal(:EST, tz.period_for_local(DateTime.new(1942,3,29,1,59,59), true).zone_identifier)
108
+ assert_equal(:EST, tz.period_for_local(DateTime.new(1942,3,29,1,59,59), false).zone_identifier)
109
+ assert_equal(:EST, tz.period_for_local(DateTime.new(1942,3,29,1,0,0), true).zone_identifier)
110
+ assert_equal(:EST, tz.period_for_local(DateTime.new(1942,3,29,1,0,0), false).zone_identifier)
111
+ assert_equal(:EST, tz.period_for_local(DateTime.new(1942,9,27,1,59,59)).zone_identifier)
112
+ assert_equal(:EST, tz.period_for_local(DateTime.new(1942,9,27,3,0,0)).zone_identifier)
113
+
114
+ assert_equal(39600, tz.period_for_utc(DateTime.new(1942,3,28,14,59,59)).utc_total_offset)
115
+ assert_equal(36000, tz.period_for_utc(DateTime.new(1942,3,28,15,0,0)).utc_total_offset)
116
+ assert_equal(36000, tz.period_for_utc(DateTime.new(1942,9,26,15,59,59)).utc_total_offset)
117
+ assert_equal(39600, tz.period_for_utc(DateTime.new(1942,9,26,16,0,0)).utc_total_offset)
118
+
119
+ assert_equal(39600, tz.period_for_local(DateTime.new(1942,3,29,1,59,59), true).utc_total_offset)
120
+ assert_equal(36000, tz.period_for_local(DateTime.new(1942,3,29,1,59,59), false).utc_total_offset)
121
+ assert_equal(39600, tz.period_for_local(DateTime.new(1942,3,29,1,0,0), true).utc_total_offset)
122
+ assert_equal(36000, tz.period_for_local(DateTime.new(1942,3,29,1,0,0), false).utc_total_offset)
123
+ assert_equal(36000, tz.period_for_local(DateTime.new(1942,9,27,1,59,59)).utc_total_offset)
124
+ assert_equal(39600, tz.period_for_local(DateTime.new(1942,9,27,3,0,0)).utc_total_offset)
125
+ end
100
126
  end
101
127
 
102
128
  def test_time_boundary
103
- #Australia/Melbourne Sat Mar 25 15:00:00 1944 UTC = Sun Mar 26 01:00:00 1944 AEST isdst=0 gmtoff=36000
104
- #Australia/Melbourne Sat Oct 30 15:59:59 1971 UTC = Sun Oct 31 01:59:59 1971 AEST isdst=0 gmtoff=36000
129
+ #Australia/Melbourne Sat Mar 25 15:00:00 1944 UTC = Sun Mar 26 01:00:00 1944 EST isdst=0 gmtoff=36000
130
+ #Australia/Melbourne Sat Oct 30 15:59:59 1971 UTC = Sun Oct 31 01:59:59 1971 EST isdst=0 gmtoff=36000
105
131
 
106
132
  tz = Timezone.get('Australia/Melbourne')
107
133
  assert_equal(DateTime.new(1970,1,1,10,0,0), tz.utc_to_local(DateTime.new(1970,1,1,0,0,0)))
@@ -1,6 +1,26 @@
1
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
2
- require 'test/unit'
3
- require 'tzinfo'
1
+ #--
2
+ # Copyright (c) 2005-2013 Philip Ross
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in all
12
+ # copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ # THE SOFTWARE.
21
+ #++
22
+
23
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'test_utils')
4
24
 
5
25
  include TZInfo
6
26
 
@@ -53,50 +73,56 @@ class TCTimezoneNewYork < Test::Unit::TestCase
53
73
  end
54
74
 
55
75
  def test_1957
56
- #America/New_York Sun Apr 28 06:59:59 1957 UTC = Sun Apr 28 01:59:59 1957 EST isdst=0 gmtoff=-18000
57
- #America/New_York Sun Apr 28 07:00:00 1957 UTC = Sun Apr 28 03:00:00 1957 EDT isdst=1 gmtoff=-14400
58
- #America/New_York Sun Oct 27 05:59:59 1957 UTC = Sun Oct 27 01:59:59 1957 EDT isdst=1 gmtoff=-14400
59
- #America/New_York Sun Oct 27 06:00:00 1957 UTC = Sun Oct 27 01:00:00 1957 EST isdst=0 gmtoff=-18000
60
-
61
- tz = Timezone.get('America/New_York')
62
- assert_equal(DateTime.new(1957,4,28,1,59,59), tz.utc_to_local(DateTime.new(1957,4,28,6,59,59)))
63
- assert_equal(DateTime.new(1957,4,28,3,0,0), tz.utc_to_local(DateTime.new(1957,4,28,7,0,0)))
64
- assert_equal(DateTime.new(1957,10,27,1,59,59), tz.utc_to_local(DateTime.new(1957,10,27,5,59,59)))
65
- assert_equal(DateTime.new(1957,10,27,1,0,0), tz.utc_to_local(DateTime.new(1957,10,27,6,0,0)))
66
-
67
- assert_equal(DateTime.new(1957,4,28,6,59,59), tz.local_to_utc(DateTime.new(1957,4,28,1,59,59)))
68
- assert_equal(DateTime.new(1957,4,28,7,0,0), tz.local_to_utc(DateTime.new(1957,4,28,3,0,0)))
69
- assert_equal(DateTime.new(1957,10,27,5,59,59), tz.local_to_utc(DateTime.new(1957,10,27,1,59,59), true))
70
- assert_equal(DateTime.new(1957,10,27,6,59,59), tz.local_to_utc(DateTime.new(1957,10,27,1,59,59), false))
71
- assert_equal(DateTime.new(1957,10,27,5,0,0), tz.local_to_utc(DateTime.new(1957,10,27,1,0,0), true))
72
- assert_equal(DateTime.new(1957,10,27,6,0,0), tz.local_to_utc(DateTime.new(1957,10,27,1,0,0), false))
73
-
74
- assert_raises(PeriodNotFound) { tz.local_to_utc(DateTime.new(1957,4,28,2,0,0)) }
75
- assert_raises(AmbiguousTime) { tz.local_to_utc(DateTime.new(1957,10,27,1,0,0)) }
76
-
77
- assert_equal(:EST, tz.period_for_utc(DateTime.new(1957,4,28,6,59,59)).zone_identifier)
78
- assert_equal(:EDT, tz.period_for_utc(DateTime.new(1957,4,28,7,0,0)).zone_identifier)
79
- assert_equal(:EDT, tz.period_for_utc(DateTime.new(1957,10,27,5,59,59)).zone_identifier)
80
- assert_equal(:EST, tz.period_for_utc(DateTime.new(1957,10,27,6,0,0)).zone_identifier)
81
-
82
- assert_equal(:EST, tz.period_for_local(DateTime.new(1957,4,28,1,59,59)).zone_identifier)
83
- assert_equal(:EDT, tz.period_for_local(DateTime.new(1957,4,28,3,0,0)).zone_identifier)
84
- assert_equal(:EDT, tz.period_for_local(DateTime.new(1957,10,27,1,59,59), true).zone_identifier)
85
- assert_equal(:EST, tz.period_for_local(DateTime.new(1957,10,27,1,59,59), false).zone_identifier)
86
- assert_equal(:EDT, tz.period_for_local(DateTime.new(1957,10,27,1,0,0), true).zone_identifier)
87
- assert_equal(:EST, tz.period_for_local(DateTime.new(1957,10,27,1,0,0), false).zone_identifier)
88
-
89
- assert_equal(-18000, tz.period_for_utc(DateTime.new(1957,4,28,6,59,59)).utc_total_offset)
90
- assert_equal(-14400, tz.period_for_utc(DateTime.new(1957,4,28,7,0,0)).utc_total_offset)
91
- assert_equal(-14400, tz.period_for_utc(DateTime.new(1957,10,27,5,59,59)).utc_total_offset)
92
- assert_equal(-18000, tz.period_for_utc(DateTime.new(1957,10,27,6,0,0)).utc_total_offset)
76
+ # This test cannot be run when using ZoneinfoDataSource on platforms
77
+ # that don't support Times before the epoch (i.e. Ruby < 1.9 on Windows)
78
+ # because it relates to the year 1957.
93
79
 
94
- assert_equal(-18000, tz.period_for_local(DateTime.new(1957,4,28,1,59,59)).utc_total_offset)
95
- assert_equal(-14400, tz.period_for_local(DateTime.new(1957,4,28,3,0,0)).utc_total_offset)
96
- assert_equal(-14400, tz.period_for_local(DateTime.new(1957,10,27,1,59,59), true).utc_total_offset)
97
- assert_equal(-18000, tz.period_for_local(DateTime.new(1957,10,27,1,59,59), false).utc_total_offset)
98
- assert_equal(-14400, tz.period_for_local(DateTime.new(1957,10,27,1,0,0), true).utc_total_offset)
99
- assert_equal(-18000, tz.period_for_local(DateTime.new(1957,10,27,1,0,0), false).utc_total_offset)
80
+ if !DataSource.get.kind_of?(ZoneinfoDataSource) || RubyCoreSupport.time_supports_negative
81
+ #America/New_York Sun Apr 28 06:59:59 1957 UTC = Sun Apr 28 01:59:59 1957 EST isdst=0 gmtoff=-18000
82
+ #America/New_York Sun Apr 28 07:00:00 1957 UTC = Sun Apr 28 03:00:00 1957 EDT isdst=1 gmtoff=-14400
83
+ #America/New_York Sun Oct 27 05:59:59 1957 UTC = Sun Oct 27 01:59:59 1957 EDT isdst=1 gmtoff=-14400
84
+ #America/New_York Sun Oct 27 06:00:00 1957 UTC = Sun Oct 27 01:00:00 1957 EST isdst=0 gmtoff=-18000
85
+
86
+ tz = Timezone.get('America/New_York')
87
+ assert_equal(DateTime.new(1957,4,28,1,59,59), tz.utc_to_local(DateTime.new(1957,4,28,6,59,59)))
88
+ assert_equal(DateTime.new(1957,4,28,3,0,0), tz.utc_to_local(DateTime.new(1957,4,28,7,0,0)))
89
+ assert_equal(DateTime.new(1957,10,27,1,59,59), tz.utc_to_local(DateTime.new(1957,10,27,5,59,59)))
90
+ assert_equal(DateTime.new(1957,10,27,1,0,0), tz.utc_to_local(DateTime.new(1957,10,27,6,0,0)))
91
+
92
+ assert_equal(DateTime.new(1957,4,28,6,59,59), tz.local_to_utc(DateTime.new(1957,4,28,1,59,59)))
93
+ assert_equal(DateTime.new(1957,4,28,7,0,0), tz.local_to_utc(DateTime.new(1957,4,28,3,0,0)))
94
+ assert_equal(DateTime.new(1957,10,27,5,59,59), tz.local_to_utc(DateTime.new(1957,10,27,1,59,59), true))
95
+ assert_equal(DateTime.new(1957,10,27,6,59,59), tz.local_to_utc(DateTime.new(1957,10,27,1,59,59), false))
96
+ assert_equal(DateTime.new(1957,10,27,5,0,0), tz.local_to_utc(DateTime.new(1957,10,27,1,0,0), true))
97
+ assert_equal(DateTime.new(1957,10,27,6,0,0), tz.local_to_utc(DateTime.new(1957,10,27,1,0,0), false))
98
+
99
+ assert_raises(PeriodNotFound) { tz.local_to_utc(DateTime.new(1957,4,28,2,0,0)) }
100
+ assert_raises(AmbiguousTime) { tz.local_to_utc(DateTime.new(1957,10,27,1,0,0)) }
101
+
102
+ assert_equal(:EST, tz.period_for_utc(DateTime.new(1957,4,28,6,59,59)).zone_identifier)
103
+ assert_equal(:EDT, tz.period_for_utc(DateTime.new(1957,4,28,7,0,0)).zone_identifier)
104
+ assert_equal(:EDT, tz.period_for_utc(DateTime.new(1957,10,27,5,59,59)).zone_identifier)
105
+ assert_equal(:EST, tz.period_for_utc(DateTime.new(1957,10,27,6,0,0)).zone_identifier)
106
+
107
+ assert_equal(:EST, tz.period_for_local(DateTime.new(1957,4,28,1,59,59)).zone_identifier)
108
+ assert_equal(:EDT, tz.period_for_local(DateTime.new(1957,4,28,3,0,0)).zone_identifier)
109
+ assert_equal(:EDT, tz.period_for_local(DateTime.new(1957,10,27,1,59,59), true).zone_identifier)
110
+ assert_equal(:EST, tz.period_for_local(DateTime.new(1957,10,27,1,59,59), false).zone_identifier)
111
+ assert_equal(:EDT, tz.period_for_local(DateTime.new(1957,10,27,1,0,0), true).zone_identifier)
112
+ assert_equal(:EST, tz.period_for_local(DateTime.new(1957,10,27,1,0,0), false).zone_identifier)
113
+
114
+ assert_equal(-18000, tz.period_for_utc(DateTime.new(1957,4,28,6,59,59)).utc_total_offset)
115
+ assert_equal(-14400, tz.period_for_utc(DateTime.new(1957,4,28,7,0,0)).utc_total_offset)
116
+ assert_equal(-14400, tz.period_for_utc(DateTime.new(1957,10,27,5,59,59)).utc_total_offset)
117
+ assert_equal(-18000, tz.period_for_utc(DateTime.new(1957,10,27,6,0,0)).utc_total_offset)
118
+
119
+ assert_equal(-18000, tz.period_for_local(DateTime.new(1957,4,28,1,59,59)).utc_total_offset)
120
+ assert_equal(-14400, tz.period_for_local(DateTime.new(1957,4,28,3,0,0)).utc_total_offset)
121
+ assert_equal(-14400, tz.period_for_local(DateTime.new(1957,10,27,1,59,59), true).utc_total_offset)
122
+ assert_equal(-18000, tz.period_for_local(DateTime.new(1957,10,27,1,59,59), false).utc_total_offset)
123
+ assert_equal(-14400, tz.period_for_local(DateTime.new(1957,10,27,1,0,0), true).utc_total_offset)
124
+ assert_equal(-18000, tz.period_for_local(DateTime.new(1957,10,27,1,0,0), false).utc_total_offset)
125
+ end
100
126
  end
101
127
 
102
128
  def test_time_boundary
@@ -111,4 +137,4 @@ class TCTimezoneNewYork < Test::Unit::TestCase
111
137
  assert_equal(0, tz.utc_to_local(18000))
112
138
  assert_equal(18000, tz.local_to_utc(0))
113
139
  end
114
- end
140
+ end
@@ -1,6 +1,26 @@
1
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
2
- require 'test/unit'
3
- require 'tzinfo'
1
+ #--
2
+ # Copyright (c) 2006-2013 Philip Ross
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in all
12
+ # copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ # THE SOFTWARE.
21
+ #++
22
+
23
+ require File.join(File.expand_path(File.dirname(__FILE__)), 'test_utils')
4
24
 
5
25
  include TZInfo
6
26
 
@@ -52,13 +72,19 @@ class TCTimezoneOffsetInfo < Test::Unit::TestCase
52
72
 
53
73
  assert_equal(1148949080, o1.to_local(1148931080))
54
74
  assert_equal(Time.utc(2006, 5, 30, 0, 31, 20), o1.to_local(Time.utc(2006, 5, 29, 19, 31, 20)))
75
+ assert_equal(Time.utc(2006, 5, 30, 0, 31, 20, 782000), o1.to_local(Time.utc(2006, 5, 29, 19, 31, 20, 782000)))
55
76
  assert_equal(DateTime.new(2006, 5, 30, 0, 31, 20), o1.to_local(DateTime.new(2006, 5, 29, 19, 31, 20)))
77
+ assert_equal(DateTime.new(2006, 5, 30, 0, 31, 20 + Rational(782, 1000)), o1.to_local(DateTime.new(2006, 5, 29, 19, 31, 20 + Rational(782, 1000))))
78
+ assert_equal(1148949080, o1.to_local(1148931080))
56
79
  assert(TimeOrDateTime.new(1148949080).eql?(o1.to_local(TimeOrDateTime.new(1148931080))))
57
80
 
58
81
  assert_equal(1148931080, o2.to_local(1148931080))
59
82
  assert_equal(Time.utc(2006, 5, 29, 19, 31, 20), o2.to_local(Time.utc(2006, 5, 29, 19, 31, 20)))
83
+ assert_equal(Time.utc(2006, 5, 29, 19, 31, 20, 123000), o2.to_local(Time.utc(2006, 5, 29, 19, 31, 20, 123000)))
60
84
  assert_equal(DateTime.new(2006, 5, 29, 19, 31, 20), o2.to_local(DateTime.new(2006, 5, 29, 19, 31, 20)))
61
- assert(TimeOrDateTime.new(1148931080).eql?(o2.to_local(TimeOrDateTime.new(1148931080))))
85
+ assert_equal(DateTime.new(2006, 5, 29, 19, 31, 20 + Rational(123, 1000)), o2.to_local(DateTime.new(2006, 5, 29, 19, 31, 20 + Rational(123, 1000))))
86
+ assert_equal(1148931080, o2.to_local(1148931080))
87
+ assert(TimeOrDateTime.new(1148931080).eql?(o2.to_local(TimeOrDateTime.new(1148931080))))
62
88
  end
63
89
 
64
90
  def test_to_utc
@@ -67,12 +93,18 @@ class TCTimezoneOffsetInfo < Test::Unit::TestCase
67
93
 
68
94
  assert_equal(1148913080, o1.to_utc(1148931080))
69
95
  assert_equal(Time.utc(2006, 5, 29, 14, 31, 20), o1.to_utc(Time.utc(2006, 5, 29, 19, 31, 20)))
96
+ assert_equal(Time.utc(2006, 5, 29, 14, 31, 20, 913000), o1.to_utc(Time.utc(2006, 5, 29, 19, 31, 20, 913000)))
70
97
  assert_equal(DateTime.new(2006, 5, 29, 14, 31, 20), o1.to_utc(DateTime.new(2006, 5, 29, 19, 31, 20)))
98
+ assert_equal(DateTime.new(2006, 5, 29, 14, 31, 20 + Rational(913,1000)), o1.to_utc(DateTime.new(2006, 5, 29, 19, 31, 20 + Rational(913,1000))))
99
+ assert_equal(1148913080, o1.to_utc(1148931080))
71
100
  assert(TimeOrDateTime.new(1148913080).eql?(o1.to_utc(TimeOrDateTime.new(1148931080))))
72
101
 
73
102
  assert_equal(1148931080, o2.to_local(1148931080))
74
103
  assert_equal(Time.utc(2006, 5, 29, 19, 31, 20), o2.to_local(Time.utc(2006, 5, 29, 19, 31, 20)))
104
+ assert_equal(Time.utc(2006, 5, 29, 19, 31, 20, 323000), o2.to_local(Time.utc(2006, 5, 29, 19, 31, 20, 323000)))
75
105
  assert_equal(DateTime.new(2006, 5, 29, 19, 31, 20), o2.to_local(DateTime.new(2006, 5, 29, 19, 31, 20)))
106
+ assert_equal(DateTime.new(2006, 5, 29, 19, 31, 20 + Rational(323, 1000)), o2.to_local(DateTime.new(2006, 5, 29, 19, 31, 20 + Rational(323, 1000))))
107
+ assert_equal(1148931080, o2.to_utc(1148931080))
76
108
  assert(TimeOrDateTime.new(1148931080).eql?(o2.to_local(TimeOrDateTime.new(1148931080))))
77
109
  end
78
110