tzinfo-data 1.2016.3 → 1.2020.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (606) hide show
  1. checksums.yaml +5 -5
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/LICENSE +13 -13
  5. data/README.md +7 -7
  6. data/lib/tzinfo/data/definitions/Africa/Abidjan.rb +1 -1
  7. data/lib/tzinfo/data/definitions/Africa/Accra.rb +2 -2
  8. data/lib/tzinfo/data/definitions/Africa/Addis_Ababa.rb +1 -1
  9. data/lib/tzinfo/data/definitions/Africa/Algiers.rb +2 -2
  10. data/lib/tzinfo/data/definitions/Africa/Asmara.rb +1 -1
  11. data/lib/tzinfo/data/definitions/Africa/Asmera.rb +1 -1
  12. data/lib/tzinfo/data/definitions/Africa/Bamako.rb +1 -1
  13. data/lib/tzinfo/data/definitions/Africa/Bangui.rb +1 -1
  14. data/lib/tzinfo/data/definitions/Africa/Banjul.rb +1 -1
  15. data/lib/tzinfo/data/definitions/Africa/Bissau.rb +3 -3
  16. data/lib/tzinfo/data/definitions/Africa/Blantyre.rb +1 -1
  17. data/lib/tzinfo/data/definitions/Africa/Brazzaville.rb +1 -1
  18. data/lib/tzinfo/data/definitions/Africa/Bujumbura.rb +1 -1
  19. data/lib/tzinfo/data/definitions/Africa/Cairo.rb +1 -1
  20. data/lib/tzinfo/data/definitions/Africa/Casablanca.rb +114 -107
  21. data/lib/tzinfo/data/definitions/Africa/Ceuta.rb +15 -7
  22. data/lib/tzinfo/data/definitions/Africa/Conakry.rb +1 -1
  23. data/lib/tzinfo/data/definitions/Africa/Dakar.rb +1 -1
  24. data/lib/tzinfo/data/definitions/Africa/Dar_es_Salaam.rb +1 -1
  25. data/lib/tzinfo/data/definitions/Africa/Djibouti.rb +1 -1
  26. data/lib/tzinfo/data/definitions/Africa/Douala.rb +1 -1
  27. data/lib/tzinfo/data/definitions/Africa/El_Aaiun.rb +115 -107
  28. data/lib/tzinfo/data/definitions/Africa/Freetown.rb +1 -1
  29. data/lib/tzinfo/data/definitions/Africa/Gaborone.rb +1 -1
  30. data/lib/tzinfo/data/definitions/Africa/Harare.rb +1 -1
  31. data/lib/tzinfo/data/definitions/Africa/Johannesburg.rb +1 -1
  32. data/lib/tzinfo/data/definitions/Africa/Juba.rb +42 -2
  33. data/lib/tzinfo/data/definitions/Africa/Kampala.rb +1 -1
  34. data/lib/tzinfo/data/definitions/Africa/Khartoum.rb +2 -1
  35. data/lib/tzinfo/data/definitions/Africa/Kigali.rb +1 -1
  36. data/lib/tzinfo/data/definitions/Africa/Kinshasa.rb +1 -1
  37. data/lib/tzinfo/data/definitions/Africa/Lagos.rb +1 -1
  38. data/lib/tzinfo/data/definitions/Africa/Libreville.rb +1 -1
  39. data/lib/tzinfo/data/definitions/Africa/Lome.rb +1 -1
  40. data/lib/tzinfo/data/definitions/Africa/Luanda.rb +1 -1
  41. data/lib/tzinfo/data/definitions/Africa/Lubumbashi.rb +1 -1
  42. data/lib/tzinfo/data/definitions/Africa/Lusaka.rb +1 -1
  43. data/lib/tzinfo/data/definitions/Africa/Malabo.rb +1 -1
  44. data/lib/tzinfo/data/definitions/Africa/Maputo.rb +1 -1
  45. data/lib/tzinfo/data/definitions/Africa/Maseru.rb +1 -1
  46. data/lib/tzinfo/data/definitions/Africa/Mbabane.rb +1 -1
  47. data/lib/tzinfo/data/definitions/Africa/Mogadishu.rb +1 -1
  48. data/lib/tzinfo/data/definitions/Africa/Monrovia.rb +3 -3
  49. data/lib/tzinfo/data/definitions/Africa/Nairobi.rb +3 -3
  50. data/lib/tzinfo/data/definitions/Africa/Ndjamena.rb +1 -1
  51. data/lib/tzinfo/data/definitions/Africa/Niamey.rb +1 -1
  52. data/lib/tzinfo/data/definitions/Africa/Nouakchott.rb +1 -1
  53. data/lib/tzinfo/data/definitions/Africa/Ouagadougou.rb +1 -1
  54. data/lib/tzinfo/data/definitions/Africa/Porto__m__Novo.rb +1 -1
  55. data/lib/tzinfo/data/definitions/Africa/Sao_Tome.rb +12 -2
  56. data/lib/tzinfo/data/definitions/Africa/Timbuktu.rb +1 -1
  57. data/lib/tzinfo/data/definitions/Africa/Tripoli.rb +1 -1
  58. data/lib/tzinfo/data/definitions/Africa/Tunis.rb +1 -1
  59. data/lib/tzinfo/data/definitions/Africa/Windhoek.rb +28 -126
  60. data/lib/tzinfo/data/definitions/America/Adak.rb +11 -3
  61. data/lib/tzinfo/data/definitions/America/Anchorage.rb +13 -5
  62. data/lib/tzinfo/data/definitions/America/Anguilla.rb +1 -1
  63. data/lib/tzinfo/data/definitions/America/Antigua.rb +1 -1
  64. data/lib/tzinfo/data/definitions/America/Araguaina.rb +3 -3
  65. data/lib/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb +5 -5
  66. data/lib/tzinfo/data/definitions/America/Argentina/Catamarca.rb +7 -8
  67. data/lib/tzinfo/data/definitions/America/Argentina/ComodRivadavia.rb +1 -1
  68. data/lib/tzinfo/data/definitions/America/Argentina/Cordoba.rb +6 -7
  69. data/lib/tzinfo/data/definitions/America/Argentina/Jujuy.rb +8 -10
  70. data/lib/tzinfo/data/definitions/America/Argentina/La_Rioja.rb +7 -8
  71. data/lib/tzinfo/data/definitions/America/Argentina/Mendoza.rb +11 -13
  72. data/lib/tzinfo/data/definitions/America/Argentina/Rio_Gallegos.rb +6 -7
  73. data/lib/tzinfo/data/definitions/America/Argentina/Salta.rb +6 -7
  74. data/lib/tzinfo/data/definitions/America/Argentina/San_Juan.rb +7 -8
  75. data/lib/tzinfo/data/definitions/America/Argentina/San_Luis.rb +14 -16
  76. data/lib/tzinfo/data/definitions/America/Argentina/Tucuman.rb +7 -8
  77. data/lib/tzinfo/data/definitions/America/Argentina/Ushuaia.rb +6 -7
  78. data/lib/tzinfo/data/definitions/America/Aruba.rb +1 -1
  79. data/lib/tzinfo/data/definitions/America/Asuncion.rb +12 -4
  80. data/lib/tzinfo/data/definitions/America/Atikokan.rb +1 -1
  81. data/lib/tzinfo/data/definitions/America/Atka.rb +1 -1
  82. data/lib/tzinfo/data/definitions/America/Bahia.rb +3 -3
  83. data/lib/tzinfo/data/definitions/America/Bahia_Banderas.rb +9 -1
  84. data/lib/tzinfo/data/definitions/America/Barbados.rb +1 -1
  85. data/lib/tzinfo/data/definitions/America/Belem.rb +3 -3
  86. data/lib/tzinfo/data/definitions/America/Belize.rb +2 -2
  87. data/lib/tzinfo/data/definitions/America/Blanc__m__Sablon.rb +1 -1
  88. data/lib/tzinfo/data/definitions/America/Boa_Vista.rb +3 -3
  89. data/lib/tzinfo/data/definitions/America/Bogota.rb +3 -3
  90. data/lib/tzinfo/data/definitions/America/Boise.rb +9 -1
  91. data/lib/tzinfo/data/definitions/America/Buenos_Aires.rb +1 -1
  92. data/lib/tzinfo/data/definitions/America/Cambridge_Bay.rb +10 -2
  93. data/lib/tzinfo/data/definitions/America/Campo_Grande.rb +4 -98
  94. data/lib/tzinfo/data/definitions/America/Cancun.rb +1 -1
  95. data/lib/tzinfo/data/definitions/America/Caracas.rb +4 -3
  96. data/lib/tzinfo/data/definitions/America/Catamarca.rb +1 -1
  97. data/lib/tzinfo/data/definitions/America/Cayenne.rb +3 -3
  98. data/lib/tzinfo/data/definitions/America/Cayman.rb +1 -1
  99. data/lib/tzinfo/data/definitions/America/Chicago.rb +9 -1
  100. data/lib/tzinfo/data/definitions/America/Chihuahua.rb +9 -1
  101. data/lib/tzinfo/data/definitions/America/Coral_Harbour.rb +1 -1
  102. data/lib/tzinfo/data/definitions/America/Cordoba.rb +1 -1
  103. data/lib/tzinfo/data/definitions/America/Costa_Rica.rb +1 -1
  104. data/lib/tzinfo/data/definitions/America/Creston.rb +1 -1
  105. data/lib/tzinfo/data/definitions/America/Cuiaba.rb +4 -98
  106. data/lib/tzinfo/data/definitions/America/Curacao.rb +2 -2
  107. data/lib/tzinfo/data/definitions/America/Danmarkshavn.rb +3 -3
  108. data/lib/tzinfo/data/definitions/America/Dawson.rb +3 -94
  109. data/lib/tzinfo/data/definitions/America/Dawson_Creek.rb +1 -1
  110. data/lib/tzinfo/data/definitions/America/Denver.rb +9 -1
  111. data/lib/tzinfo/data/definitions/America/Detroit.rb +12 -2
  112. data/lib/tzinfo/data/definitions/America/Dominica.rb +1 -1
  113. data/lib/tzinfo/data/definitions/America/Edmonton.rb +9 -5
  114. data/lib/tzinfo/data/definitions/America/Eirunepe.rb +4 -4
  115. data/lib/tzinfo/data/definitions/America/El_Salvador.rb +1 -1
  116. data/lib/tzinfo/data/definitions/America/Ensenada.rb +1 -1
  117. data/lib/tzinfo/data/definitions/America/Fort_Nelson.rb +1 -1
  118. data/lib/tzinfo/data/definitions/America/Fort_Wayne.rb +1 -1
  119. data/lib/tzinfo/data/definitions/America/Fortaleza.rb +3 -3
  120. data/lib/tzinfo/data/definitions/America/Glace_Bay.rb +9 -1
  121. data/lib/tzinfo/data/definitions/America/Godthab.rb +2 -182
  122. data/lib/tzinfo/data/definitions/America/Goose_Bay.rb +9 -1
  123. data/lib/tzinfo/data/definitions/America/Grand_Turk.rb +109 -3
  124. data/lib/tzinfo/data/definitions/America/Grenada.rb +1 -1
  125. data/lib/tzinfo/data/definitions/America/Guadeloupe.rb +1 -1
  126. data/lib/tzinfo/data/definitions/America/Guatemala.rb +1 -1
  127. data/lib/tzinfo/data/definitions/America/Guayaquil.rb +5 -2
  128. data/lib/tzinfo/data/definitions/America/Guyana.rb +6 -8
  129. data/lib/tzinfo/data/definitions/America/Halifax.rb +9 -1
  130. data/lib/tzinfo/data/definitions/America/Havana.rb +9 -1
  131. data/lib/tzinfo/data/definitions/America/Hermosillo.rb +1 -1
  132. data/lib/tzinfo/data/definitions/America/Indiana/Indianapolis.rb +9 -1
  133. data/lib/tzinfo/data/definitions/America/Indiana/Knox.rb +9 -1
  134. data/lib/tzinfo/data/definitions/America/Indiana/Marengo.rb +9 -1
  135. data/lib/tzinfo/data/definitions/America/Indiana/Petersburg.rb +9 -1
  136. data/lib/tzinfo/data/definitions/America/Indiana/Tell_City.rb +15 -10
  137. data/lib/tzinfo/data/definitions/America/Indiana/Vevay.rb +9 -1
  138. data/lib/tzinfo/data/definitions/America/Indiana/Vincennes.rb +9 -1
  139. data/lib/tzinfo/data/definitions/America/Indiana/Winamac.rb +9 -1
  140. data/lib/tzinfo/data/definitions/America/Indianapolis.rb +1 -1
  141. data/lib/tzinfo/data/definitions/America/Inuvik.rb +10 -2
  142. data/lib/tzinfo/data/definitions/America/Iqaluit.rb +10 -2
  143. data/lib/tzinfo/data/definitions/America/Jamaica.rb +5 -5
  144. data/lib/tzinfo/data/definitions/America/Jujuy.rb +1 -1
  145. data/lib/tzinfo/data/definitions/America/Juneau.rb +10 -2
  146. data/lib/tzinfo/data/definitions/America/Kentucky/Louisville.rb +11 -3
  147. data/lib/tzinfo/data/definitions/America/Kentucky/Monticello.rb +9 -1
  148. data/lib/tzinfo/data/definitions/America/Knox_IN.rb +1 -1
  149. data/lib/tzinfo/data/definitions/America/Kralendijk.rb +1 -1
  150. data/lib/tzinfo/data/definitions/America/La_Paz.rb +3 -3
  151. data/lib/tzinfo/data/definitions/America/Lima.rb +3 -3
  152. data/lib/tzinfo/data/definitions/America/Los_Angeles.rb +27 -19
  153. data/lib/tzinfo/data/definitions/America/Louisville.rb +1 -1
  154. data/lib/tzinfo/data/definitions/America/Lower_Princes.rb +1 -1
  155. data/lib/tzinfo/data/definitions/America/Maceio.rb +3 -3
  156. data/lib/tzinfo/data/definitions/America/Managua.rb +1 -1
  157. data/lib/tzinfo/data/definitions/America/Manaus.rb +3 -3
  158. data/lib/tzinfo/data/definitions/America/Marigot.rb +1 -1
  159. data/lib/tzinfo/data/definitions/America/Martinique.rb +1 -1
  160. data/lib/tzinfo/data/definitions/America/Matamoros.rb +9 -1
  161. data/lib/tzinfo/data/definitions/America/Mazatlan.rb +9 -1
  162. data/lib/tzinfo/data/definitions/America/Mendoza.rb +1 -1
  163. data/lib/tzinfo/data/definitions/America/Menominee.rb +9 -1
  164. data/lib/tzinfo/data/definitions/America/Merida.rb +9 -1
  165. data/lib/tzinfo/data/definitions/America/Metlakatla.rb +12 -3
  166. data/lib/tzinfo/data/definitions/America/Mexico_City.rb +9 -1
  167. data/lib/tzinfo/data/definitions/America/Miquelon.rb +11 -3
  168. data/lib/tzinfo/data/definitions/America/Moncton.rb +9 -1
  169. data/lib/tzinfo/data/definitions/America/Monterrey.rb +9 -1
  170. data/lib/tzinfo/data/definitions/America/Montevideo.rb +87 -86
  171. data/lib/tzinfo/data/definitions/America/Montreal.rb +1 -1
  172. data/lib/tzinfo/data/definitions/America/Montserrat.rb +1 -1
  173. data/lib/tzinfo/data/definitions/America/Nassau.rb +9 -1
  174. data/lib/tzinfo/data/definitions/America/New_York.rb +9 -1
  175. data/lib/tzinfo/data/definitions/America/Nipigon.rb +9 -1
  176. data/lib/tzinfo/data/definitions/America/Nome.rb +11 -3
  177. data/lib/tzinfo/data/definitions/America/Noronha.rb +3 -3
  178. data/lib/tzinfo/data/definitions/America/North_Dakota/Beulah.rb +9 -1
  179. data/lib/tzinfo/data/definitions/America/North_Dakota/Center.rb +9 -1
  180. data/lib/tzinfo/data/definitions/America/North_Dakota/New_Salem.rb +9 -1
  181. data/lib/tzinfo/data/definitions/America/Nuuk.rb +206 -0
  182. data/lib/tzinfo/data/definitions/America/Ojinaga.rb +9 -1
  183. data/lib/tzinfo/data/definitions/America/Panama.rb +1 -1
  184. data/lib/tzinfo/data/definitions/America/Pangnirtung.rb +10 -2
  185. data/lib/tzinfo/data/definitions/America/Paramaribo.rb +4 -6
  186. data/lib/tzinfo/data/definitions/America/Phoenix.rb +1 -1
  187. data/lib/tzinfo/data/definitions/America/Port__m__au__m__Prince.rb +109 -1
  188. data/lib/tzinfo/data/definitions/America/Port_of_Spain.rb +1 -1
  189. data/lib/tzinfo/data/definitions/America/Porto_Acre.rb +1 -1
  190. data/lib/tzinfo/data/definitions/America/Porto_Velho.rb +3 -3
  191. data/lib/tzinfo/data/definitions/America/Puerto_Rico.rb +1 -1
  192. data/lib/tzinfo/data/definitions/America/Punta_Arenas.rb +143 -0
  193. data/lib/tzinfo/data/definitions/America/Rainy_River.rb +9 -1
  194. data/lib/tzinfo/data/definitions/America/Rankin_Inlet.rb +10 -2
  195. data/lib/tzinfo/data/definitions/America/Recife.rb +3 -3
  196. data/lib/tzinfo/data/definitions/America/Regina.rb +1 -1
  197. data/lib/tzinfo/data/definitions/America/Resolute.rb +10 -2
  198. data/lib/tzinfo/data/definitions/America/Rio_Branco.rb +4 -4
  199. data/lib/tzinfo/data/definitions/America/Rosario.rb +1 -1
  200. data/lib/tzinfo/data/definitions/America/Santa_Isabel.rb +1 -1
  201. data/lib/tzinfo/data/definitions/America/Santarem.rb +4 -4
  202. data/lib/tzinfo/data/definitions/America/Santiago.rb +108 -100
  203. data/lib/tzinfo/data/definitions/America/Santo_Domingo.rb +2 -2
  204. data/lib/tzinfo/data/definitions/America/Sao_Paulo.rb +4 -98
  205. data/lib/tzinfo/data/definitions/America/Scoresbysund.rb +13 -5
  206. data/lib/tzinfo/data/definitions/America/Shiprock.rb +1 -1
  207. data/lib/tzinfo/data/definitions/America/Sitka.rb +10 -2
  208. data/lib/tzinfo/data/definitions/America/St_Barthelemy.rb +1 -1
  209. data/lib/tzinfo/data/definitions/America/St_Johns.rb +9 -1
  210. data/lib/tzinfo/data/definitions/America/St_Kitts.rb +1 -1
  211. data/lib/tzinfo/data/definitions/America/St_Lucia.rb +1 -1
  212. data/lib/tzinfo/data/definitions/America/St_Thomas.rb +1 -1
  213. data/lib/tzinfo/data/definitions/America/St_Vincent.rb +1 -1
  214. data/lib/tzinfo/data/definitions/America/Swift_Current.rb +1 -1
  215. data/lib/tzinfo/data/definitions/America/Tegucigalpa.rb +1 -1
  216. data/lib/tzinfo/data/definitions/America/Thule.rb +9 -1
  217. data/lib/tzinfo/data/definitions/America/Thunder_Bay.rb +9 -1
  218. data/lib/tzinfo/data/definitions/America/Tijuana.rb +16 -8
  219. data/lib/tzinfo/data/definitions/America/Toronto.rb +9 -1
  220. data/lib/tzinfo/data/definitions/America/Tortola.rb +1 -1
  221. data/lib/tzinfo/data/definitions/America/Vancouver.rb +10 -2
  222. data/lib/tzinfo/data/definitions/America/Virgin.rb +1 -1
  223. data/lib/tzinfo/data/definitions/America/Whitehorse.rb +3 -94
  224. data/lib/tzinfo/data/definitions/America/Winnipeg.rb +9 -1
  225. data/lib/tzinfo/data/definitions/America/Yakutat.rb +10 -2
  226. data/lib/tzinfo/data/definitions/America/Yellowknife.rb +10 -2
  227. data/lib/tzinfo/data/definitions/Antarctica/Casey.rb +11 -4
  228. data/lib/tzinfo/data/definitions/Antarctica/Davis.rb +4 -4
  229. data/lib/tzinfo/data/definitions/Antarctica/DumontDUrville.rb +4 -5
  230. data/lib/tzinfo/data/definitions/Antarctica/Macquarie.rb +121 -4
  231. data/lib/tzinfo/data/definitions/Antarctica/Mawson.rb +4 -4
  232. data/lib/tzinfo/data/definitions/Antarctica/McMurdo.rb +1 -1
  233. data/lib/tzinfo/data/definitions/Antarctica/Palmer.rb +75 -175
  234. data/lib/tzinfo/data/definitions/Antarctica/Rothera.rb +3 -3
  235. data/lib/tzinfo/data/definitions/Antarctica/South_Pole.rb +1 -1
  236. data/lib/tzinfo/data/definitions/Antarctica/Syowa.rb +3 -3
  237. data/lib/tzinfo/data/definitions/Antarctica/Troll.rb +12 -4
  238. data/lib/tzinfo/data/definitions/Antarctica/Vostok.rb +3 -3
  239. data/lib/tzinfo/data/definitions/Arctic/Longyearbyen.rb +1 -1
  240. data/lib/tzinfo/data/definitions/Asia/Aden.rb +1 -1
  241. data/lib/tzinfo/data/definitions/Asia/Almaty.rb +10 -6
  242. data/lib/tzinfo/data/definitions/Asia/Amman.rb +9 -1
  243. data/lib/tzinfo/data/definitions/Asia/Anadyr.rb +9 -9
  244. data/lib/tzinfo/data/definitions/Asia/Aqtau.rb +54 -58
  245. data/lib/tzinfo/data/definitions/Asia/Aqtobe.rb +35 -34
  246. data/lib/tzinfo/data/definitions/Asia/Ashgabat.rb +6 -9
  247. data/lib/tzinfo/data/definitions/Asia/Ashkhabad.rb +1 -1
  248. data/lib/tzinfo/data/definitions/Asia/Atyrau.rb +77 -0
  249. data/lib/tzinfo/data/definitions/Asia/Baghdad.rb +3 -3
  250. data/lib/tzinfo/data/definitions/Asia/Bahrain.rb +1 -1
  251. data/lib/tzinfo/data/definitions/Asia/Baku.rb +48 -53
  252. data/lib/tzinfo/data/definitions/Asia/Bangkok.rb +2 -2
  253. data/lib/tzinfo/data/definitions/Asia/Barnaul.rb +3 -3
  254. data/lib/tzinfo/data/definitions/Asia/Beirut.rb +9 -1
  255. data/lib/tzinfo/data/definitions/Asia/Bishkek.rb +34 -37
  256. data/lib/tzinfo/data/definitions/Asia/Brunei.rb +3 -3
  257. data/lib/tzinfo/data/definitions/Asia/Calcutta.rb +1 -1
  258. data/lib/tzinfo/data/definitions/Asia/Chita.rb +9 -10
  259. data/lib/tzinfo/data/definitions/Asia/Choibalsan.rb +11 -112
  260. data/lib/tzinfo/data/definitions/Asia/Chongqing.rb +1 -1
  261. data/lib/tzinfo/data/definitions/Asia/Chungking.rb +1 -1
  262. data/lib/tzinfo/data/definitions/Asia/Colombo.rb +6 -6
  263. data/lib/tzinfo/data/definitions/Asia/Dacca.rb +1 -1
  264. data/lib/tzinfo/data/definitions/Asia/Damascus.rb +9 -1
  265. data/lib/tzinfo/data/definitions/Asia/Dhaka.rb +7 -9
  266. data/lib/tzinfo/data/definitions/Asia/Dili.rb +5 -8
  267. data/lib/tzinfo/data/definitions/Asia/Dubai.rb +2 -2
  268. data/lib/tzinfo/data/definitions/Asia/Dushanbe.rb +6 -7
  269. data/lib/tzinfo/data/definitions/Asia/Famagusta.rb +216 -0
  270. data/lib/tzinfo/data/definitions/Asia/Gaza.rb +177 -166
  271. data/lib/tzinfo/data/definitions/Asia/Harbin.rb +1 -1
  272. data/lib/tzinfo/data/definitions/Asia/Hebron.rb +178 -167
  273. data/lib/tzinfo/data/definitions/Asia/Ho_Chi_Minh.rb +4 -4
  274. data/lib/tzinfo/data/definitions/Asia/Hong_Kong.rb +16 -15
  275. data/lib/tzinfo/data/definitions/Asia/Hovd.rb +4 -104
  276. data/lib/tzinfo/data/definitions/Asia/Irkutsk.rb +8 -8
  277. data/lib/tzinfo/data/definitions/Asia/Istanbul.rb +1 -1
  278. data/lib/tzinfo/data/definitions/Asia/Jakarta.rb +5 -5
  279. data/lib/tzinfo/data/definitions/Asia/Jayapura.rb +5 -4
  280. data/lib/tzinfo/data/definitions/Asia/Jerusalem.rb +13 -1
  281. data/lib/tzinfo/data/definitions/Asia/Kabul.rb +3 -3
  282. data/lib/tzinfo/data/definitions/Asia/Kamchatka.rb +7 -7
  283. data/lib/tzinfo/data/definitions/Asia/Karachi.rb +4 -4
  284. data/lib/tzinfo/data/definitions/Asia/Kashgar.rb +1 -1
  285. data/lib/tzinfo/data/definitions/Asia/Kathmandu.rb +3 -3
  286. data/lib/tzinfo/data/definitions/Asia/Katmandu.rb +1 -1
  287. data/lib/tzinfo/data/definitions/Asia/Khandyga.rb +11 -12
  288. data/lib/tzinfo/data/definitions/Asia/Kolkata.rb +7 -5
  289. data/lib/tzinfo/data/definitions/Asia/Krasnoyarsk.rb +8 -8
  290. data/lib/tzinfo/data/definitions/Asia/Kuala_Lumpur.rb +7 -7
  291. data/lib/tzinfo/data/definitions/Asia/Kuching.rb +5 -7
  292. data/lib/tzinfo/data/definitions/Asia/Kuwait.rb +1 -1
  293. data/lib/tzinfo/data/definitions/Asia/Macao.rb +1 -1
  294. data/lib/tzinfo/data/definitions/Asia/Macau.rb +65 -35
  295. data/lib/tzinfo/data/definitions/Asia/Magadan.rb +9 -8
  296. data/lib/tzinfo/data/definitions/Asia/Makassar.rb +5 -4
  297. data/lib/tzinfo/data/definitions/Asia/Manila.rb +3 -3
  298. data/lib/tzinfo/data/definitions/Asia/Muscat.rb +1 -1
  299. data/lib/tzinfo/data/definitions/Asia/Nicosia.rb +9 -1
  300. data/lib/tzinfo/data/definitions/Asia/Novokuznetsk.rb +10 -14
  301. data/lib/tzinfo/data/definitions/Asia/Novosibirsk.rb +8 -7
  302. data/lib/tzinfo/data/definitions/Asia/Omsk.rb +8 -8
  303. data/lib/tzinfo/data/definitions/Asia/Oral.rb +28 -29
  304. data/lib/tzinfo/data/definitions/Asia/Phnom_Penh.rb +1 -1
  305. data/lib/tzinfo/data/definitions/Asia/Pontianak.rb +4 -4
  306. data/lib/tzinfo/data/definitions/Asia/Pyongyang.rb +5 -6
  307. data/lib/tzinfo/data/definitions/Asia/Qatar.rb +3 -3
  308. data/lib/tzinfo/data/definitions/Asia/Qostanay.rb +77 -0
  309. data/lib/tzinfo/data/definitions/Asia/Qyzylorda.rb +36 -36
  310. data/lib/tzinfo/data/definitions/Asia/Rangoon.rb +2 -13
  311. data/lib/tzinfo/data/definitions/Asia/Riyadh.rb +2 -2
  312. data/lib/tzinfo/data/definitions/Asia/Saigon.rb +1 -1
  313. data/lib/tzinfo/data/definitions/Asia/Sakhalin.rb +71 -73
  314. data/lib/tzinfo/data/definitions/Asia/Samarkand.rb +6 -9
  315. data/lib/tzinfo/data/definitions/Asia/Seoul.rb +18 -12
  316. data/lib/tzinfo/data/definitions/Asia/Shanghai.rb +29 -17
  317. data/lib/tzinfo/data/definitions/Asia/Singapore.rb +8 -10
  318. data/lib/tzinfo/data/definitions/Asia/Srednekolymsk.rb +9 -10
  319. data/lib/tzinfo/data/definitions/Asia/Taipei.rb +42 -43
  320. data/lib/tzinfo/data/definitions/Asia/Tashkent.rb +6 -9
  321. data/lib/tzinfo/data/definitions/Asia/Tbilisi.rb +33 -38
  322. data/lib/tzinfo/data/definitions/Asia/Tehran.rb +39 -31
  323. data/lib/tzinfo/data/definitions/Asia/Tel_Aviv.rb +1 -1
  324. data/lib/tzinfo/data/definitions/Asia/Thimbu.rb +1 -1
  325. data/lib/tzinfo/data/definitions/Asia/Thimphu.rb +3 -3
  326. data/lib/tzinfo/data/definitions/Asia/Tokyo.rb +10 -13
  327. data/lib/tzinfo/data/definitions/Asia/Tomsk.rb +92 -0
  328. data/lib/tzinfo/data/definitions/Asia/Ujung_Pandang.rb +1 -1
  329. data/lib/tzinfo/data/definitions/Asia/Ulaanbaatar.rb +4 -104
  330. data/lib/tzinfo/data/definitions/Asia/Ulan_Bator.rb +1 -1
  331. data/lib/tzinfo/data/definitions/Asia/Urumqi.rb +2 -2
  332. data/lib/tzinfo/data/definitions/Asia/Ust__m__Nera.rb +12 -14
  333. data/lib/tzinfo/data/definitions/Asia/Vientiane.rb +1 -1
  334. data/lib/tzinfo/data/definitions/Asia/Vladivostok.rb +8 -8
  335. data/lib/tzinfo/data/definitions/Asia/Yakutsk.rb +8 -8
  336. data/lib/tzinfo/data/definitions/Asia/Yangon.rb +28 -0
  337. data/lib/tzinfo/data/definitions/Asia/Yekaterinburg.rb +47 -49
  338. data/lib/tzinfo/data/definitions/Asia/Yerevan.rb +44 -49
  339. data/lib/tzinfo/data/definitions/Atlantic/Azores.rb +15 -7
  340. data/lib/tzinfo/data/definitions/Atlantic/Bermuda.rb +9 -1
  341. data/lib/tzinfo/data/definitions/Atlantic/Canary.rb +10 -2
  342. data/lib/tzinfo/data/definitions/Atlantic/Cape_Verde.rb +5 -5
  343. data/lib/tzinfo/data/definitions/Atlantic/Faeroe.rb +1 -1
  344. data/lib/tzinfo/data/definitions/Atlantic/Faroe.rb +9 -1
  345. data/lib/tzinfo/data/definitions/Atlantic/Jan_Mayen.rb +1 -1
  346. data/lib/tzinfo/data/definitions/Atlantic/Madeira.rb +13 -5
  347. data/lib/tzinfo/data/definitions/Atlantic/Reykjavik.rb +3 -3
  348. data/lib/tzinfo/data/definitions/Atlantic/South_Georgia.rb +2 -2
  349. data/lib/tzinfo/data/definitions/Atlantic/St_Helena.rb +1 -1
  350. data/lib/tzinfo/data/definitions/Atlantic/Stanley.rb +6 -7
  351. data/lib/tzinfo/data/definitions/Australia/ACT.rb +1 -1
  352. data/lib/tzinfo/data/definitions/Australia/Adelaide.rb +9 -1
  353. data/lib/tzinfo/data/definitions/Australia/Brisbane.rb +1 -1
  354. data/lib/tzinfo/data/definitions/Australia/Broken_Hill.rb +9 -1
  355. data/lib/tzinfo/data/definitions/Australia/Canberra.rb +1 -1
  356. data/lib/tzinfo/data/definitions/Australia/Currie.rb +9 -1
  357. data/lib/tzinfo/data/definitions/Australia/Darwin.rb +1 -1
  358. data/lib/tzinfo/data/definitions/Australia/Eucla.rb +3 -3
  359. data/lib/tzinfo/data/definitions/Australia/Hobart.rb +9 -1
  360. data/lib/tzinfo/data/definitions/Australia/LHI.rb +1 -1
  361. data/lib/tzinfo/data/definitions/Australia/Lindeman.rb +1 -1
  362. data/lib/tzinfo/data/definitions/Australia/Lord_Howe.rb +12 -4
  363. data/lib/tzinfo/data/definitions/Australia/Melbourne.rb +9 -1
  364. data/lib/tzinfo/data/definitions/Australia/NSW.rb +1 -1
  365. data/lib/tzinfo/data/definitions/Australia/North.rb +1 -1
  366. data/lib/tzinfo/data/definitions/Australia/Perth.rb +1 -1
  367. data/lib/tzinfo/data/definitions/Australia/Queensland.rb +1 -1
  368. data/lib/tzinfo/data/definitions/Australia/South.rb +1 -1
  369. data/lib/tzinfo/data/definitions/Australia/Sydney.rb +9 -1
  370. data/lib/tzinfo/data/definitions/Australia/Tasmania.rb +1 -1
  371. data/lib/tzinfo/data/definitions/Australia/Victoria.rb +1 -1
  372. data/lib/tzinfo/data/definitions/Australia/West.rb +1 -1
  373. data/lib/tzinfo/data/definitions/Australia/Yancowinna.rb +1 -1
  374. data/lib/tzinfo/data/definitions/Brazil/Acre.rb +1 -1
  375. data/lib/tzinfo/data/definitions/Brazil/DeNoronha.rb +1 -1
  376. data/lib/tzinfo/data/definitions/Brazil/East.rb +1 -1
  377. data/lib/tzinfo/data/definitions/Brazil/West.rb +1 -1
  378. data/lib/tzinfo/data/definitions/CET.rb +9 -1
  379. data/lib/tzinfo/data/definitions/CST6CDT.rb +9 -1
  380. data/lib/tzinfo/data/definitions/Canada/Atlantic.rb +1 -1
  381. data/lib/tzinfo/data/definitions/Canada/Central.rb +1 -1
  382. data/lib/tzinfo/data/definitions/Canada/Eastern.rb +1 -1
  383. data/lib/tzinfo/data/definitions/Canada/Mountain.rb +1 -1
  384. data/lib/tzinfo/data/definitions/Canada/Newfoundland.rb +1 -1
  385. data/lib/tzinfo/data/definitions/Canada/Pacific.rb +1 -1
  386. data/lib/tzinfo/data/definitions/Canada/Saskatchewan.rb +1 -1
  387. data/lib/tzinfo/data/definitions/Canada/Yukon.rb +1 -1
  388. data/lib/tzinfo/data/definitions/Chile/Continental.rb +1 -1
  389. data/lib/tzinfo/data/definitions/Chile/EasterIsland.rb +1 -1
  390. data/lib/tzinfo/data/definitions/Cuba.rb +1 -1
  391. data/lib/tzinfo/data/definitions/EET.rb +9 -1
  392. data/lib/tzinfo/data/definitions/EST.rb +1 -1
  393. data/lib/tzinfo/data/definitions/EST5EDT.rb +9 -1
  394. data/lib/tzinfo/data/definitions/Egypt.rb +1 -1
  395. data/lib/tzinfo/data/definitions/Eire.rb +1 -1
  396. data/lib/tzinfo/data/definitions/Etc/GMT.rb +1 -1
  397. data/lib/tzinfo/data/definitions/Etc/GMT0.rb +1 -1
  398. data/lib/tzinfo/data/definitions/Etc/GMT__m__0.rb +1 -1
  399. data/lib/tzinfo/data/definitions/Etc/GMT__m__1.rb +2 -2
  400. data/lib/tzinfo/data/definitions/Etc/GMT__m__10.rb +2 -2
  401. data/lib/tzinfo/data/definitions/Etc/GMT__m__11.rb +2 -2
  402. data/lib/tzinfo/data/definitions/Etc/GMT__m__12.rb +2 -2
  403. data/lib/tzinfo/data/definitions/Etc/GMT__m__13.rb +2 -2
  404. data/lib/tzinfo/data/definitions/Etc/GMT__m__14.rb +2 -2
  405. data/lib/tzinfo/data/definitions/Etc/GMT__m__2.rb +2 -2
  406. data/lib/tzinfo/data/definitions/Etc/GMT__m__3.rb +2 -2
  407. data/lib/tzinfo/data/definitions/Etc/GMT__m__4.rb +2 -2
  408. data/lib/tzinfo/data/definitions/Etc/GMT__m__5.rb +2 -2
  409. data/lib/tzinfo/data/definitions/Etc/GMT__m__6.rb +2 -2
  410. data/lib/tzinfo/data/definitions/Etc/GMT__m__7.rb +2 -2
  411. data/lib/tzinfo/data/definitions/Etc/GMT__m__8.rb +2 -2
  412. data/lib/tzinfo/data/definitions/Etc/GMT__m__9.rb +2 -2
  413. data/lib/tzinfo/data/definitions/Etc/GMT__p__0.rb +1 -1
  414. data/lib/tzinfo/data/definitions/Etc/GMT__p__1.rb +2 -2
  415. data/lib/tzinfo/data/definitions/Etc/GMT__p__10.rb +2 -2
  416. data/lib/tzinfo/data/definitions/Etc/GMT__p__11.rb +2 -2
  417. data/lib/tzinfo/data/definitions/Etc/GMT__p__12.rb +2 -2
  418. data/lib/tzinfo/data/definitions/Etc/GMT__p__2.rb +2 -2
  419. data/lib/tzinfo/data/definitions/Etc/GMT__p__3.rb +2 -2
  420. data/lib/tzinfo/data/definitions/Etc/GMT__p__4.rb +2 -2
  421. data/lib/tzinfo/data/definitions/Etc/GMT__p__5.rb +2 -2
  422. data/lib/tzinfo/data/definitions/Etc/GMT__p__6.rb +2 -2
  423. data/lib/tzinfo/data/definitions/Etc/GMT__p__7.rb +2 -2
  424. data/lib/tzinfo/data/definitions/Etc/GMT__p__8.rb +2 -2
  425. data/lib/tzinfo/data/definitions/Etc/GMT__p__9.rb +2 -2
  426. data/lib/tzinfo/data/definitions/Etc/Greenwich.rb +1 -1
  427. data/lib/tzinfo/data/definitions/Etc/UCT.rb +2 -5
  428. data/lib/tzinfo/data/definitions/Etc/UTC.rb +1 -1
  429. data/lib/tzinfo/data/definitions/Etc/Universal.rb +1 -1
  430. data/lib/tzinfo/data/definitions/Etc/Zulu.rb +1 -1
  431. data/lib/tzinfo/data/definitions/Europe/Amsterdam.rb +11 -3
  432. data/lib/tzinfo/data/definitions/Europe/Andorra.rb +9 -1
  433. data/lib/tzinfo/data/definitions/Europe/Astrakhan.rb +2 -2
  434. data/lib/tzinfo/data/definitions/Europe/Athens.rb +9 -1
  435. data/lib/tzinfo/data/definitions/Europe/Belfast.rb +1 -1
  436. data/lib/tzinfo/data/definitions/Europe/Belgrade.rb +9 -1
  437. data/lib/tzinfo/data/definitions/Europe/Berlin.rb +9 -1
  438. data/lib/tzinfo/data/definitions/Europe/Bratislava.rb +1 -1
  439. data/lib/tzinfo/data/definitions/Europe/Brussels.rb +10 -2
  440. data/lib/tzinfo/data/definitions/Europe/Bucharest.rb +9 -1
  441. data/lib/tzinfo/data/definitions/Europe/Budapest.rb +31 -23
  442. data/lib/tzinfo/data/definitions/Europe/Busingen.rb +1 -1
  443. data/lib/tzinfo/data/definitions/Europe/Chisinau.rb +9 -1
  444. data/lib/tzinfo/data/definitions/Europe/Copenhagen.rb +9 -1
  445. data/lib/tzinfo/data/definitions/Europe/Dublin.rb +202 -194
  446. data/lib/tzinfo/data/definitions/Europe/Gibraltar.rb +9 -1
  447. data/lib/tzinfo/data/definitions/Europe/Guernsey.rb +1 -1
  448. data/lib/tzinfo/data/definitions/Europe/Helsinki.rb +9 -1
  449. data/lib/tzinfo/data/definitions/Europe/Isle_of_Man.rb +1 -1
  450. data/lib/tzinfo/data/definitions/Europe/Istanbul.rb +35 -149
  451. data/lib/tzinfo/data/definitions/Europe/Jersey.rb +1 -1
  452. data/lib/tzinfo/data/definitions/Europe/Kaliningrad.rb +53 -54
  453. data/lib/tzinfo/data/definitions/Europe/Kiev.rb +9 -1
  454. data/lib/tzinfo/data/definitions/Europe/Kirov.rb +88 -0
  455. data/lib/tzinfo/data/definitions/Europe/Lisbon.rb +10 -2
  456. data/lib/tzinfo/data/definitions/Europe/Ljubljana.rb +1 -1
  457. data/lib/tzinfo/data/definitions/Europe/London.rb +9 -1
  458. data/lib/tzinfo/data/definitions/Europe/Luxembourg.rb +9 -1
  459. data/lib/tzinfo/data/definitions/Europe/Madrid.rb +40 -34
  460. data/lib/tzinfo/data/definitions/Europe/Malta.rb +22 -14
  461. data/lib/tzinfo/data/definitions/Europe/Mariehamn.rb +1 -1
  462. data/lib/tzinfo/data/definitions/Europe/Minsk.rb +4 -5
  463. data/lib/tzinfo/data/definitions/Europe/Monaco.rb +11 -3
  464. data/lib/tzinfo/data/definitions/Europe/Moscow.rb +5 -5
  465. data/lib/tzinfo/data/definitions/Europe/Nicosia.rb +1 -1
  466. data/lib/tzinfo/data/definitions/Europe/Oslo.rb +9 -1
  467. data/lib/tzinfo/data/definitions/Europe/Paris.rb +11 -3
  468. data/lib/tzinfo/data/definitions/Europe/Podgorica.rb +1 -1
  469. data/lib/tzinfo/data/definitions/Europe/Prague.rb +15 -4
  470. data/lib/tzinfo/data/definitions/Europe/Riga.rb +9 -1
  471. data/lib/tzinfo/data/definitions/Europe/Rome.rb +25 -17
  472. data/lib/tzinfo/data/definitions/Europe/Samara.rb +48 -53
  473. data/lib/tzinfo/data/definitions/Europe/San_Marino.rb +1 -1
  474. data/lib/tzinfo/data/definitions/Europe/Sarajevo.rb +1 -1
  475. data/lib/tzinfo/data/definitions/Europe/Saratov.rb +89 -0
  476. data/lib/tzinfo/data/definitions/Europe/Simferopol.rb +1 -1
  477. data/lib/tzinfo/data/definitions/Europe/Skopje.rb +1 -1
  478. data/lib/tzinfo/data/definitions/Europe/Sofia.rb +9 -1
  479. data/lib/tzinfo/data/definitions/Europe/Stockholm.rb +9 -1
  480. data/lib/tzinfo/data/definitions/Europe/Tallinn.rb +9 -1
  481. data/lib/tzinfo/data/definitions/Europe/Tirane.rb +9 -1
  482. data/lib/tzinfo/data/definitions/Europe/Tiraspol.rb +1 -1
  483. data/lib/tzinfo/data/definitions/Europe/Ulyanovsk.rb +4 -4
  484. data/lib/tzinfo/data/definitions/Europe/Uzhgorod.rb +9 -1
  485. data/lib/tzinfo/data/definitions/Europe/Vaduz.rb +1 -1
  486. data/lib/tzinfo/data/definitions/Europe/Vatican.rb +1 -1
  487. data/lib/tzinfo/data/definitions/Europe/Vienna.rb +10 -2
  488. data/lib/tzinfo/data/definitions/Europe/Vilnius.rb +9 -1
  489. data/lib/tzinfo/data/definitions/Europe/Volgograd.rb +68 -75
  490. data/lib/tzinfo/data/definitions/Europe/Warsaw.rb +9 -1
  491. data/lib/tzinfo/data/definitions/Europe/Zagreb.rb +1 -1
  492. data/lib/tzinfo/data/definitions/Europe/Zaporozhye.rb +10 -2
  493. data/lib/tzinfo/data/definitions/Europe/Zurich.rb +9 -1
  494. data/lib/tzinfo/data/definitions/{US/Pacific__m__New.rb → Factory.rb} +6 -5
  495. data/lib/tzinfo/data/definitions/GB.rb +1 -1
  496. data/lib/tzinfo/data/definitions/GB__m__Eire.rb +1 -1
  497. data/lib/tzinfo/data/definitions/GMT.rb +1 -1
  498. data/lib/tzinfo/data/definitions/GMT0.rb +1 -1
  499. data/lib/tzinfo/data/definitions/GMT__m__0.rb +1 -1
  500. data/lib/tzinfo/data/definitions/GMT__p__0.rb +1 -1
  501. data/lib/tzinfo/data/definitions/Greenwich.rb +1 -1
  502. data/lib/tzinfo/data/definitions/HST.rb +1 -1
  503. data/lib/tzinfo/data/definitions/Hongkong.rb +1 -1
  504. data/lib/tzinfo/data/definitions/Iceland.rb +1 -1
  505. data/lib/tzinfo/data/definitions/Indian/Antananarivo.rb +1 -1
  506. data/lib/tzinfo/data/definitions/Indian/Chagos.rb +3 -3
  507. data/lib/tzinfo/data/definitions/Indian/Christmas.rb +2 -2
  508. data/lib/tzinfo/data/definitions/Indian/Cocos.rb +2 -2
  509. data/lib/tzinfo/data/definitions/Indian/Comoro.rb +1 -1
  510. data/lib/tzinfo/data/definitions/Indian/Kerguelen.rb +3 -3
  511. data/lib/tzinfo/data/definitions/Indian/Mahe.rb +2 -2
  512. data/lib/tzinfo/data/definitions/Indian/Maldives.rb +2 -2
  513. data/lib/tzinfo/data/definitions/Indian/Mauritius.rb +3 -3
  514. data/lib/tzinfo/data/definitions/Indian/Mayotte.rb +1 -1
  515. data/lib/tzinfo/data/definitions/Indian/Reunion.rb +2 -2
  516. data/lib/tzinfo/data/definitions/Iran.rb +1 -1
  517. data/lib/tzinfo/data/definitions/Israel.rb +1 -1
  518. data/lib/tzinfo/data/definitions/Jamaica.rb +1 -1
  519. data/lib/tzinfo/data/definitions/Japan.rb +1 -1
  520. data/lib/tzinfo/data/definitions/Kwajalein.rb +1 -1
  521. data/lib/tzinfo/data/definitions/Libya.rb +1 -1
  522. data/lib/tzinfo/data/definitions/MET.rb +9 -1
  523. data/lib/tzinfo/data/definitions/MST.rb +1 -1
  524. data/lib/tzinfo/data/definitions/MST7MDT.rb +9 -1
  525. data/lib/tzinfo/data/definitions/Mexico/BajaNorte.rb +1 -1
  526. data/lib/tzinfo/data/definitions/Mexico/BajaSur.rb +1 -1
  527. data/lib/tzinfo/data/definitions/Mexico/General.rb +1 -1
  528. data/lib/tzinfo/data/definitions/NZ.rb +1 -1
  529. data/lib/tzinfo/data/definitions/NZ__m__CHAT.rb +1 -1
  530. data/lib/tzinfo/data/definitions/Navajo.rb +1 -1
  531. data/lib/tzinfo/data/definitions/PRC.rb +1 -1
  532. data/lib/tzinfo/data/definitions/PST8PDT.rb +9 -1
  533. data/lib/tzinfo/data/definitions/Pacific/Apia.rb +15 -7
  534. data/lib/tzinfo/data/definitions/Pacific/Auckland.rb +9 -1
  535. data/lib/tzinfo/data/definitions/Pacific/Bougainville.rb +4 -4
  536. data/lib/tzinfo/data/definitions/Pacific/Chatham.rb +12 -4
  537. data/lib/tzinfo/data/definitions/Pacific/Chuuk.rb +11 -4
  538. data/lib/tzinfo/data/definitions/Pacific/Easter.rb +108 -100
  539. data/lib/tzinfo/data/definitions/Pacific/Efate.rb +3 -3
  540. data/lib/tzinfo/data/definitions/Pacific/Enderbury.rb +5 -5
  541. data/lib/tzinfo/data/definitions/Pacific/Fakaofo.rb +3 -3
  542. data/lib/tzinfo/data/definitions/Pacific/Fiji.rb +80 -72
  543. data/lib/tzinfo/data/definitions/Pacific/Funafuti.rb +2 -2
  544. data/lib/tzinfo/data/definitions/Pacific/Galapagos.rb +6 -3
  545. data/lib/tzinfo/data/definitions/Pacific/Gambier.rb +2 -2
  546. data/lib/tzinfo/data/definitions/Pacific/Guadalcanal.rb +2 -2
  547. data/lib/tzinfo/data/definitions/Pacific/Guam.rb +23 -3
  548. data/lib/tzinfo/data/definitions/Pacific/Honolulu.rb +7 -4
  549. data/lib/tzinfo/data/definitions/Pacific/Johnston.rb +1 -1
  550. data/lib/tzinfo/data/definitions/Pacific/Kiritimati.rb +5 -5
  551. data/lib/tzinfo/data/definitions/Pacific/Kosrae.rb +16 -7
  552. data/lib/tzinfo/data/definitions/Pacific/Kwajalein.rb +11 -6
  553. data/lib/tzinfo/data/definitions/Pacific/Majuro.rb +11 -4
  554. data/lib/tzinfo/data/definitions/Pacific/Marquesas.rb +2 -2
  555. data/lib/tzinfo/data/definitions/Pacific/Midway.rb +1 -1
  556. data/lib/tzinfo/data/definitions/Pacific/Nauru.rb +7 -7
  557. data/lib/tzinfo/data/definitions/Pacific/Niue.rb +4 -4
  558. data/lib/tzinfo/data/definitions/Pacific/Norfolk.rb +109 -6
  559. data/lib/tzinfo/data/definitions/Pacific/Noumea.rb +3 -3
  560. data/lib/tzinfo/data/definitions/Pacific/Pago_Pago.rb +3 -7
  561. data/lib/tzinfo/data/definitions/Pacific/Palau.rb +6 -4
  562. data/lib/tzinfo/data/definitions/Pacific/Pitcairn.rb +3 -3
  563. data/lib/tzinfo/data/definitions/Pacific/Pohnpei.rb +13 -4
  564. data/lib/tzinfo/data/definitions/Pacific/Ponape.rb +1 -1
  565. data/lib/tzinfo/data/definitions/Pacific/Port_Moresby.rb +2 -2
  566. data/lib/tzinfo/data/definitions/Pacific/Rarotonga.rb +4 -4
  567. data/lib/tzinfo/data/definitions/Pacific/Saipan.rb +1 -1
  568. data/lib/tzinfo/data/definitions/Pacific/Samoa.rb +1 -1
  569. data/lib/tzinfo/data/definitions/Pacific/Tahiti.rb +2 -2
  570. data/lib/tzinfo/data/definitions/Pacific/Tarawa.rb +2 -2
  571. data/lib/tzinfo/data/definitions/Pacific/Tongatapu.rb +6 -4
  572. data/lib/tzinfo/data/definitions/Pacific/Truk.rb +1 -1
  573. data/lib/tzinfo/data/definitions/Pacific/Wake.rb +2 -2
  574. data/lib/tzinfo/data/definitions/Pacific/Wallis.rb +2 -2
  575. data/lib/tzinfo/data/definitions/Pacific/Yap.rb +1 -1
  576. data/lib/tzinfo/data/definitions/Poland.rb +1 -1
  577. data/lib/tzinfo/data/definitions/Portugal.rb +1 -1
  578. data/lib/tzinfo/data/definitions/ROC.rb +1 -1
  579. data/lib/tzinfo/data/definitions/ROK.rb +1 -1
  580. data/lib/tzinfo/data/definitions/Singapore.rb +1 -1
  581. data/lib/tzinfo/data/definitions/Turkey.rb +1 -1
  582. data/lib/tzinfo/data/definitions/UCT.rb +2 -2
  583. data/lib/tzinfo/data/definitions/US/Alaska.rb +1 -1
  584. data/lib/tzinfo/data/definitions/US/Aleutian.rb +1 -1
  585. data/lib/tzinfo/data/definitions/US/Arizona.rb +1 -1
  586. data/lib/tzinfo/data/definitions/US/Central.rb +1 -1
  587. data/lib/tzinfo/data/definitions/US/East__m__Indiana.rb +1 -1
  588. data/lib/tzinfo/data/definitions/US/Eastern.rb +1 -1
  589. data/lib/tzinfo/data/definitions/US/Hawaii.rb +1 -1
  590. data/lib/tzinfo/data/definitions/US/Indiana__m__Starke.rb +1 -1
  591. data/lib/tzinfo/data/definitions/US/Michigan.rb +1 -1
  592. data/lib/tzinfo/data/definitions/US/Mountain.rb +1 -1
  593. data/lib/tzinfo/data/definitions/US/Pacific.rb +1 -1
  594. data/lib/tzinfo/data/definitions/US/Samoa.rb +1 -1
  595. data/lib/tzinfo/data/definitions/UTC.rb +1 -1
  596. data/lib/tzinfo/data/definitions/Universal.rb +1 -1
  597. data/lib/tzinfo/data/definitions/WET.rb +9 -1
  598. data/lib/tzinfo/data/definitions/W__m__SU.rb +1 -1
  599. data/lib/tzinfo/data/definitions/Zulu.rb +1 -1
  600. data/lib/tzinfo/data/indexes/countries.rb +30 -22
  601. data/lib/tzinfo/data/indexes/timezones.rb +16 -8
  602. data/lib/tzinfo/data/tzdataparser.rb +361 -349
  603. data/lib/tzinfo/data/version.rb +5 -5
  604. metadata +32 -26
  605. metadata.gz.sig +0 -0
  606. data/lib/tzinfo/data/definitions/Canada/East__m__Saskatchewan.rb +0 -18
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # This file contains data derived from the IANA Time Zone Database
4
- # (http://www.iana.org/time-zones).
4
+ # (https://www.iana.org/time-zones).
5
5
 
6
6
  module TZInfo
7
7
  module Data
@@ -35,7 +35,7 @@ module TZInfo
35
35
  linked_timezone 'Africa/Gaborone'
36
36
  linked_timezone 'Africa/Harare'
37
37
  timezone 'Africa/Johannesburg'
38
- linked_timezone 'Africa/Juba'
38
+ timezone 'Africa/Juba'
39
39
  linked_timezone 'Africa/Kampala'
40
40
  timezone 'Africa/Khartoum'
41
41
  linked_timezone 'Africa/Kigali'
@@ -58,7 +58,7 @@ module TZInfo
58
58
  linked_timezone 'Africa/Nouakchott'
59
59
  linked_timezone 'Africa/Ouagadougou'
60
60
  linked_timezone 'Africa/Porto-Novo'
61
- linked_timezone 'Africa/Sao_Tome'
61
+ timezone 'Africa/Sao_Tome'
62
62
  linked_timezone 'Africa/Timbuktu'
63
63
  timezone 'Africa/Tripoli'
64
64
  timezone 'Africa/Tunis'
@@ -124,7 +124,7 @@ module TZInfo
124
124
  linked_timezone 'America/Fort_Wayne'
125
125
  timezone 'America/Fortaleza'
126
126
  timezone 'America/Glace_Bay'
127
- timezone 'America/Godthab'
127
+ linked_timezone 'America/Godthab'
128
128
  timezone 'America/Goose_Bay'
129
129
  timezone 'America/Grand_Turk'
130
130
  linked_timezone 'America/Grenada'
@@ -184,6 +184,7 @@ module TZInfo
184
184
  timezone 'America/North_Dakota/Beulah'
185
185
  timezone 'America/North_Dakota/Center'
186
186
  timezone 'America/North_Dakota/New_Salem'
187
+ timezone 'America/Nuuk'
187
188
  timezone 'America/Ojinaga'
188
189
  timezone 'America/Panama'
189
190
  timezone 'America/Pangnirtung'
@@ -194,6 +195,7 @@ module TZInfo
194
195
  linked_timezone 'America/Porto_Acre'
195
196
  timezone 'America/Porto_Velho'
196
197
  timezone 'America/Puerto_Rico'
198
+ timezone 'America/Punta_Arenas'
197
199
  timezone 'America/Rainy_River'
198
200
  timezone 'America/Rankin_Inlet'
199
201
  timezone 'America/Recife'
@@ -249,6 +251,7 @@ module TZInfo
249
251
  timezone 'Asia/Aqtobe'
250
252
  timezone 'Asia/Ashgabat'
251
253
  linked_timezone 'Asia/Ashkhabad'
254
+ timezone 'Asia/Atyrau'
252
255
  timezone 'Asia/Baghdad'
253
256
  linked_timezone 'Asia/Bahrain'
254
257
  timezone 'Asia/Baku'
@@ -269,6 +272,7 @@ module TZInfo
269
272
  timezone 'Asia/Dili'
270
273
  timezone 'Asia/Dubai'
271
274
  timezone 'Asia/Dushanbe'
275
+ timezone 'Asia/Famagusta'
272
276
  timezone 'Asia/Gaza'
273
277
  linked_timezone 'Asia/Harbin'
274
278
  timezone 'Asia/Hebron'
@@ -307,8 +311,9 @@ module TZInfo
307
311
  timezone 'Asia/Pontianak'
308
312
  timezone 'Asia/Pyongyang'
309
313
  timezone 'Asia/Qatar'
314
+ timezone 'Asia/Qostanay'
310
315
  timezone 'Asia/Qyzylorda'
311
- timezone 'Asia/Rangoon'
316
+ linked_timezone 'Asia/Rangoon'
312
317
  timezone 'Asia/Riyadh'
313
318
  linked_timezone 'Asia/Saigon'
314
319
  timezone 'Asia/Sakhalin'
@@ -325,6 +330,7 @@ module TZInfo
325
330
  linked_timezone 'Asia/Thimbu'
326
331
  timezone 'Asia/Thimphu'
327
332
  timezone 'Asia/Tokyo'
333
+ timezone 'Asia/Tomsk'
328
334
  linked_timezone 'Asia/Ujung_Pandang'
329
335
  timezone 'Asia/Ulaanbaatar'
330
336
  linked_timezone 'Asia/Ulan_Bator'
@@ -333,6 +339,7 @@ module TZInfo
333
339
  linked_timezone 'Asia/Vientiane'
334
340
  timezone 'Asia/Vladivostok'
335
341
  timezone 'Asia/Yakutsk'
342
+ timezone 'Asia/Yangon'
336
343
  timezone 'Asia/Yekaterinburg'
337
344
  timezone 'Asia/Yerevan'
338
345
  timezone 'Atlantic/Azores'
@@ -378,7 +385,6 @@ module TZInfo
378
385
  timezone 'CST6CDT'
379
386
  linked_timezone 'Canada/Atlantic'
380
387
  linked_timezone 'Canada/Central'
381
- linked_timezone 'Canada/East-Saskatchewan'
382
388
  linked_timezone 'Canada/Eastern'
383
389
  linked_timezone 'Canada/Mountain'
384
390
  linked_timezone 'Canada/Newfoundland'
@@ -424,7 +430,7 @@ module TZInfo
424
430
  timezone 'Etc/GMT-9'
425
431
  linked_timezone 'Etc/GMT0'
426
432
  linked_timezone 'Etc/Greenwich'
427
- timezone 'Etc/UCT'
433
+ linked_timezone 'Etc/UCT'
428
434
  timezone 'Etc/UTC'
429
435
  linked_timezone 'Etc/Universal'
430
436
  linked_timezone 'Etc/Zulu'
@@ -451,6 +457,7 @@ module TZInfo
451
457
  linked_timezone 'Europe/Jersey'
452
458
  timezone 'Europe/Kaliningrad'
453
459
  timezone 'Europe/Kiev'
460
+ timezone 'Europe/Kirov'
454
461
  timezone 'Europe/Lisbon'
455
462
  linked_timezone 'Europe/Ljubljana'
456
463
  timezone 'Europe/London'
@@ -471,6 +478,7 @@ module TZInfo
471
478
  timezone 'Europe/Samara'
472
479
  linked_timezone 'Europe/San_Marino'
473
480
  linked_timezone 'Europe/Sarajevo'
481
+ timezone 'Europe/Saratov'
474
482
  timezone 'Europe/Simferopol'
475
483
  linked_timezone 'Europe/Skopje'
476
484
  timezone 'Europe/Sofia'
@@ -489,6 +497,7 @@ module TZInfo
489
497
  linked_timezone 'Europe/Zagreb'
490
498
  timezone 'Europe/Zaporozhye'
491
499
  timezone 'Europe/Zurich'
500
+ timezone 'Factory'
492
501
  linked_timezone 'GB'
493
502
  linked_timezone 'GB-Eire'
494
503
  linked_timezone 'GMT'
@@ -588,7 +597,6 @@ module TZInfo
588
597
  linked_timezone 'US/Michigan'
589
598
  linked_timezone 'US/Mountain'
590
599
  linked_timezone 'US/Pacific'
591
- linked_timezone 'US/Pacific-New'
592
600
  linked_timezone 'US/Samoa'
593
601
  linked_timezone 'UTC'
594
602
  linked_timezone 'Universal'
@@ -3,7 +3,7 @@ require 'fileutils'
3
3
 
4
4
  module TZInfo
5
5
  module Data
6
-
6
+
7
7
  # Utility methods used by TZDataParser and associated classes.
8
8
  #
9
9
  # @private
@@ -15,16 +15,25 @@ module TZInfo
15
15
  def open_file(file_name, mode, opts, &block)
16
16
  File.open(file_name, mode, &block)
17
17
  end
18
- else
18
+ elsif RUBY_VERSION =~ /\A1\.9\./
19
19
  def open_file(file_name, mode, opts, &block)
20
20
  File.open(file_name, mode, opts, &block)
21
21
  end
22
+ else
23
+ # Evaluate method as a string because **opts isn't valid syntax prior to
24
+ # Ruby 2.0.
25
+ eval(<<-EOF
26
+ def open_file(file_name, mode, opts, &block)
27
+ File.open(file_name, mode, **opts, &block)
28
+ end
29
+ EOF
30
+ )
22
31
  end
23
-
32
+
24
33
  private :open_file
25
-
34
+
26
35
  private
27
-
36
+
28
37
  # Parses a month specified in the tz data and converts it to a number
29
38
  # between 1 and 12 representing January to December.
30
39
  def parse_month(month)
@@ -57,17 +66,17 @@ module TZInfo
57
66
  raise "Invalid month: #{month}"
58
67
  end
59
68
  end
60
-
69
+
61
70
  # Parses an offset string [-]h:m:s (minutes and seconds are optional). Returns
62
71
  # the offset in seconds.
63
72
  def parse_offset(offset)
64
73
  raise "Invalid time: #{offset}" if offset !~ /^(-)?(?:([0-9]+)(?::([0-9]+)(?::([0-9]+))?)?)?$/
65
-
66
- negative = !$1.nil?
74
+
75
+ negative = !$1.nil?
67
76
  hour = $2.nil? ? 0 : $2.to_i
68
77
  minute = $3.nil? ? 0 : $3.to_i
69
78
  second = $4.nil? ? 0 : $4.to_i
70
-
79
+
71
80
  seconds = hour
72
81
  seconds = seconds * 60
73
82
  seconds = seconds + minute
@@ -76,52 +85,52 @@ module TZInfo
76
85
  seconds = -seconds if negative
77
86
  seconds
78
87
  end
79
-
88
+
80
89
  # Encloses the string in single quotes and escapes any single quotes in
81
90
  # the content.
82
91
  def quote_str(str)
83
92
  "'#{str.gsub('\'', '\\\\\'')}'"
84
93
  end
85
- end
86
-
87
- # Parses Time Zone Data from the IANA Time Zone Database and transforms it
94
+ end
95
+
96
+ # Parses Time Zone Data from the IANA Time Zone Database and transforms it
88
97
  # into a set of Ruby modules that can be used with TZInfo.
89
- #
90
- # Normally, this class wouldn't be used. It is only run to update the
98
+ #
99
+ # Normally, this class wouldn't be used. It is only run to update the
91
100
  # timezone data and index modules.
92
101
  class TZDataParser
93
102
  include TZDataParserUtils
94
-
103
+
95
104
  # Default earliest year that will be considered.
96
105
  DEFAULT_MIN_YEAR = 1800
97
-
98
- # Default number of future years data to generate (not including the
106
+
107
+ # Default number of future years data to generate (not including the
99
108
  # current year).
100
109
  DEFAULT_FUTURE_YEARS = 50
101
-
110
+
102
111
  # Earliest year that will be considered. Defaults to DEFAULT_MIN_YEAR.
103
112
  attr_accessor :min_year
104
-
113
+
105
114
  # Latest year that will be considered. Defaults to the current year plus
106
115
  # FUTURE_YEARS.
107
116
  attr_accessor :max_year
108
-
117
+
109
118
  # Whether to generate zone definitions (set to false to stop zones being
110
- # generated).
119
+ # generated).
111
120
  attr_accessor :generate_zones
112
-
121
+
113
122
  # Whether to generate country definitions (set to false to stop countries
114
123
  # being generated).
115
124
  attr_accessor :generate_countries
116
-
125
+
117
126
  # Limit the set of zones to generate (set to an array containing zone
118
127
  # identifiers).
119
128
  attr_accessor :only_zones
120
-
129
+
121
130
  # Zones to exclude from generation when not using only_zones (set to an
122
131
  # array containing zone identifiers).
123
132
  attr_accessor :exclude_zones
124
-
133
+
125
134
  # Initializes a new TZDataParser. input_dir must contain the extracted
126
135
  # tzdata tarball. output_dir is the location to output the modules
127
136
  # (in definitions and indexes directories).
@@ -140,7 +149,7 @@ module TZInfo
140
149
  @only_zones = []
141
150
  @exclude_zones = []
142
151
  end
143
-
152
+
144
153
  # Reads the tzdata source and generates the classes. Progress information
145
154
  # is written to standard out.
146
155
  def execute
@@ -150,20 +159,20 @@ module TZInfo
150
159
  # install its entries by default.
151
160
 
152
161
  files = Dir.entries(@input_dir).select do |file|
153
- file =~ /\A[^\.]+\z/ &&
154
- !%w(backzone checktab.awk leapseconds leapseconds.awk leap-seconds.list CONTRIBUTING LICENSE Makefile NEWS README SOURCE Theory zoneinfo2tdf.pl).include?(file) &&
162
+ file =~ /\A[^\.]+\z/ &&
163
+ !%w(backzone calendars leapseconds CONTRIBUTING LICENSE Makefile NEWS README SOURCE Theory version).include?(file) &&
155
164
  File.file?(File.join(@input_dir, file))
156
165
  end
157
-
166
+
158
167
  files.each {|file| load_rules(file) }
159
168
  files.each {|file| load_zones(file) }
160
169
  files.each {|file| load_links(file) }
161
-
170
+
162
171
  load_countries
163
-
172
+
164
173
  if @generate_zones
165
174
  modules = []
166
-
175
+
167
176
  if @only_zones.nil? || @only_zones.empty?
168
177
  @zones.each_value {|zone|
169
178
  zone.write_module(@output_dir) unless @exclude_zones.include?(zone.name)
@@ -171,128 +180,128 @@ module TZInfo
171
180
  else
172
181
  @only_zones.each {|id|
173
182
  zone = @zones[id]
174
- zone.write_module(@output_dir)
175
- }
183
+ zone.write_module(@output_dir)
184
+ }
176
185
  end
177
-
186
+
178
187
  write_timezones_index
179
188
  end
180
-
181
- if @generate_countries
189
+
190
+ if @generate_countries
182
191
  write_countries_index
183
192
  end
184
193
  end
185
-
186
- private
194
+
195
+ private
187
196
  # Loads all the Rule definitions from the tz data and stores them in
188
197
  # the rule_sets instance variable.
189
198
  def load_rules(file)
190
199
  puts 'load_rules: ' + file
191
-
200
+
192
201
  # Files are in ASCII, but may change to UTF-8 (a superset of ASCII)
193
202
  # in the future.
194
203
  open_file(File.join(@input_dir, file), 'r', :external_encoding => 'UTF-8', :internal_encoding => 'UTF-8') do |file|
195
204
  file.each_line do |line|
196
205
  line = line.gsub(/#.*$/, '')
197
206
  line = line.gsub(/\s+$/, '')
198
-
207
+
199
208
  if line =~ /^Rule\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)/
200
-
201
- name = $1
202
-
203
- if @rule_sets[name].nil?
204
- @rule_sets[name] = TZDataRuleSet.new(name)
209
+
210
+ name = $1
211
+
212
+ if @rule_sets[name].nil?
213
+ @rule_sets[name] = TZDataRuleSet.new(name)
205
214
  end
206
-
215
+
207
216
  @rule_sets[name].add_rule(TZDataRule.new($2, $3, $4, $5, $6, $7, $8, $9))
208
- end
217
+ end
209
218
  end
210
219
  end
211
220
  end
212
-
221
+
213
222
  # Gets a rules object for the given reference. Might be a named rule set,
214
223
  # a fixed offset or an empty ruleset.
215
224
  def get_rules(ref)
216
225
  if ref == '-'
217
226
  @no_rules
218
- elsif ref =~ /^[0-9]+:[0-9]+$/
227
+ elsif ref =~ /^-?[0-9]+:[0-9]+$/
219
228
  TZDataFixedOffsetRules.new(parse_offset(ref))
220
229
  else
221
230
  rule_set = @rule_sets[ref]
222
- raise "Ruleset not found: #{ref}" if rule_set.nil?
231
+ raise "Ruleset not found: #{ref}" if rule_set.nil?
223
232
  rule_set
224
- end
233
+ end
225
234
  end
226
-
235
+
227
236
  # Loads in the Zone definitions from the tz data and stores them in @zones.
228
237
  def load_zones(file)
229
238
  puts 'load_zones: ' + file
230
-
239
+
231
240
  in_zone = nil
232
-
241
+
233
242
  # Files are in ASCII, but may change to UTF-8 (a superset of ASCII)
234
243
  # in the future.
235
244
  open_file(File.join(@input_dir, file), 'r', :external_encoding => 'UTF-8', :internal_encoding => 'UTF-8') do |file|
236
245
  file.each_line do |line|
237
246
  line = line.gsub(/#.*$/, '')
238
247
  line = line.gsub(/\s+$/, '')
239
-
248
+
240
249
  if in_zone
241
- if line =~ /^\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)(\s+([0-9]+(\s+.*)?))?$/
242
-
250
+ if line =~ /^\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)(\s+([0-9]+(\s+.*)?))?$/
251
+
243
252
  in_zone.add_observance(TZDataObservance.new($1, get_rules($2), $3, $5))
244
-
245
- in_zone = nil if $4.nil?
253
+
254
+ in_zone = nil if $4.nil?
246
255
  end
247
256
  else
248
- if line =~ /^Zone\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)(\s+([0-9]+(\s+.*)?))?$/
257
+ if line =~ /^Zone\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)(\s+([0-9]+(\s+.*)?))?$/
249
258
  name = $1
250
-
251
- if @zones[name].nil?
259
+
260
+ if @zones[name].nil?
252
261
  @zones[name] = TZDataZone.new(name, @min_year..@max_year)
253
- end
254
-
262
+ end
263
+
255
264
  @zones[name].add_observance(TZDataObservance.new($2, get_rules($3), $4, $6))
256
-
265
+
257
266
  in_zone = @zones[name] if !$5.nil?
258
267
  end
259
268
  end
260
269
  end
261
270
  end
262
271
  end
263
-
272
+
264
273
  # Loads in the links and stores them in @zones.
265
274
  def load_links(file)
266
275
  puts 'load_links: ' + file
267
-
276
+
268
277
  # Files are in ASCII, but may change to UTF-8 (a superset of ASCII)
269
278
  # in the future.
270
279
  open_file(File.join(@input_dir, file), 'r', :external_encoding => 'UTF-8', :internal_encoding => 'UTF-8') do |file|
271
280
  file.each_line do |line|
272
281
  line = line.gsub(/#.*$/, '')
273
282
  line = line.gsub(/\s+$/, '')
274
-
275
- if line =~ /^Link\s+([^\s]+)\s+([^\s]+)/
276
- name = $2
283
+
284
+ if line =~ /^Link\s+([^\s]+)\s+([^\s]+)/
285
+ name = $2
277
286
  link_to = @zones[$1]
278
287
  raise "Link to zone not found (#{name}->#{link_to})" if link_to.nil?
279
288
  raise "Zone already defined: #{name}" if !@zones[name].nil?
280
289
  @zones[name] = TZDataLink.new(name, link_to)
281
- end
290
+ end
282
291
  end
283
292
  end
284
293
  end
285
-
294
+
286
295
  # Loads countries from iso3166.tab and zone1970.tab and stores the
287
296
  # result in the countries instance variable.
288
297
  def load_countries
289
298
  puts 'load_countries'
290
-
299
+
291
300
  # iso3166.tab is ASCII encoded, but is planned to change to UTF-8 (a
292
301
  # superset of ASCII) in the future.
293
302
  open_file(File.join(@input_dir, 'iso3166.tab'), 'r', :external_encoding => 'UTF-8', :internal_encoding => 'UTF-8') do |file|
294
303
  file.each_line do |line|
295
-
304
+
296
305
  if line =~ /^([A-Z]{2})\t(.*)$/
297
306
  code = $1
298
307
  name = $2
@@ -307,22 +316,22 @@ module TZInfo
307
316
  # zone1970.tab is UTF-8 encoded.
308
317
  open_file(File.join(@input_dir, 'zone1970.tab'), 'r', :external_encoding => 'UTF-8', :internal_encoding => 'UTF-8') do |file|
309
318
  file.each_line do |line|
310
-
311
- line.chomp!
319
+
320
+ line.chomp!
312
321
 
313
322
  if line =~ /^([A-Z]{2}(?:,[A-Z]{2})*)\t([^\t]+)\t([^\t]+)(\t(.*))?$/
314
323
  codes = $1
315
324
  location_str = $2
316
325
  zone_name = $3
317
326
  description = $5
318
-
327
+
319
328
  location = TZDataLocation.new(location_str)
320
-
329
+
321
330
  zone = @zones[zone_name]
322
- raise "Zone not found: #{zone_name}" if zone.nil?
323
-
331
+ raise "Zone not found: #{zone_name}" if zone.nil?
332
+
324
333
  description = nil if description == ''
325
-
334
+
326
335
  country_timezone = TZDataCountryTimezone.new(zone, description, location)
327
336
 
328
337
  codes = codes.split(',')
@@ -347,95 +356,95 @@ module TZInfo
347
356
  end
348
357
  end
349
358
  end
350
-
359
+
351
360
  # Writes a country index file.
352
361
  def write_countries_index
353
362
  dir = File.join(@output_dir, 'indexes')
354
363
  FileUtils.mkdir_p(dir)
355
-
364
+
356
365
  open_file(File.join(dir, 'countries.rb'), 'w', :external_encoding => 'UTF-8', :universal_newline => true) do |file|
357
366
  file.puts('# encoding: UTF-8')
358
367
  file.puts('')
359
368
  file.puts('# This file contains data derived from the IANA Time Zone Database')
360
- file.puts('# (http://www.iana.org/time-zones).')
369
+ file.puts('# (https://www.iana.org/time-zones).')
361
370
  file.puts('')
362
-
371
+
363
372
  file.puts('module TZInfo')
364
373
  file.puts(' module Data')
365
374
  file.puts(' module Indexes')
366
375
  file.puts(' module Countries')
367
376
  file.puts(' include CountryIndexDefinition')
368
377
  file.puts('')
369
-
370
- countries = @countries.values.sort {|c1,c2| c1.code <=> c2.code}
378
+
379
+ countries = @countries.values.sort {|c1,c2| c1.code <=> c2.code}
371
380
  countries.each {|country| country.write_index_record(file)}
372
-
373
- file.puts(' end') # end module Countries
381
+
382
+ file.puts(' end') # end module Countries
374
383
  file.puts(' end') # end module Indexes
375
384
  file.puts(' end') # end module Data
376
385
  file.puts('end') # end module TZInfo
377
- end
386
+ end
378
387
  end
379
-
388
+
380
389
  # Writes a timezone index file.
381
390
  def write_timezones_index
382
391
  dir = File.join(@output_dir, 'indexes')
383
392
  FileUtils.mkdir_p(dir)
384
-
393
+
385
394
  open_file(File.join(dir, 'timezones.rb'), 'w', :external_encoding => 'UTF-8', :universal_newline => true) do |file|
386
395
  file.puts('# encoding: UTF-8')
387
396
  file.puts('')
388
397
  file.puts('# This file contains data derived from the IANA Time Zone Database')
389
- file.puts('# (http://www.iana.org/time-zones).')
398
+ file.puts('# (https://www.iana.org/time-zones).')
390
399
  file.puts('')
391
-
400
+
392
401
  file.puts('module TZInfo')
393
402
  file.puts(' module Data')
394
403
  file.puts(' module Indexes')
395
404
  file.puts(' module Timezones')
396
405
  file.puts(' include TimezoneIndexDefinition')
397
406
  file.puts('')
398
-
407
+
399
408
  zones = @zones.values.sort {|t1,t2| t1.name <=> t2.name}
400
409
  zones.each {|zone| zone.write_index_record(file)}
401
-
410
+
402
411
  file.puts(' end') # end module Timezones
403
412
  file.puts(' end') # end module Indexes
404
413
  file.puts(' end') # end module Data
405
414
  file.puts('end') # end module TZInfo
406
415
  end
407
-
416
+
408
417
  end
409
418
  end
410
-
419
+
411
420
  # Base class for all rule sets.
412
421
  #
413
422
  # @private
414
423
  class TZDataRules #:nodoc:
415
424
  # Name of the rule set, e.g. EU.
416
425
  attr_reader :name
417
-
426
+
418
427
  def initialize(name)
419
428
  @name = name
420
429
  end
421
-
430
+
422
431
  def count
423
432
  0
424
433
  end
425
434
  end
426
-
435
+
427
436
  # Empty rule set with a fixed daylight savings (std) offset.
428
437
  #
429
438
  # @private
430
439
  class TZDataFixedOffsetRules < TZDataRules #:nodoc:
431
440
  attr_reader :offset
432
-
441
+
433
442
  def initialize(offset)
434
443
  super(offset.to_s)
435
444
  @offset = offset
436
- end
445
+ end
437
446
  end
438
-
447
+
439
448
  # An empty set of rules.
440
449
  #
441
450
  # @private
@@ -444,38 +453,38 @@ module TZInfo
444
453
  super('-')
445
454
  end
446
455
  end
447
-
456
+
448
457
  # A rule set (as defined by Rule name in the tz data).
449
458
  #
450
459
  # @private
451
- class TZDataRuleSet < TZDataRules #:nodoc:
460
+ class TZDataRuleSet < TZDataRules #:nodoc:
452
461
  attr_reader :rules
453
-
462
+
454
463
  def initialize(name)
455
464
  super
456
465
  @rules = []
457
466
  end
458
-
467
+
459
468
  # Adds a new rule to the set.
460
469
  def add_rule(rule)
461
470
  @rules << rule
462
471
  end
463
-
472
+
464
473
  def count
465
474
  @rules.length
466
475
  end
467
-
476
+
468
477
  def each
469
478
  @rules.each {|rule| yield rule}
470
479
  end
471
- end
472
-
480
+ end
481
+
473
482
  # A rule in a RuleSet (a single Rule line in the tz data).
474
483
  #
475
484
  # @private
476
485
  class TZDataRule #:nodoc:
477
486
  include TZDataParserUtils
478
-
487
+
479
488
  attr_reader :from
480
489
  attr_reader :to
481
490
  attr_reader :type
@@ -484,15 +493,15 @@ module TZInfo
484
493
  attr_reader :at_time
485
494
  attr_reader :save
486
495
  attr_reader :letter
487
-
496
+
488
497
  def initialize(from, to, type, in_month, on_day, at_time, save, letter)
489
498
  @from = parse_from(from)
490
499
  @to = parse_to(to)
491
-
500
+
492
501
  # replace a to of :only with the from year
493
502
  raise 'to cannot be only if from is minimum' if @to == :only && @from == :min
494
- @to = @from if @to == :only
495
-
503
+ @to = @from if @to == :only
504
+
496
505
  @type = parse_type(type)
497
506
  @in_month = parse_month(in_month)
498
507
  @on_day = TZDataDayOfMonth.new(on_day)
@@ -500,22 +509,23 @@ module TZInfo
500
509
  @save = parse_offset(save)
501
510
  @letter = parse_letter(letter)
502
511
  end
503
-
512
+
504
513
  def activate(year)
505
514
  # The following test ignores yearistype at present (currently unused in
506
515
  # the data. parse_type currently excepts on encountering a year type.
507
- if (@from == :min || @from <= year) && (@to == :max || @to >= year)
516
+ if (@from == :min || @from <= year) && (@to == :max || @to >= year)
508
517
  TZDataActivatedRule.new(self, year)
509
518
  else
510
519
  nil
511
520
  end
512
521
  end
513
-
522
+
514
523
  def at_utc_time(year, utc_offset, std_offset)
524
+ absolute = @on_day.to_absolute(year, @in_month)
515
525
  @at_time.to_utc(utc_offset, std_offset,
516
- year, @in_month, @on_day.to_absolute(year, @in_month))
526
+ absolute.year, absolute.month, absolute.day)
517
527
  end
518
-
528
+
519
529
  private
520
530
  def parse_from(from)
521
531
  lower = from.downcase
@@ -527,7 +537,7 @@ module TZInfo
527
537
  raise "Invalid from: #{from}"
528
538
  end
529
539
  end
530
-
540
+
531
541
  def parse_to(to)
532
542
  lower = to.downcase
533
543
  if lower =~ /^max/
@@ -540,12 +550,12 @@ module TZInfo
540
550
  raise "Invalid to: #{to}"
541
551
  end
542
552
  end
543
-
553
+
544
554
  def parse_type(type)
545
555
  raise "Unsupported rule type: #{type}" if type != '-'
546
556
  nil
547
- end
548
-
557
+ end
558
+
549
559
  def parse_letter(letter)
550
560
  if letter == '-'
551
561
  nil
@@ -554,40 +564,40 @@ module TZInfo
554
564
  end
555
565
  end
556
566
  end
557
-
567
+
558
568
  # Base class for Zones and Links.
559
569
  #
560
570
  # @private
561
571
  class TZDataDefinition #:nodoc:
562
572
  include TZDataParserUtils
563
-
573
+
564
574
  attr_reader :name
565
575
  attr_reader :name_elements
566
576
  attr_reader :path_elements
567
-
577
+
568
578
  def initialize(name)
569
579
  @name = name
570
-
580
+
571
581
  # + and - aren't allowed in class names
572
582
  @name_elements = name.gsub(/-/, '__m__').gsub(/\+/, '__p__').split(/\//)
573
583
  @path_elements = @name_elements.clone
574
584
  @path_elements.pop
575
- end
576
-
585
+ end
586
+
577
587
  # Creates necessary directories, the file, writes the class header and footer
578
- # and yields to a block to write the content.
579
- def create_file(output_dir)
588
+ # and yields to a block to write the content.
589
+ def create_file(output_dir)
580
590
  dir = File.join(output_dir, 'definitions', @path_elements.join(File::SEPARATOR))
581
591
  FileUtils.mkdir_p(dir)
582
-
592
+
583
593
  open_file(File.join(output_dir, 'definitions', @name_elements.join(File::SEPARATOR)) + '.rb', 'w', :external_encoding => 'UTF-8', :universal_newline => true) do |file|
584
594
 
585
595
  file.instance_variable_set(:@tz_indent, 0)
586
-
596
+
587
597
  def file.indent(by)
588
598
  @tz_indent += by
589
599
  end
590
-
600
+
591
601
  def file.puts(s)
592
602
  super("#{' ' * @tz_indent}#{s}")
593
603
  end
@@ -595,28 +605,28 @@ module TZInfo
595
605
  file.puts('# encoding: UTF-8')
596
606
  file.puts('')
597
607
  file.puts('# This file contains data derived from the IANA Time Zone Database')
598
- file.puts('# (http://www.iana.org/time-zones).')
608
+ file.puts('# (https://www.iana.org/time-zones).')
599
609
  file.puts('')
600
610
  file.puts('module TZInfo')
601
611
  file.indent(2)
602
612
  file.puts('module Data')
603
613
  file.indent(2)
604
614
  file.puts('module Definitions')
605
- file.indent(2)
606
-
607
- @name_elements.each do |part|
615
+ file.indent(2)
616
+
617
+ @name_elements.each do |part|
608
618
  file.puts("module #{part}")
609
619
  file.indent(2)
610
620
  end
611
-
621
+
612
622
  file.puts('include TimezoneDefinition')
613
623
  file.puts('')
614
-
624
+
615
625
  yield file
616
-
626
+
617
627
  @name_elements.each do
618
- file.indent(-2)
619
- file.puts('end')
628
+ file.indent(-2)
629
+ file.puts('end')
620
630
  end
621
631
  file.indent(-2)
622
632
  file.puts('end') # end module Definitions
@@ -625,88 +635,88 @@ module TZInfo
625
635
  file.indent(-2)
626
636
  file.puts('end') # end module TZInfo
627
637
  end
628
- end
638
+ end
629
639
  end
630
-
640
+
631
641
  # A tz data Link.
632
642
  #
633
643
  # @private
634
644
  class TZDataLink < TZDataDefinition #:nodoc:
635
645
  include TZDataParserUtils
636
-
646
+
637
647
  attr_reader :link_to
638
-
648
+
639
649
  def initialize(name, link_to)
640
650
  super(name)
641
651
  @link_to = link_to
642
652
  end
643
-
653
+
644
654
  # Writes a module for this link.
645
655
  def write_module(output_dir)
646
656
  puts "writing link #{name}"
647
-
657
+
648
658
  create_file(output_dir) {|file|
649
- file.puts("linked_timezone #{quote_str(@name)}, #{quote_str(@link_to.name)}")
659
+ file.puts("linked_timezone #{quote_str(@name)}, #{quote_str(@link_to.name)}")
650
660
  }
651
661
  end
652
-
653
- # Writes an index record for this link.
662
+
663
+ # Writes an index record for this link.
654
664
  def write_index_record(file)
655
665
  file.puts(" linked_timezone #{quote_str(@name)}")
656
666
  end
657
667
  end
658
-
668
+
659
669
  # A tz data Zone. Each line from the tz data is loaded as a TZDataObservance.
660
670
  #
661
671
  # @private
662
672
  class TZDataZone < TZDataDefinition #:nodoc:
663
673
  include TZDataParserUtils
664
-
674
+
665
675
  attr_reader :observances
666
-
676
+
667
677
  def initialize(name, years)
668
678
  super(name)
669
679
  @years = years
670
680
  @observances = []
671
681
  end
672
-
673
- def add_observance(observance)
682
+
683
+ def add_observance(observance)
674
684
  @observances << observance
675
- end
676
-
685
+ end
686
+
677
687
  # Writes the module for the zone. Iterates all the periods and asks them
678
688
  # to write all periods in the timezone.
679
- def write_module(output_dir)
689
+ def write_module(output_dir)
680
690
  puts "writing zone #{name}"
681
-
682
- create_file(output_dir) {|file|
683
-
691
+
692
+ create_file(output_dir) {|file|
693
+
684
694
  file.puts("timezone #{quote_str(@name)} do |tz|")
685
695
  file.indent(2)
686
-
696
+
687
697
  transitions = find_transitions
688
698
  transitions.output_module(file)
689
-
699
+
690
700
  file.indent(-2)
691
701
  file.puts('end')
692
- }
702
+ }
693
703
  end
694
-
695
- # Writes an index record for this zone.
704
+
705
+ # Writes an index record for this zone.
696
706
  def write_index_record(file)
697
707
  file.puts(" timezone #{quote_str(@name)}")
698
708
  end
699
-
709
+
700
710
  private
701
711
  def find_transitions
702
712
  transitions = TZDataTransitions.new(@years)
703
-
713
+
704
714
  # algorithm from zic.c outzone
705
-
715
+
706
716
  start_time = nil
707
717
  until_time = nil
708
-
709
-
718
+
719
+
710
720
  @observances.each_with_index {|observance, i|
711
721
  std_offset = 0
712
722
  use_start = i > 0
@@ -715,11 +725,11 @@ module TZInfo
715
725
  start_zone_id = nil
716
726
  start_utc_offset = observance.utc_offset
717
727
  start_std_offset = 0
718
-
728
+
719
729
  if observance.rule_set.count == 0
720
730
  std_offset = observance.std_offset
721
731
  start_zone_id = observance.format.expand(utc_offset, std_offset, nil)
722
-
732
+
723
733
  if use_start
724
734
  transitions << TZDataTransition.new(start_time, utc_offset, std_offset, start_zone_id)
725
735
  use_start = false
@@ -727,38 +737,38 @@ module TZInfo
727
737
  # zic algorithm only outputs this if std_offset is non-zero
728
738
  # to get the initial LMT range, we output this regardless
729
739
  transitions << TZDataTransition.new(nil, utc_offset, std_offset, start_zone_id)
730
- end
740
+ end
731
741
  else
732
742
  @years.each {|year|
733
743
  if use_until && year > observance.valid_until.year
734
744
  break
735
745
  end
736
-
746
+
737
747
  activated_rules = []
738
-
748
+
739
749
  observance.rule_set.each {|rule|
740
750
  activated_rule = rule.activate(year)
741
751
  activated_rules << activated_rule unless activated_rule.nil?
742
752
  }
743
-
744
- while true
753
+
754
+ while true
745
755
  # turn until_time into UTC using the current utc_offset and std_offset
746
756
  until_time = observance.valid_until.to_utc(utc_offset, std_offset) if use_until
747
-
757
+
748
758
  earliest = nil
749
759
 
750
- activated_rules.each {|activated_rule|
760
+ activated_rules.each {|activated_rule|
751
761
  # recalculate the time using the current std_offset
752
- activated_rule.calculate_time(utc_offset, std_offset)
753
- earliest = activated_rule if earliest.nil? || activated_rule.at < earliest.at
762
+ activated_rule.calculate_time(utc_offset, std_offset)
763
+ earliest = activated_rule if earliest.nil? || activated_rule.at < earliest.at
754
764
  }
755
-
756
- break if earliest.nil?
757
- activated_rules.delete(earliest)
758
- break if use_until && earliest.at >= until_time
759
- std_offset = earliest.rule.save
765
+
766
+ break if earliest.nil?
767
+ activated_rules.delete(earliest)
768
+ break if use_until && earliest.at >= until_time
769
+ std_offset = earliest.rule.save
760
770
  use_start = false if use_start && earliest.at == start_time
761
-
771
+
762
772
  if use_start
763
773
  if earliest.at < start_time
764
774
  start_utc_offset = observance.utc_offset
@@ -766,49 +776,49 @@ module TZInfo
766
776
  start_zone_id = observance.format.expand(start_utc_offset, earliest.rule.save, earliest.rule.letter)
767
777
  next
768
778
  end
769
-
779
+
770
780
  if start_zone_id.nil? && start_utc_offset + start_std_offset == observance.utc_offset + std_offset
771
781
  start_zone_id = observance.format.expand(start_utc_offset, earliest.rule.save, earliest.rule.letter)
772
782
  end
773
783
  end
774
-
784
+
775
785
  zone_id = observance.format.expand(observance.utc_offset, earliest.rule.save, earliest.rule.letter)
776
786
  transitions << TZDataTransition.new(earliest.at, observance.utc_offset, earliest.rule.save, zone_id)
777
- end
787
+ end
778
788
  }
779
789
  end
780
-
790
+
781
791
  if use_start
782
792
  start_zone_id = observance.format.expand(nil, nil, nil) if start_zone_id.nil? && observance.format.fixed?
783
- raise 'Could not determine time zone abbreviation to use just after until time' if start_zone_id.nil?
793
+ raise 'Could not determine time zone abbreviation to use just after until time' if start_zone_id.nil?
784
794
  transitions << TZDataTransition.new(start_time, start_utc_offset, start_std_offset, start_zone_id)
785
795
  end
786
-
787
- start_time = observance.valid_until.to_utc(utc_offset, std_offset) if use_until
796
+
797
+ start_time = observance.valid_until.to_utc(utc_offset, std_offset) if use_until
788
798
  }
789
-
799
+
790
800
  transitions
791
801
  end
792
802
  end
793
-
803
+
794
804
  # A observance within a zone (a line within the zone definition).
795
805
  #
796
806
  # @private
797
807
  class TZDataObservance #:nodoc:
798
808
  include TZDataParserUtils
799
-
809
+
800
810
  attr_reader :utc_offset
801
811
  attr_reader :rule_set
802
812
  attr_reader :format
803
813
  attr_reader :valid_until
804
-
814
+
805
815
  def initialize(utc_offset, rule_set, format, valid_until)
806
816
  @utc_offset = parse_offset(utc_offset)
807
- @rule_set = rule_set
817
+ @rule_set = rule_set
808
818
  @format = TZDataFormat.new(format)
809
- @valid_until = valid_until.nil? ? nil : TZDataUntil.new(valid_until)
810
- end
811
-
819
+ @valid_until = valid_until.nil? ? nil : TZDataUntil.new(valid_until)
820
+ end
821
+
812
822
  def std_offset
813
823
  if @rule_set.kind_of?(TZDataFixedOffsetRules)
814
824
  @rule_set.offset
@@ -817,159 +827,159 @@ module TZInfo
817
827
  end
818
828
  end
819
829
  end
820
-
830
+
821
831
  # Collection of TZDataTransition instances used when building a zone class.
822
832
  #
823
833
  # @private
824
834
  class TZDataTransitions #:nodoc:
825
835
  include TZDataParserUtils
826
-
836
+
827
837
  def initialize(years)
828
838
  @years = years
829
839
  @transitions = []
830
840
  end
831
-
841
+
832
842
  def << (transition)
833
843
  @transitions << transition
834
- end
835
-
844
+ end
845
+
836
846
  def output_module(file)
837
847
  optimize
838
-
848
+
839
849
  # Try and end on a transition to std if one happens in the last year.
840
- if @transitions.length > 1 &&
850
+ if @transitions.length > 1 &&
841
851
  @transitions.last.std_offset != 0 &&
842
852
  @transitions[@transitions.length - 2].std_offset == 0 &&
843
853
  @transitions[@transitions.length - 2].at_utc.year == @years.max
844
-
854
+
845
855
  transitions = @transitions[0..@transitions.length - 2]
846
856
  else
847
857
  transitions = @transitions
848
858
  end
849
-
859
+
850
860
  process_offsets(file)
851
861
  file.puts('')
852
-
853
- transitions.each do |t|
862
+
863
+ transitions.each do |t|
854
864
  t.write(file)
855
- end
865
+ end
856
866
  end
857
-
867
+
858
868
  private
859
869
  def optimize
860
870
  @transitions.sort!
861
-
871
+
862
872
  # Optimization logic from zic.c writezone.
863
-
873
+
864
874
  from_i = 0
865
875
  to_i = 0
866
-
876
+
867
877
  while from_i < @transitions.length
868
- if to_i > 1 &&
878
+ if to_i > 1 &&
869
879
  !@transitions[from_i].at_utc.nil? &&
870
880
  !@transitions[to_i - 1].at_utc.nil? &&
871
881
  @transitions[from_i].at_utc + Rational(@transitions[to_i - 1].total_offset, 86400) <=
872
882
  @transitions[to_i - 1].at_utc + Rational(@transitions[to_i - 2].total_offset, 86400)
873
-
874
- @transitions[to_i - 1] = @transitions[from_i].clone_with_at(@transitions[to_i - 1].at_utc)
883
+
884
+ @transitions[to_i - 1] = @transitions[from_i].clone_with_at(@transitions[to_i - 1].at_utc)
875
885
  from_i += 1
876
886
  next
877
887
  end
878
-
879
- # Shuffle transitions up, eliminating any redundant transitions
888
+
889
+ # Shuffle transitions up, eliminating any redundant transitions
880
890
  # along the way.
881
891
  if to_i == 0 ||
882
892
  @transitions[to_i - 1].utc_offset != @transitions[from_i].utc_offset ||
883
893
  @transitions[to_i - 1].std_offset != @transitions[from_i].std_offset ||
884
894
  @transitions[to_i - 1].zone_id != @transitions[from_i].zone_id
885
-
895
+
886
896
  @transitions[to_i] = @transitions[from_i]
887
- to_i += 1
897
+ to_i += 1
888
898
  end
889
-
899
+
890
900
  from_i += 1
891
- end
892
-
901
+ end
902
+
893
903
  if to_i > 0
894
904
  @transitions = @transitions[0..to_i - 1]
895
905
  else
896
906
  @transitions = []
897
- end
907
+ end
898
908
  end
899
-
900
- def quote_zone_id(zone_id)
909
+
910
+ def quote_zone_id(zone_id)
901
911
  if zone_id =~ %r{[\-+']}
902
- ":#{quote_str(zone_id)}"
912
+ ":#{quote_str(zone_id)}"
903
913
  else
904
914
  ":#{zone_id}"
905
915
  end
906
- end
907
-
916
+ end
917
+
908
918
  def process_offsets(file)
909
919
  # A bit of a hack at the moment. The offset used to be output with
910
920
  # each period (pair of transitions). They are now separated from the
911
921
  # transition data. The code should probably be changed at some point to
912
- # setup the offsets at an earlier stage.
913
-
922
+ # setup the offsets at an earlier stage.
923
+
914
924
  # Assume that when this is called, the first transition is the Local
915
925
  # Mean Time initial rule or a transition with no time that defines the
916
926
  # offset for the entire zone.
917
-
927
+
918
928
  offsets = []
919
-
929
+
920
930
  # Find the first std offset. Timezones always start in std.
921
931
  @transitions.each do |t|
922
932
  if t.std_offset == 0
923
- offset = {:utc_offset => t.utc_offset,
933
+ offset = {:utc_offset => t.utc_offset,
924
934
  :std_offset => t.std_offset,
925
935
  :zone_id => t.zone_id,
926
936
  :name => 'o0'}
927
-
937
+
928
938
  offsets << offset
929
939
  break
930
940
  end
931
941
  end
932
-
942
+
933
943
  @transitions.each do |t|
934
- offset = offsets.find do |o|
944
+ offset = offsets.find do |o|
935
945
  o[:utc_offset] == t.utc_offset &&
936
946
  o[:std_offset] == t.std_offset &&
937
947
  o[:zone_id] == t.zone_id
938
948
  end
939
-
949
+
940
950
  unless offset
941
- offset = {:utc_offset => t.utc_offset,
951
+ offset = {:utc_offset => t.utc_offset,
942
952
  :std_offset => t.std_offset,
943
953
  :zone_id => t.zone_id,
944
954
  :name => "o#{offsets.length}"}
945
-
955
+
946
956
  offsets << offset
947
957
  end
948
-
958
+
949
959
  t.offset_name = offset[:name]
950
960
  end
951
-
961
+
952
962
  offsets.each do |offset|
953
963
  file.puts("tz.offset :#{offset[:name]}, #{offset[:utc_offset]}, #{offset[:std_offset]}, #{quote_zone_id(offset[:zone_id])}")
954
964
  end
955
-
965
+
956
966
  end
957
967
  end
958
-
968
+
959
969
  # A transition that will be used to write the periods in a zone class.
960
970
  #
961
971
  # @private
962
972
  class TZDataTransition #:nodoc:
963
973
  include Comparable
964
-
974
+
965
975
  EPOCH = DateTime.new(1970, 1, 1)
966
-
976
+
967
977
  attr_reader :at_utc
968
978
  attr_reader :utc_offset
969
979
  attr_reader :std_offset
970
980
  attr_reader :zone_id
971
981
  attr_accessor :offset_name
972
-
982
+
973
983
  def initialize(at_utc, utc_offset, std_offset, zone_id)
974
984
  @at_utc = at_utc
975
985
  @utc_offset = utc_offset
@@ -977,11 +987,11 @@ module TZInfo
977
987
  @zone_id = zone_id
978
988
  @offset_name = nil
979
989
  end
980
-
990
+
981
991
  def to_s
982
992
  "At #{at_utc} UTC switch to UTC offset #{@utc_offset} with std offset #{@std_offset}, zone id #{@zone_id}"
983
993
  end
984
-
994
+
985
995
  def <=>(transition)
986
996
  if @at_utc == transition.at_utc
987
997
  0
@@ -989,29 +999,29 @@ module TZInfo
989
999
  -1
990
1000
  elsif transition.nil?
991
1001
  1
992
- else
1002
+ else
993
1003
  @at_utc - transition.at_utc
994
1004
  end
995
1005
  end
996
-
1006
+
997
1007
  def total_offset
998
1008
  @utc_offset + @std_offset
999
1009
  end
1000
-
1010
+
1001
1011
  def clone_with_at(at_utc)
1002
1012
  TZDataTransition.new(at_utc, @utc_offset, @std_offset, @zone_id)
1003
1013
  end
1004
-
1005
- def write(file)
1014
+
1015
+ def write(file)
1006
1016
  if @at_utc
1007
- file.puts "tz.transition #{@at_utc.year}, #{@at_utc.mon}, :#{@offset_name}, #{timestamp_parameters(@at_utc)}"
1008
- end
1017
+ file.puts "tz.transition #{@at_utc.year}, #{@at_utc.mon}, :#{@offset_name}, #{timestamp_parameters(@at_utc)}"
1018
+ end
1009
1019
  end
1010
-
1020
+
1011
1021
  private
1012
1022
  def timestamp_parameters(datetime)
1013
1023
  timestamp = ((datetime - EPOCH) * 86400).to_i
1014
-
1024
+
1015
1025
  if timestamp < 0 || timestamp > 2147483647
1016
1026
  # Output DateTime parameters as well as a timestamp for platforms
1017
1027
  # where Time doesn't support negative or 64-bit values.
@@ -1021,7 +1031,7 @@ module TZInfo
1021
1031
  end
1022
1032
  end
1023
1033
  end
1024
-
1034
+
1025
1035
  # An instance of a rule for a year.
1026
1036
  #
1027
1037
  # @private
@@ -1029,56 +1039,64 @@ module TZInfo
1029
1039
  attr_reader :rule
1030
1040
  attr_reader :year
1031
1041
  attr_reader :at
1032
-
1042
+
1033
1043
  def initialize(rule, year)
1034
1044
  @rule = rule
1035
1045
  @year = year
1036
1046
  @at = nil
1037
1047
  end
1038
-
1048
+
1039
1049
  def calculate_time(utc_offset, std_offset)
1040
1050
  @at = @rule.at_utc_time(@year, utc_offset, std_offset)
1041
1051
  end
1042
1052
  end
1043
-
1044
- # A tz data time definition - an hour, minute, second and reference. Reference
1045
- # is either :utc, :standard or :wall_clock.
1053
+
1054
+ # A tz data time definition - a sign (1 or -1), hour, minute, second and
1055
+ # reference (:utc, :standard or :wall_clock).
1046
1056
  #
1047
1057
  # @private
1048
1058
  class TZDataTime #:nodoc:
1059
+ attr_reader :sign
1049
1060
  attr_reader :hour
1050
1061
  attr_reader :minute
1051
1062
  attr_reader :second
1052
1063
  attr_reader :ref
1053
-
1064
+
1054
1065
  def initialize(spec)
1055
- raise "Invalid time: #{spec}" if spec !~ /^([0-9]+)(:([0-9]+)(:([0-9]+))?)?([wguzs])?$/
1056
-
1057
- @hour = $1.to_i
1058
- @minute = $3.nil? ? 0 : $3.to_i
1059
- @second = $5.nil? ? 0 : $5.to_i
1060
-
1061
- if $6 == 's'
1066
+ raise "Invalid time: #{spec}" if spec !~ /^(-?)([0-9]+)(:([0-9]+)(:([0-9]+))?)?([wguzs])?$/
1067
+
1068
+ @sign = $1 == '-' ? -1 : 1
1069
+ @hour = $2.to_i
1070
+ @minute = $4.nil? ? 0 : $4.to_i
1071
+ @second = $6.nil? ? 0 : $6.to_i
1072
+
1073
+ if $7 == 's'
1062
1074
  @ref = :standard
1063
- elsif $6 == 'g' || $6 == 'u' || $6 == 'z'
1075
+ elsif $7 == 'g' || $7 == 'u' || $7 == 'z'
1064
1076
  @ref = :utc
1065
1077
  else
1066
1078
  @ref = :wall_clock
1067
1079
  end
1068
1080
  end
1069
-
1081
+
1070
1082
  # Converts the time to UTC given a utc_offset and std_offset.
1071
- def to_utc(utc_offset, std_offset, year, month, day)
1072
- result = DateTime.new(year, month, day, @hour, @minute, @second)
1083
+ def to_utc(utc_offset, std_offset, year, month, day)
1084
+ result = if @hour > 24 || @hour == 24 && (@minute > 0 || @second > 0) || @sign != 1
1085
+ DateTime.new(year, month, day, 0, 0, 0) + Rational(@sign * (@second + (@minute + @hour * 60) * 60), 86400)
1086
+ else
1087
+ DateTime.new(year, month, day, @hour, @minute, @second)
1088
+ end
1089
+
1073
1090
  offset = 0
1074
- offset = offset + utc_offset if @ref == :standard || @ref == :wall_clock
1075
- offset = offset + std_offset if @ref == :wall_clock
1076
- result - Rational(offset, 86400)
1091
+ offset = offset + utc_offset if @ref == :standard || @ref == :wall_clock
1092
+ offset = offset + std_offset if @ref == :wall_clock
1093
+ result - Rational(offset, 86400)
1077
1094
  end
1078
1095
  end
1079
-
1096
+
1080
1097
  # A tz data day of the month reference. Can either be an absolute day,
1081
- # a last week day or a week day >= or <= than a specific day of month.
1098
+ # a last week day or a week day >= or <= than a specific day of month. Can
1099
+ # result in a day in the neighbouring month.
1082
1100
  #
1083
1101
  # @private
1084
1102
  class TZDataDayOfMonth #:nodoc:
@@ -1086,10 +1104,10 @@ module TZInfo
1086
1104
  attr_reader :day_of_month
1087
1105
  attr_reader :day_of_week
1088
1106
  attr_reader :operator
1089
-
1107
+
1090
1108
  def initialize(spec)
1091
1109
  raise "Invalid on: #{spec}" if spec !~ /^([0-9]+)|(last([A-Za-z]+))|(([A-Za-z]+)([<>]=)([0-9]+))$/
1092
-
1110
+
1093
1111
  if $1
1094
1112
  @type = :absolute
1095
1113
  @day_of_month = $1.to_i
@@ -1103,34 +1121,27 @@ module TZInfo
1103
1121
  @day_of_month = $7.to_i
1104
1122
  end
1105
1123
  end
1106
-
1107
- # Returns the absolute day of month for the given year and month.
1124
+
1125
+ # Returns the absolute date for the given year and month.
1108
1126
  def to_absolute(year, month)
1109
1127
  case @type
1110
1128
  when :last
1111
- last_day_in_month = (Date.new(year, month, 1) >> 1) - 1
1129
+ last_day_in_month = (Date.new(year, month, 1) >> 1) - 1
1112
1130
  offset = last_day_in_month.wday - @day_of_week
1113
1131
  offset = offset + 7 if offset < 0
1114
- (last_day_in_month - offset).day
1132
+ last_day_in_month - offset
1115
1133
  when :comparison
1116
- pivot = Date.new(year, month, @day_of_month)
1134
+ pivot = Date.new(year, month, @day_of_month)
1117
1135
  offset = @day_of_week - pivot.wday
1118
1136
  offset = -offset if @operator == :less_equal
1119
1137
  offset = offset + 7 if offset < 0
1120
- offset = -offset if @operator == :less_equal
1121
- result = pivot + offset
1122
- if result.month != pivot.month
1123
- puts self.inspect
1124
- puts year
1125
- puts month
1126
- end
1127
- raise 'No suitable date found' if result.month != pivot.month
1128
- result.day
1138
+ offset = -offset if @operator == :less_equal
1139
+ pivot + offset
1129
1140
  else #absolute
1130
- @day_of_month
1141
+ Date.new(year, month, @day_of_month)
1131
1142
  end
1132
1143
  end
1133
-
1144
+
1134
1145
  private
1135
1146
  def parse_day_of_week(day_of_week)
1136
1147
  lower = day_of_week.downcase
@@ -1152,7 +1163,7 @@ module TZInfo
1152
1163
  raise "Invalid day of week: #{day_of_week}"
1153
1164
  end
1154
1165
  end
1155
-
1166
+
1156
1167
  def parse_operator(operator)
1157
1168
  if operator == '>='
1158
1169
  :greater_equal
@@ -1162,40 +1173,41 @@ module TZInfo
1162
1173
  raise "Invalid operator: #{operator}"
1163
1174
  end
1164
1175
  end
1165
- end
1166
-
1176
+ end
1177
+
1167
1178
  # A tz data Zone until reference.
1168
1179
  #
1169
1180
  # @private
1170
1181
  class TZDataUntil #:nodoc:
1171
1182
  include TZDataParserUtils
1172
-
1183
+
1173
1184
  attr_reader :year
1174
1185
  attr_reader :month
1175
1186
  attr_reader :day
1176
1187
  attr_reader :time
1177
-
1178
- def initialize(spec)
1179
- parts = spec.split(/\s+/)
1188
+
1189
+ def initialize(spec)
1190
+ parts = spec.split(/\s+/)
1180
1191
  raise "Invalid until: #{spec}" if parts.length < 1
1181
-
1192
+
1182
1193
  @year = parts[0].to_i
1183
1194
  @month = parts.length > 1 ? parse_month(parts[1]) : 1
1184
1195
  @day = TZDataDayOfMonth.new(parts.length > 2 ? parts[2] : '1')
1185
1196
  @time = TZDataTime.new(parts.length > 3 ? parts[3] : '00:00')
1186
1197
  end
1187
-
1198
+
1188
1199
  # Converts the reference to a UTC DateTime.
1189
1200
  def to_utc(utc_offset, std_offset)
1190
- @time.to_utc(utc_offset, std_offset, @year, @month, @day.to_absolute(@year, @month))
1201
+ absolute = @day.to_absolute(@year, @month)
1202
+ @time.to_utc(utc_offset, std_offset, absolute.year, absolute.month, absolute.day)
1191
1203
  end
1192
1204
  end
1193
-
1205
+
1194
1206
  # A tz data Zone format string. Either alternate standard/daylight-savings,
1195
1207
  # substitution (%s) format or a fixed string.
1196
1208
  #
1197
1209
  # @private
1198
- class TZDataFormat #:nodoc:
1210
+ class TZDataFormat #:nodoc:
1199
1211
  def initialize(spec)
1200
1212
  if spec =~ /\A([^\/]*)\/(.*)\z/
1201
1213
  @type = :alternate
@@ -1209,7 +1221,7 @@ module TZInfo
1209
1221
  @abbrev = spec
1210
1222
  end
1211
1223
  end
1212
-
1224
+
1213
1225
  # Expands given the base offset to UTC, the current daylight savings
1214
1226
  # offset and rule string.
1215
1227
  def expand(utc_offset, std_offset, rule_string)
@@ -1225,14 +1237,14 @@ module TZInfo
1225
1237
  end
1226
1238
  else
1227
1239
  @abbrev
1228
- end
1240
+ end
1229
1241
  end
1230
-
1242
+
1231
1243
  # True if the format requires substitutions (%s or %z).
1232
1244
  def subst?
1233
1245
  @type == :subst
1234
1246
  end
1235
-
1247
+
1236
1248
  # Is a fixed format string.
1237
1249
  def fixed?
1238
1250
  @type == :fixed
@@ -1270,67 +1282,67 @@ module TZInfo
1270
1282
  end
1271
1283
  end
1272
1284
  end
1273
-
1285
+
1274
1286
  # A location (latitude + longitude)
1275
1287
  #
1276
1288
  # @private
1277
1289
  class TZDataLocation #:nodoc:
1278
1290
  attr_reader :latitude
1279
1291
  attr_reader :longitude
1280
-
1281
- # Constructs a new TZDataLocation from a string in ISO 6709
1282
- # sign-degrees-minutes-seconds format, either +-DDMM+-DDDMM
1283
- # or +-DDMMSS+-DDDMMSS, first latitude (+ is north),
1292
+
1293
+ # Constructs a new TZDataLocation from a string in ISO 6709
1294
+ # sign-degrees-minutes-seconds format, either +-DDMM+-DDDMM
1295
+ # or +-DDMMSS+-DDDMMSS, first latitude (+ is north),
1284
1296
  # then longitude (+ is east).
1285
1297
  def initialize(coordinates)
1286
1298
  if coordinates !~ /^([+\-])([0-9]{2})([0-9]{2})([0-9]{2})?([+\-])([0-9]{3})([0-9]{2})([0-9]{2})?$/
1287
1299
  raise "Invalid coordinates: #{coordinates}"
1288
1300
  end
1289
-
1301
+
1290
1302
  @latitude = Rational($2.to_i) + Rational($3.to_i, 60)
1291
1303
  @latitude += Rational($4.to_i, 3600) unless $4.nil?
1292
1304
  @latitude = -@latitude if $1 == '-'
1293
-
1305
+
1294
1306
  @longitude = Rational($6.to_i) + Rational($7.to_i, 60)
1295
1307
  @longitude += Rational($8.to_i, 3600) unless $8.nil?
1296
1308
  @longitude = -@longitude if $5 == '-'
1297
1309
  end
1298
- end
1310
+ end
1299
1311
 
1300
1312
  # @private
1301
1313
  TZDataCountryTimezone = Struct.new(:timezone, :description, :location) #:nodoc:
1302
-
1314
+
1303
1315
  # An ISO 3166 country.
1304
1316
  #
1305
1317
  # @private
1306
1318
  class TZDataCountry #:nodoc:
1307
1319
  include TZDataParserUtils
1308
-
1320
+
1309
1321
  attr_reader :code
1310
1322
  attr_reader :name
1311
1323
  attr_reader :zones
1312
-
1324
+
1313
1325
  def initialize(code, name)
1314
1326
  @code = code
1315
1327
  @name = name
1316
1328
  @zones = []
1317
1329
  end
1318
-
1330
+
1319
1331
  # Adds a TZDataCountryTimezone
1320
- def add_zone(zone)
1321
- @zones << zone
1322
- end
1323
-
1332
+ def add_zone(zone)
1333
+ @zones << zone
1334
+ end
1335
+
1324
1336
  def write_index_record(file)
1325
- s = " country #{quote_str(@code)}, #{quote_str(@name)}"
1337
+ s = " country #{quote_str(@code)}, #{quote_str(@name)}"
1326
1338
  s << ' do |c|' if @zones.length > 0
1327
-
1339
+
1328
1340
  file.puts s
1329
-
1341
+
1330
1342
  @zones.each do |zone|
1331
- file.puts " c.timezone #{quote_str(zone.timezone.name)}, #{zone.location.latitude.numerator}, #{zone.location.latitude.denominator}, #{zone.location.longitude.numerator}, #{zone.location.longitude.denominator}#{zone.description.nil? ? '' : ', ' + quote_str(zone.description)}"
1343
+ file.puts " c.timezone #{quote_str(zone.timezone.name)}, #{zone.location.latitude.numerator}, #{zone.location.latitude.denominator}, #{zone.location.longitude.numerator}, #{zone.location.longitude.denominator}#{zone.description.nil? ? '' : ', ' + quote_str(zone.description)}"
1332
1344
  end
1333
-
1345
+
1334
1346
  file.puts ' end' if @zones.length > 0
1335
1347
  end
1336
1348
  end