tzinfo 0.1.2 → 0.2.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 (802) hide show
  1. data/CHANGES +24 -0
  2. data/LICENSE +1 -1
  3. data/Rakefile +5 -1
  4. data/lib/tzinfo/countries/AD.rb +12 -12
  5. data/lib/tzinfo/countries/AE.rb +12 -12
  6. data/lib/tzinfo/countries/AF.rb +12 -12
  7. data/lib/tzinfo/countries/AG.rb +12 -12
  8. data/lib/tzinfo/countries/AI.rb +12 -12
  9. data/lib/tzinfo/countries/AL.rb +12 -12
  10. data/lib/tzinfo/countries/AM.rb +12 -12
  11. data/lib/tzinfo/countries/AN.rb +12 -12
  12. data/lib/tzinfo/countries/AO.rb +12 -12
  13. data/lib/tzinfo/countries/AQ.rb +21 -21
  14. data/lib/tzinfo/countries/AR.rb +21 -21
  15. data/lib/tzinfo/countries/AS.rb +12 -12
  16. data/lib/tzinfo/countries/AT.rb +12 -12
  17. data/lib/tzinfo/countries/AU.rb +22 -22
  18. data/lib/tzinfo/countries/AW.rb +12 -12
  19. data/lib/tzinfo/countries/AX.rb +12 -12
  20. data/lib/tzinfo/countries/AZ.rb +12 -12
  21. data/lib/tzinfo/countries/BA.rb +12 -12
  22. data/lib/tzinfo/countries/BB.rb +12 -12
  23. data/lib/tzinfo/countries/BD.rb +12 -12
  24. data/lib/tzinfo/countries/BE.rb +12 -12
  25. data/lib/tzinfo/countries/BF.rb +12 -12
  26. data/lib/tzinfo/countries/BG.rb +12 -12
  27. data/lib/tzinfo/countries/BH.rb +12 -12
  28. data/lib/tzinfo/countries/BI.rb +12 -12
  29. data/lib/tzinfo/countries/BJ.rb +12 -12
  30. data/lib/tzinfo/countries/BM.rb +12 -12
  31. data/lib/tzinfo/countries/BN.rb +12 -12
  32. data/lib/tzinfo/countries/BO.rb +12 -12
  33. data/lib/tzinfo/countries/BR.rb +26 -26
  34. data/lib/tzinfo/countries/BS.rb +12 -12
  35. data/lib/tzinfo/countries/BT.rb +12 -12
  36. data/lib/tzinfo/countries/BV.rb +11 -11
  37. data/lib/tzinfo/countries/BW.rb +12 -12
  38. data/lib/tzinfo/countries/BY.rb +12 -12
  39. data/lib/tzinfo/countries/BZ.rb +12 -12
  40. data/lib/tzinfo/countries/CA.rb +36 -36
  41. data/lib/tzinfo/countries/CC.rb +12 -12
  42. data/lib/tzinfo/countries/CD.rb +13 -13
  43. data/lib/tzinfo/countries/CF.rb +12 -12
  44. data/lib/tzinfo/countries/CG.rb +12 -12
  45. data/lib/tzinfo/countries/CH.rb +12 -12
  46. data/lib/tzinfo/countries/CI.rb +12 -12
  47. data/lib/tzinfo/countries/CK.rb +12 -12
  48. data/lib/tzinfo/countries/CL.rb +13 -13
  49. data/lib/tzinfo/countries/CM.rb +12 -12
  50. data/lib/tzinfo/countries/CN.rb +16 -16
  51. data/lib/tzinfo/countries/CO.rb +12 -12
  52. data/lib/tzinfo/countries/CR.rb +12 -12
  53. data/lib/tzinfo/countries/CS.rb +12 -12
  54. data/lib/tzinfo/countries/CU.rb +12 -12
  55. data/lib/tzinfo/countries/CV.rb +12 -12
  56. data/lib/tzinfo/countries/CX.rb +12 -12
  57. data/lib/tzinfo/countries/CY.rb +12 -12
  58. data/lib/tzinfo/countries/CZ.rb +12 -12
  59. data/lib/tzinfo/countries/DE.rb +12 -12
  60. data/lib/tzinfo/countries/DJ.rb +12 -12
  61. data/lib/tzinfo/countries/DK.rb +12 -12
  62. data/lib/tzinfo/countries/DM.rb +12 -12
  63. data/lib/tzinfo/countries/DO.rb +12 -12
  64. data/lib/tzinfo/countries/DZ.rb +12 -12
  65. data/lib/tzinfo/countries/EC.rb +13 -13
  66. data/lib/tzinfo/countries/EE.rb +12 -12
  67. data/lib/tzinfo/countries/EG.rb +12 -12
  68. data/lib/tzinfo/countries/EH.rb +12 -12
  69. data/lib/tzinfo/countries/ER.rb +12 -12
  70. data/lib/tzinfo/countries/ES.rb +14 -14
  71. data/lib/tzinfo/countries/ET.rb +12 -12
  72. data/lib/tzinfo/countries/FI.rb +12 -12
  73. data/lib/tzinfo/countries/FJ.rb +12 -12
  74. data/lib/tzinfo/countries/FK.rb +12 -12
  75. data/lib/tzinfo/countries/FM.rb +14 -14
  76. data/lib/tzinfo/countries/FO.rb +12 -12
  77. data/lib/tzinfo/countries/FR.rb +12 -12
  78. data/lib/tzinfo/countries/GA.rb +12 -12
  79. data/lib/tzinfo/countries/GB.rb +12 -12
  80. data/lib/tzinfo/countries/GD.rb +12 -12
  81. data/lib/tzinfo/countries/GE.rb +12 -12
  82. data/lib/tzinfo/countries/GF.rb +12 -12
  83. data/lib/tzinfo/countries/GH.rb +12 -12
  84. data/lib/tzinfo/countries/GI.rb +12 -12
  85. data/lib/tzinfo/countries/GL.rb +15 -15
  86. data/lib/tzinfo/countries/GM.rb +12 -12
  87. data/lib/tzinfo/countries/GN.rb +12 -12
  88. data/lib/tzinfo/countries/GP.rb +12 -12
  89. data/lib/tzinfo/countries/GQ.rb +12 -12
  90. data/lib/tzinfo/countries/GR.rb +12 -12
  91. data/lib/tzinfo/countries/GS.rb +12 -12
  92. data/lib/tzinfo/countries/GT.rb +12 -12
  93. data/lib/tzinfo/countries/GU.rb +12 -12
  94. data/lib/tzinfo/countries/GW.rb +12 -12
  95. data/lib/tzinfo/countries/GY.rb +12 -12
  96. data/lib/tzinfo/countries/HK.rb +12 -12
  97. data/lib/tzinfo/countries/HM.rb +11 -11
  98. data/lib/tzinfo/countries/HN.rb +12 -12
  99. data/lib/tzinfo/countries/HR.rb +12 -12
  100. data/lib/tzinfo/countries/HT.rb +12 -12
  101. data/lib/tzinfo/countries/HU.rb +12 -12
  102. data/lib/tzinfo/countries/ID.rb +15 -15
  103. data/lib/tzinfo/countries/IE.rb +12 -12
  104. data/lib/tzinfo/countries/IL.rb +12 -12
  105. data/lib/tzinfo/countries/IN.rb +12 -12
  106. data/lib/tzinfo/countries/IO.rb +12 -12
  107. data/lib/tzinfo/countries/IQ.rb +12 -12
  108. data/lib/tzinfo/countries/IR.rb +12 -12
  109. data/lib/tzinfo/countries/IS.rb +12 -12
  110. data/lib/tzinfo/countries/IT.rb +12 -12
  111. data/lib/tzinfo/countries/JM.rb +12 -12
  112. data/lib/tzinfo/countries/JO.rb +12 -12
  113. data/lib/tzinfo/countries/JP.rb +12 -12
  114. data/lib/tzinfo/countries/KE.rb +12 -12
  115. data/lib/tzinfo/countries/KG.rb +12 -12
  116. data/lib/tzinfo/countries/KH.rb +12 -12
  117. data/lib/tzinfo/countries/KI.rb +14 -14
  118. data/lib/tzinfo/countries/KM.rb +12 -12
  119. data/lib/tzinfo/countries/KN.rb +12 -12
  120. data/lib/tzinfo/countries/KP.rb +12 -12
  121. data/lib/tzinfo/countries/KR.rb +12 -12
  122. data/lib/tzinfo/countries/KW.rb +12 -12
  123. data/lib/tzinfo/countries/KY.rb +12 -12
  124. data/lib/tzinfo/countries/KZ.rb +16 -16
  125. data/lib/tzinfo/countries/LA.rb +12 -12
  126. data/lib/tzinfo/countries/LB.rb +12 -12
  127. data/lib/tzinfo/countries/LC.rb +12 -12
  128. data/lib/tzinfo/countries/LI.rb +12 -12
  129. data/lib/tzinfo/countries/LK.rb +12 -12
  130. data/lib/tzinfo/countries/LR.rb +12 -12
  131. data/lib/tzinfo/countries/LS.rb +12 -12
  132. data/lib/tzinfo/countries/LT.rb +12 -12
  133. data/lib/tzinfo/countries/LU.rb +12 -12
  134. data/lib/tzinfo/countries/LV.rb +12 -12
  135. data/lib/tzinfo/countries/LY.rb +12 -12
  136. data/lib/tzinfo/countries/MA.rb +12 -12
  137. data/lib/tzinfo/countries/MC.rb +12 -12
  138. data/lib/tzinfo/countries/MD.rb +12 -12
  139. data/lib/tzinfo/countries/MG.rb +12 -12
  140. data/lib/tzinfo/countries/MH.rb +13 -13
  141. data/lib/tzinfo/countries/MK.rb +12 -12
  142. data/lib/tzinfo/countries/ML.rb +12 -12
  143. data/lib/tzinfo/countries/MM.rb +12 -12
  144. data/lib/tzinfo/countries/MN.rb +14 -14
  145. data/lib/tzinfo/countries/MO.rb +12 -12
  146. data/lib/tzinfo/countries/MP.rb +12 -12
  147. data/lib/tzinfo/countries/MQ.rb +12 -12
  148. data/lib/tzinfo/countries/MR.rb +12 -12
  149. data/lib/tzinfo/countries/MS.rb +12 -12
  150. data/lib/tzinfo/countries/MT.rb +12 -12
  151. data/lib/tzinfo/countries/MU.rb +12 -12
  152. data/lib/tzinfo/countries/MV.rb +12 -12
  153. data/lib/tzinfo/countries/MW.rb +12 -12
  154. data/lib/tzinfo/countries/MX.rb +19 -19
  155. data/lib/tzinfo/countries/MY.rb +13 -13
  156. data/lib/tzinfo/countries/MZ.rb +12 -12
  157. data/lib/tzinfo/countries/NA.rb +12 -12
  158. data/lib/tzinfo/countries/NC.rb +12 -12
  159. data/lib/tzinfo/countries/NE.rb +12 -12
  160. data/lib/tzinfo/countries/NF.rb +12 -12
  161. data/lib/tzinfo/countries/NG.rb +12 -12
  162. data/lib/tzinfo/countries/NI.rb +12 -12
  163. data/lib/tzinfo/countries/NL.rb +12 -12
  164. data/lib/tzinfo/countries/NO.rb +12 -12
  165. data/lib/tzinfo/countries/NP.rb +12 -12
  166. data/lib/tzinfo/countries/NR.rb +12 -12
  167. data/lib/tzinfo/countries/NU.rb +12 -12
  168. data/lib/tzinfo/countries/NZ.rb +13 -13
  169. data/lib/tzinfo/countries/OM.rb +12 -12
  170. data/lib/tzinfo/countries/PA.rb +12 -12
  171. data/lib/tzinfo/countries/PE.rb +12 -12
  172. data/lib/tzinfo/countries/PF.rb +14 -14
  173. data/lib/tzinfo/countries/PG.rb +12 -12
  174. data/lib/tzinfo/countries/PH.rb +12 -12
  175. data/lib/tzinfo/countries/PK.rb +12 -12
  176. data/lib/tzinfo/countries/PL.rb +12 -12
  177. data/lib/tzinfo/countries/PM.rb +12 -12
  178. data/lib/tzinfo/countries/PN.rb +12 -12
  179. data/lib/tzinfo/countries/PR.rb +12 -12
  180. data/lib/tzinfo/countries/PS.rb +12 -12
  181. data/lib/tzinfo/countries/PT.rb +14 -14
  182. data/lib/tzinfo/countries/PW.rb +12 -12
  183. data/lib/tzinfo/countries/PY.rb +12 -12
  184. data/lib/tzinfo/countries/QA.rb +12 -12
  185. data/lib/tzinfo/countries/RE.rb +12 -12
  186. data/lib/tzinfo/countries/RO.rb +12 -12
  187. data/lib/tzinfo/countries/RU.rb +25 -25
  188. data/lib/tzinfo/countries/RW.rb +12 -12
  189. data/lib/tzinfo/countries/SA.rb +12 -12
  190. data/lib/tzinfo/countries/SB.rb +12 -12
  191. data/lib/tzinfo/countries/SC.rb +12 -12
  192. data/lib/tzinfo/countries/SD.rb +12 -12
  193. data/lib/tzinfo/countries/SE.rb +12 -12
  194. data/lib/tzinfo/countries/SG.rb +12 -12
  195. data/lib/tzinfo/countries/SH.rb +12 -12
  196. data/lib/tzinfo/countries/SI.rb +12 -12
  197. data/lib/tzinfo/countries/SJ.rb +13 -13
  198. data/lib/tzinfo/countries/SK.rb +12 -12
  199. data/lib/tzinfo/countries/SL.rb +12 -12
  200. data/lib/tzinfo/countries/SM.rb +12 -12
  201. data/lib/tzinfo/countries/SN.rb +12 -12
  202. data/lib/tzinfo/countries/SO.rb +12 -12
  203. data/lib/tzinfo/countries/SR.rb +12 -12
  204. data/lib/tzinfo/countries/ST.rb +12 -12
  205. data/lib/tzinfo/countries/SV.rb +12 -12
  206. data/lib/tzinfo/countries/SY.rb +12 -12
  207. data/lib/tzinfo/countries/SZ.rb +12 -12
  208. data/lib/tzinfo/countries/TC.rb +12 -12
  209. data/lib/tzinfo/countries/TD.rb +12 -12
  210. data/lib/tzinfo/countries/TF.rb +12 -12
  211. data/lib/tzinfo/countries/TG.rb +12 -12
  212. data/lib/tzinfo/countries/TH.rb +12 -12
  213. data/lib/tzinfo/countries/TJ.rb +12 -12
  214. data/lib/tzinfo/countries/TK.rb +12 -12
  215. data/lib/tzinfo/countries/TL.rb +12 -12
  216. data/lib/tzinfo/countries/TM.rb +12 -12
  217. data/lib/tzinfo/countries/TN.rb +12 -12
  218. data/lib/tzinfo/countries/TO.rb +12 -12
  219. data/lib/tzinfo/countries/TR.rb +12 -12
  220. data/lib/tzinfo/countries/TT.rb +12 -12
  221. data/lib/tzinfo/countries/TV.rb +12 -12
  222. data/lib/tzinfo/countries/TW.rb +12 -12
  223. data/lib/tzinfo/countries/TZ.rb +12 -12
  224. data/lib/tzinfo/countries/UA.rb +15 -15
  225. data/lib/tzinfo/countries/UG.rb +12 -12
  226. data/lib/tzinfo/countries/UM.rb +14 -14
  227. data/lib/tzinfo/countries/US.rb +36 -35
  228. data/lib/tzinfo/countries/UY.rb +12 -12
  229. data/lib/tzinfo/countries/UZ.rb +13 -13
  230. data/lib/tzinfo/countries/VA.rb +12 -12
  231. data/lib/tzinfo/countries/VC.rb +12 -12
  232. data/lib/tzinfo/countries/VE.rb +12 -12
  233. data/lib/tzinfo/countries/VG.rb +12 -12
  234. data/lib/tzinfo/countries/VI.rb +12 -12
  235. data/lib/tzinfo/countries/VN.rb +12 -12
  236. data/lib/tzinfo/countries/VU.rb +12 -12
  237. data/lib/tzinfo/countries/WF.rb +12 -12
  238. data/lib/tzinfo/countries/WS.rb +12 -12
  239. data/lib/tzinfo/countries/YE.rb +12 -12
  240. data/lib/tzinfo/countries/YT.rb +12 -12
  241. data/lib/tzinfo/countries/ZA.rb +12 -12
  242. data/lib/tzinfo/countries/ZM.rb +12 -12
  243. data/lib/tzinfo/countries/ZW.rb +12 -12
  244. data/lib/tzinfo/definitions/Africa/Abidjan.rb +13 -13
  245. data/lib/tzinfo/definitions/Africa/Accra.rb +27 -27
  246. data/lib/tzinfo/definitions/Africa/Addis_Ababa.rb +14 -14
  247. data/lib/tzinfo/definitions/Africa/Algiers.rb +46 -46
  248. data/lib/tzinfo/definitions/Africa/Asmera.rb +15 -15
  249. data/lib/tzinfo/definitions/Africa/Bamako.rb +15 -15
  250. data/lib/tzinfo/definitions/Africa/Bangui.rb +13 -13
  251. data/lib/tzinfo/definitions/Africa/Banjul.rb +15 -15
  252. data/lib/tzinfo/definitions/Africa/Bissau.rb +14 -14
  253. data/lib/tzinfo/definitions/Africa/Blantyre.rb +13 -13
  254. data/lib/tzinfo/definitions/Africa/Brazzaville.rb +13 -13
  255. data/lib/tzinfo/definitions/Africa/Bujumbura.rb +13 -13
  256. data/lib/tzinfo/definitions/Africa/Cairo.rb +213 -203
  257. data/lib/tzinfo/definitions/Africa/Casablanca.rb +31 -31
  258. data/lib/tzinfo/definitions/Africa/Ceuta.rb +164 -157
  259. data/lib/tzinfo/definitions/Africa/Conakry.rb +15 -15
  260. data/lib/tzinfo/definitions/Africa/Dakar.rb +14 -14
  261. data/lib/tzinfo/definitions/Africa/Dar_es_Salaam.rb +15 -15
  262. data/lib/tzinfo/definitions/Africa/Djibouti.rb +13 -13
  263. data/lib/tzinfo/definitions/Africa/Douala.rb +13 -13
  264. data/lib/tzinfo/definitions/Africa/El_Aaiun.rb +14 -14
  265. data/lib/tzinfo/definitions/Africa/Freetown.rb +43 -43
  266. data/lib/tzinfo/definitions/Africa/Gaborone.rb +15 -15
  267. data/lib/tzinfo/definitions/Africa/Harare.rb +13 -13
  268. data/lib/tzinfo/definitions/Africa/Johannesburg.rb +18 -18
  269. data/lib/tzinfo/definitions/Africa/Kampala.rb +16 -16
  270. data/lib/tzinfo/definitions/Africa/Khartoum.rb +46 -46
  271. data/lib/tzinfo/definitions/Africa/Kigali.rb +13 -13
  272. data/lib/tzinfo/definitions/Africa/Kinshasa.rb +13 -13
  273. data/lib/tzinfo/definitions/Africa/Lagos.rb +13 -13
  274. data/lib/tzinfo/definitions/Africa/Libreville.rb +13 -13
  275. data/lib/tzinfo/definitions/Africa/Lome.rb +13 -13
  276. data/lib/tzinfo/definitions/Africa/Luanda.rb +14 -14
  277. data/lib/tzinfo/definitions/Africa/Lubumbashi.rb +13 -13
  278. data/lib/tzinfo/definitions/Africa/Lusaka.rb +13 -13
  279. data/lib/tzinfo/definitions/Africa/Malabo.rb +14 -14
  280. data/lib/tzinfo/definitions/Africa/Maputo.rb +13 -13
  281. data/lib/tzinfo/definitions/Africa/Maseru.rb +15 -15
  282. data/lib/tzinfo/definitions/Africa/Mbabane.rb +13 -13
  283. data/lib/tzinfo/definitions/Africa/Mogadishu.rb +15 -15
  284. data/lib/tzinfo/definitions/Africa/Monrovia.rb +15 -15
  285. data/lib/tzinfo/definitions/Africa/Nairobi.rb +16 -16
  286. data/lib/tzinfo/definitions/Africa/Ndjamena.rb +15 -15
  287. data/lib/tzinfo/definitions/Africa/Niamey.rb +15 -15
  288. data/lib/tzinfo/definitions/Africa/Nouakchott.rb +15 -15
  289. data/lib/tzinfo/definitions/Africa/Ouagadougou.rb +13 -13
  290. data/lib/tzinfo/definitions/Africa/Porto__m__Novo.rb +14 -14
  291. data/lib/tzinfo/definitions/Africa/Sao_Tome.rb +14 -14
  292. data/lib/tzinfo/definitions/Africa/Timbuktu.rb +11 -11
  293. data/lib/tzinfo/definitions/Africa/Tripoli.rb +41 -41
  294. data/lib/tzinfo/definitions/Africa/Tunis.rb +130 -40
  295. data/lib/tzinfo/definitions/Africa/Windhoek.rb +130 -121
  296. data/lib/tzinfo/definitions/America/Adak.rb +183 -175
  297. data/lib/tzinfo/definitions/America/Anchorage.rb +183 -175
  298. data/lib/tzinfo/definitions/America/Anguilla.rb +13 -13
  299. data/lib/tzinfo/definitions/America/Antigua.rb +14 -14
  300. data/lib/tzinfo/definitions/America/Araguaina.rb +61 -64
  301. data/lib/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +71 -71
  302. data/lib/tzinfo/definitions/America/Argentina/Catamarca.rb +73 -73
  303. data/lib/tzinfo/definitions/America/Argentina/ComodRivadavia.rb +13 -13
  304. data/lib/tzinfo/definitions/America/Argentina/Cordoba.rb +71 -71
  305. data/lib/tzinfo/definitions/America/Argentina/Jujuy.rb +71 -72
  306. data/lib/tzinfo/definitions/America/Argentina/La_Rioja.rb +74 -74
  307. data/lib/tzinfo/definitions/America/Argentina/Mendoza.rb +73 -73
  308. data/lib/tzinfo/definitions/America/Argentina/Rio_Gallegos.rb +73 -73
  309. data/lib/tzinfo/definitions/America/Argentina/San_Juan.rb +74 -74
  310. data/lib/tzinfo/definitions/America/Argentina/Tucuman.rb +73 -73
  311. data/lib/tzinfo/definitions/America/Argentina/Ushuaia.rb +73 -73
  312. data/lib/tzinfo/definitions/America/Aruba.rb +14 -14
  313. data/lib/tzinfo/definitions/America/Asuncion.rb +166 -157
  314. data/lib/tzinfo/definitions/America/Atka.rb +11 -11
  315. data/lib/tzinfo/definitions/America/Bahia.rb +71 -72
  316. data/lib/tzinfo/definitions/America/Barbados.rb +22 -22
  317. data/lib/tzinfo/definitions/America/Belem.rb +41 -42
  318. data/lib/tzinfo/definitions/America/Belize.rb +67 -67
  319. data/lib/tzinfo/definitions/America/Boa_Vista.rb +45 -47
  320. data/lib/tzinfo/definitions/America/Bogota.rb +16 -16
  321. data/lib/tzinfo/definitions/America/Boise.rb +189 -178
  322. data/lib/tzinfo/definitions/America/Buenos_Aires.rb +11 -11
  323. data/lib/tzinfo/definitions/America/Cambridge_Bay.rb +165 -154
  324. data/lib/tzinfo/definitions/America/Campo_Grande.rb +165 -156
  325. data/lib/tzinfo/definitions/America/Cancun.rb +125 -115
  326. data/lib/tzinfo/definitions/America/Caracas.rb +15 -15
  327. data/lib/tzinfo/definitions/America/Catamarca.rb +11 -11
  328. data/lib/tzinfo/definitions/America/Cayenne.rb +14 -14
  329. data/lib/tzinfo/definitions/America/Cayman.rb +14 -14
  330. data/lib/tzinfo/definitions/America/Chicago.rb +274 -267
  331. data/lib/tzinfo/definitions/America/Chihuahua.rb +128 -120
  332. data/lib/tzinfo/definitions/America/Coral_Harbour.rb +20 -20
  333. data/lib/tzinfo/definitions/America/Cordoba.rb +11 -11
  334. data/lib/tzinfo/definitions/America/Costa_Rica.rb +22 -22
  335. data/lib/tzinfo/definitions/America/Cuiaba.rb +163 -156
  336. data/lib/tzinfo/definitions/America/Curacao.rb +14 -14
  337. data/lib/tzinfo/definitions/America/Danmarkshavn.rb +46 -46
  338. data/lib/tzinfo/definitions/America/Dawson.rb +165 -154
  339. data/lib/tzinfo/definitions/America/Dawson_Creek.rb +70 -70
  340. data/lib/tzinfo/definitions/America/Denver.rb +196 -189
  341. data/lib/tzinfo/definitions/America/Detroit.rb +177 -169
  342. data/lib/tzinfo/definitions/America/Dominica.rb +13 -13
  343. data/lib/tzinfo/definitions/America/Edmonton.rb +192 -181
  344. data/lib/tzinfo/definitions/America/Eirunepe.rb +43 -46
  345. data/lib/tzinfo/definitions/America/El_Salvador.rb +17 -17
  346. data/lib/tzinfo/definitions/America/Ensenada.rb +11 -11
  347. data/lib/tzinfo/definitions/America/Fort_Wayne.rb +11 -11
  348. data/lib/tzinfo/definitions/America/Fortaleza.rb +51 -55
  349. data/lib/tzinfo/definitions/America/Glace_Bay.rb +178 -171
  350. data/lib/tzinfo/definitions/America/Godthab.rb +155 -145
  351. data/lib/tzinfo/definitions/America/Goose_Bay.rb +242 -236
  352. data/lib/tzinfo/definitions/America/Grand_Turk.rb +158 -148
  353. data/lib/tzinfo/definitions/America/Grenada.rb +13 -13
  354. data/lib/tzinfo/definitions/America/Guadeloupe.rb +13 -13
  355. data/lib/tzinfo/definitions/America/Guatemala.rb +19 -19
  356. data/lib/tzinfo/definitions/America/Guayaquil.rb +14 -14
  357. data/lib/tzinfo/definitions/America/Guyana.rb +16 -16
  358. data/lib/tzinfo/definitions/America/Halifax.rb +266 -259
  359. data/lib/tzinfo/definitions/America/Havana.rb +194 -184
  360. data/lib/tzinfo/definitions/America/Hermosillo.rb +27 -28
  361. data/lib/tzinfo/definitions/America/Indiana/Indianapolis.rb +139 -134
  362. data/lib/tzinfo/definitions/America/Indiana/Knox.rb +194 -184
  363. data/lib/tzinfo/definitions/America/Indiana/Marengo.rb +143 -136
  364. data/lib/tzinfo/definitions/America/Indiana/Petersburg.rb +156 -146
  365. data/lib/tzinfo/definitions/America/Indiana/Vevay.rb +121 -113
  366. data/lib/tzinfo/definitions/America/Indiana/Vincennes.rb +141 -133
  367. data/lib/tzinfo/definitions/America/Indianapolis.rb +11 -11
  368. data/lib/tzinfo/definitions/America/Inuvik.rb +165 -154
  369. data/lib/tzinfo/definitions/America/Iqaluit.rb +164 -153
  370. data/lib/tzinfo/definitions/America/Jamaica.rb +34 -34
  371. data/lib/tzinfo/definitions/America/Jujuy.rb +11 -11
  372. data/lib/tzinfo/definitions/America/Juneau.rb +182 -174
  373. data/lib/tzinfo/definitions/America/Kentucky/Louisville.rb +218 -211
  374. data/lib/tzinfo/definitions/America/Kentucky/Monticello.rb +188 -179
  375. data/lib/tzinfo/definitions/America/Knox_IN.rb +11 -11
  376. data/lib/tzinfo/definitions/America/La_Paz.rb +15 -15
  377. data/lib/tzinfo/definitions/America/Lima.rb +28 -28
  378. data/lib/tzinfo/definitions/America/Los_Angeles.rb +224 -215
  379. data/lib/tzinfo/definitions/America/Louisville.rb +11 -11
  380. data/lib/tzinfo/definitions/America/Maceio.rb +53 -59
  381. data/lib/tzinfo/definitions/America/Managua.rb +26 -26
  382. data/lib/tzinfo/definitions/America/Manaus.rb +43 -46
  383. data/lib/tzinfo/definitions/America/Martinique.rb +16 -16
  384. data/lib/tzinfo/definitions/America/Mazatlan.rb +131 -121
  385. data/lib/tzinfo/definitions/America/Mendoza.rb +11 -11
  386. data/lib/tzinfo/definitions/America/Menominee.rb +181 -171
  387. data/lib/tzinfo/definitions/America/Merida.rb +125 -115
  388. data/lib/tzinfo/definitions/America/Mexico_City.rb +136 -127
  389. data/lib/tzinfo/definitions/America/Miquelon.rb +142 -133
  390. data/lib/tzinfo/definitions/America/Moncton.rb +245 -239
  391. data/lib/tzinfo/definitions/America/Monterrey.rb +125 -117
  392. data/lib/tzinfo/definitions/America/Montevideo.rb +81 -80
  393. data/lib/tzinfo/definitions/America/Montreal.rb +271 -264
  394. data/lib/tzinfo/definitions/America/Montserrat.rb +13 -13
  395. data/lib/tzinfo/definitions/America/Nassau.rb +187 -177
  396. data/lib/tzinfo/definitions/America/New_York.rb +274 -267
  397. data/lib/tzinfo/definitions/America/Nipigon.rb +173 -162
  398. data/lib/tzinfo/definitions/America/Nome.rb +183 -175
  399. data/lib/tzinfo/definitions/America/Noronha.rb +51 -55
  400. data/lib/tzinfo/definitions/America/North_Dakota/Center.rb +190 -179
  401. data/lib/tzinfo/definitions/America/North_Dakota/New_Salem.rb +190 -0
  402. data/lib/tzinfo/definitions/America/Panama.rb +14 -14
  403. data/lib/tzinfo/definitions/America/Pangnirtung.rb +164 -153
  404. data/lib/tzinfo/definitions/America/Paramaribo.rb +17 -17
  405. data/lib/tzinfo/definitions/America/Phoenix.rb +23 -25
  406. data/lib/tzinfo/definitions/America/Port__m__au__m__Prince.rb +46 -46
  407. data/lib/tzinfo/definitions/America/Port_of_Spain.rb +13 -13
  408. data/lib/tzinfo/definitions/America/Porto_Acre.rb +11 -11
  409. data/lib/tzinfo/definitions/America/Porto_Velho.rb +41 -42
  410. data/lib/tzinfo/definitions/America/Puerto_Rico.rb +16 -15
  411. data/lib/tzinfo/definitions/America/Rainy_River.rb +173 -162
  412. data/lib/tzinfo/definitions/America/Rankin_Inlet.rb +164 -153
  413. data/lib/tzinfo/definitions/America/Recife.rb +51 -55
  414. data/lib/tzinfo/definitions/America/Regina.rb +65 -64
  415. data/lib/tzinfo/definitions/America/Rio_Branco.rb +41 -42
  416. data/lib/tzinfo/definitions/America/Rosario.rb +11 -11
  417. data/lib/tzinfo/definitions/America/Santiago.rb +195 -186
  418. data/lib/tzinfo/definitions/America/Santo_Domingo.rb +29 -29
  419. data/lib/tzinfo/definitions/America/Sao_Paulo.rb +165 -157
  420. data/lib/tzinfo/definitions/America/Scoresbysund.rb +155 -145
  421. data/lib/tzinfo/definitions/America/Shiprock.rb +11 -11
  422. data/lib/tzinfo/definitions/America/St_Johns.rb +277 -270
  423. data/lib/tzinfo/definitions/America/St_Kitts.rb +13 -13
  424. data/lib/tzinfo/definitions/America/St_Lucia.rb +14 -14
  425. data/lib/tzinfo/definitions/America/St_Thomas.rb +13 -13
  426. data/lib/tzinfo/definitions/America/St_Vincent.rb +14 -14
  427. data/lib/tzinfo/definitions/America/Swift_Current.rb +35 -34
  428. data/lib/tzinfo/definitions/America/Tegucigalpa.rb +17 -17
  429. data/lib/tzinfo/definitions/America/Thule.rb +133 -123
  430. data/lib/tzinfo/definitions/America/Thunder_Bay.rb +177 -170
  431. data/lib/tzinfo/definitions/America/Tijuana.rb +187 -182
  432. data/lib/tzinfo/definitions/America/Toronto.rb +271 -263
  433. data/lib/tzinfo/definitions/America/Tortola.rb +13 -13
  434. data/lib/tzinfo/definitions/America/Vancouver.rb +228 -217
  435. data/lib/tzinfo/definitions/America/Virgin.rb +11 -11
  436. data/lib/tzinfo/definitions/America/Whitehorse.rb +165 -154
  437. data/lib/tzinfo/definitions/America/Winnipeg.rb +224 -213
  438. data/lib/tzinfo/definitions/America/Yakutat.rb +182 -174
  439. data/lib/tzinfo/definitions/America/Yellowknife.rb +164 -153
  440. data/lib/tzinfo/definitions/Antarctica/Casey.rb +13 -13
  441. data/lib/tzinfo/definitions/Antarctica/Davis.rb +15 -15
  442. data/lib/tzinfo/definitions/Antarctica/DumontDUrville.rb +15 -15
  443. data/lib/tzinfo/definitions/Antarctica/Mawson.rb +13 -13
  444. data/lib/tzinfo/definitions/Antarctica/McMurdo.rb +165 -156
  445. data/lib/tzinfo/definitions/Antarctica/Palmer.rb +168 -158
  446. data/lib/tzinfo/definitions/Antarctica/Rothera.rb +13 -13
  447. data/lib/tzinfo/definitions/Antarctica/South_Pole.rb +11 -11
  448. data/lib/tzinfo/definitions/Antarctica/Syowa.rb +13 -13
  449. data/lib/tzinfo/definitions/Antarctica/Vostok.rb +13 -13
  450. data/lib/tzinfo/definitions/Arctic/Longyearbyen.rb +11 -11
  451. data/lib/tzinfo/definitions/Asia/Aden.rb +13 -13
  452. data/lib/tzinfo/definitions/Asia/Almaty.rb +60 -63
  453. data/lib/tzinfo/definitions/Asia/Amman.rb +157 -147
  454. data/lib/tzinfo/definitions/Asia/Anadyr.rb +155 -145
  455. data/lib/tzinfo/definitions/Asia/Aqtau.rb +62 -63
  456. data/lib/tzinfo/definitions/Asia/Aqtobe.rb +61 -63
  457. data/lib/tzinfo/definitions/Asia/Ashgabat.rb +38 -38
  458. data/lib/tzinfo/definitions/Asia/Ashkhabad.rb +11 -11
  459. data/lib/tzinfo/definitions/Asia/Baghdad.rb +152 -142
  460. data/lib/tzinfo/definitions/Asia/Bahrain.rb +14 -14
  461. data/lib/tzinfo/definitions/Asia/Baku.rb +149 -141
  462. data/lib/tzinfo/definitions/Asia/Bangkok.rb +14 -14
  463. data/lib/tzinfo/definitions/Asia/Beirut.rb +179 -169
  464. data/lib/tzinfo/definitions/Asia/Bishkek.rb +64 -63
  465. data/lib/tzinfo/definitions/Asia/Brunei.rb +14 -14
  466. data/lib/tzinfo/definitions/Asia/Calcutta.rb +17 -17
  467. data/lib/tzinfo/definitions/Asia/Choibalsan.rb +146 -136
  468. data/lib/tzinfo/definitions/Asia/Chongqing.rb +26 -26
  469. data/lib/tzinfo/definitions/Asia/Chungking.rb +11 -11
  470. data/lib/tzinfo/definitions/Asia/Colombo.rb +20 -19
  471. data/lib/tzinfo/definitions/Asia/Dacca.rb +11 -11
  472. data/lib/tzinfo/definitions/Asia/Damascus.rb +189 -179
  473. data/lib/tzinfo/definitions/Asia/Dhaka.rb +18 -18
  474. data/lib/tzinfo/definitions/Asia/Dili.rb +17 -17
  475. data/lib/tzinfo/definitions/Asia/Dubai.rb +13 -13
  476. data/lib/tzinfo/definitions/Asia/Dushanbe.rb +36 -36
  477. data/lib/tzinfo/definitions/Asia/Gaza.rb +182 -173
  478. data/lib/tzinfo/definitions/Asia/Harbin.rb +29 -29
  479. data/lib/tzinfo/definitions/Asia/Hong_Kong.rb +81 -81
  480. data/lib/tzinfo/definitions/Asia/Hovd.rb +146 -136
  481. data/lib/tzinfo/definitions/Asia/Irkutsk.rb +156 -146
  482. data/lib/tzinfo/definitions/Asia/Istanbul.rb +11 -11
  483. data/lib/tzinfo/definitions/Asia/Jakarta.rb +20 -20
  484. data/lib/tzinfo/definitions/Asia/Jayapura.rb +15 -15
  485. data/lib/tzinfo/definitions/Asia/Jerusalem.rb +155 -155
  486. data/lib/tzinfo/definitions/Asia/Kabul.rb +14 -14
  487. data/lib/tzinfo/definitions/Asia/Kamchatka.rb +155 -145
  488. data/lib/tzinfo/definitions/Asia/Karachi.rb +19 -19
  489. data/lib/tzinfo/definitions/Asia/Kashgar.rb +27 -27
  490. data/lib/tzinfo/definitions/Asia/Katmandu.rb +14 -14
  491. data/lib/tzinfo/definitions/Asia/Krasnoyarsk.rb +155 -145
  492. data/lib/tzinfo/definitions/Asia/Kuala_Lumpur.rb +20 -20
  493. data/lib/tzinfo/definitions/Asia/Kuching.rb +31 -31
  494. data/lib/tzinfo/definitions/Asia/Kuwait.rb +13 -13
  495. data/lib/tzinfo/definitions/Asia/Macao.rb +11 -11
  496. data/lib/tzinfo/definitions/Asia/Macau.rb +54 -54
  497. data/lib/tzinfo/definitions/Asia/Magadan.rb +155 -145
  498. data/lib/tzinfo/definitions/Asia/Makassar.rb +16 -16
  499. data/lib/tzinfo/definitions/Asia/Manila.rb +22 -22
  500. data/lib/tzinfo/definitions/Asia/Muscat.rb +13 -13
  501. data/lib/tzinfo/definitions/Asia/Nicosia.rb +165 -156
  502. data/lib/tzinfo/definitions/Asia/Novosibirsk.rb +156 -146
  503. data/lib/tzinfo/definitions/Asia/Omsk.rb +155 -145
  504. data/lib/tzinfo/definitions/Asia/Oral.rb +62 -63
  505. data/lib/tzinfo/definitions/Asia/Phnom_Penh.rb +16 -16
  506. data/lib/tzinfo/definitions/Asia/Pontianak.rb +20 -20
  507. data/lib/tzinfo/definitions/Asia/Pyongyang.rb +18 -18
  508. data/lib/tzinfo/definitions/Asia/Qatar.rb +14 -14
  509. data/lib/tzinfo/definitions/Asia/Qyzylorda.rb +62 -64
  510. data/lib/tzinfo/definitions/Asia/Rangoon.rb +16 -16
  511. data/lib/tzinfo/definitions/Asia/Riyadh.rb +13 -13
  512. data/lib/tzinfo/definitions/Asia/Riyadh87.rb +348 -0
  513. data/lib/tzinfo/definitions/Asia/Riyadh88.rb +349 -0
  514. data/lib/tzinfo/definitions/Asia/Riyadh89.rb +349 -0
  515. data/lib/tzinfo/definitions/Asia/Saigon.rb +16 -16
  516. data/lib/tzinfo/definitions/Asia/Sakhalin.rb +156 -146
  517. data/lib/tzinfo/definitions/Asia/Samarkand.rb +37 -41
  518. data/lib/tzinfo/definitions/Asia/Seoul.rb +25 -25
  519. data/lib/tzinfo/definitions/Asia/Shanghai.rb +29 -30
  520. data/lib/tzinfo/definitions/Asia/Singapore.rb +21 -21
  521. data/lib/tzinfo/definitions/Asia/Taipei.rb +53 -53
  522. data/lib/tzinfo/definitions/Asia/Tashkent.rb +37 -41
  523. data/lib/tzinfo/definitions/Asia/Tbilisi.rb +65 -67
  524. data/lib/tzinfo/definitions/Asia/Tehran.rb +52 -116
  525. data/lib/tzinfo/definitions/Asia/Tel_Aviv.rb +11 -11
  526. data/lib/tzinfo/definitions/Asia/Thimbu.rb +11 -11
  527. data/lib/tzinfo/definitions/Asia/Thimphu.rb +14 -14
  528. data/lib/tzinfo/definitions/Asia/Tokyo.rb +23 -23
  529. data/lib/tzinfo/definitions/Asia/Ujung_Pandang.rb +11 -11
  530. data/lib/tzinfo/definitions/Asia/Ulaanbaatar.rb +146 -136
  531. data/lib/tzinfo/definitions/Asia/Ulan_Bator.rb +11 -11
  532. data/lib/tzinfo/definitions/Asia/Urumqi.rb +26 -26
  533. data/lib/tzinfo/definitions/Asia/Vientiane.rb +16 -16
  534. data/lib/tzinfo/definitions/Asia/Vladivostok.rb +155 -145
  535. data/lib/tzinfo/definitions/Asia/Yakutsk.rb +155 -145
  536. data/lib/tzinfo/definitions/Asia/Yekaterinburg.rb +155 -145
  537. data/lib/tzinfo/definitions/Asia/Yerevan.rb +153 -144
  538. data/lib/tzinfo/definitions/Atlantic/Azores.rb +259 -249
  539. data/lib/tzinfo/definitions/Atlantic/Bermuda.rb +167 -157
  540. data/lib/tzinfo/definitions/Atlantic/Canary.rb +156 -147
  541. data/lib/tzinfo/definitions/Atlantic/Cape_Verde.rb +16 -16
  542. data/lib/tzinfo/definitions/Atlantic/Faeroe.rb +153 -144
  543. data/lib/tzinfo/definitions/Atlantic/Jan_Mayen.rb +11 -11
  544. data/lib/tzinfo/definitions/Atlantic/Madeira.rb +259 -249
  545. data/lib/tzinfo/definitions/Atlantic/Reykjavik.rb +77 -77
  546. data/lib/tzinfo/definitions/Atlantic/South_Georgia.rb +13 -13
  547. data/lib/tzinfo/definitions/Atlantic/St_Helena.rb +14 -14
  548. data/lib/tzinfo/definitions/Atlantic/Stanley.rb +161 -152
  549. data/lib/tzinfo/definitions/Australia/ACT.rb +11 -11
  550. data/lib/tzinfo/definitions/Australia/Adelaide.rb +180 -172
  551. data/lib/tzinfo/definitions/Australia/Brisbane.rb +29 -30
  552. data/lib/tzinfo/definitions/Australia/Broken_Hill.rb +181 -174
  553. data/lib/tzinfo/definitions/Australia/Canberra.rb +11 -11
  554. data/lib/tzinfo/definitions/Australia/Currie.rb +179 -172
  555. data/lib/tzinfo/definitions/Australia/Darwin.rb +22 -22
  556. data/lib/tzinfo/definitions/Australia/Hobart.rb +187 -180
  557. data/lib/tzinfo/definitions/Australia/LHI.rb +11 -11
  558. data/lib/tzinfo/definitions/Australia/Lindeman.rb +33 -35
  559. data/lib/tzinfo/definitions/Australia/Lord_Howe.rb +152 -143
  560. data/lib/tzinfo/definitions/Australia/Melbourne.rb +179 -171
  561. data/lib/tzinfo/definitions/Australia/NSW.rb +11 -11
  562. data/lib/tzinfo/definitions/Australia/North.rb +11 -11
  563. data/lib/tzinfo/definitions/Australia/Perth.rb +25 -26
  564. data/lib/tzinfo/definitions/Australia/Queensland.rb +11 -11
  565. data/lib/tzinfo/definitions/Australia/South.rb +11 -11
  566. data/lib/tzinfo/definitions/Australia/Sydney.rb +179 -171
  567. data/lib/tzinfo/definitions/Australia/Tasmania.rb +11 -11
  568. data/lib/tzinfo/definitions/Australia/Victoria.rb +11 -11
  569. data/lib/tzinfo/definitions/Australia/West.rb +11 -11
  570. data/lib/tzinfo/definitions/Australia/Yancowinna.rb +11 -11
  571. data/lib/tzinfo/definitions/Brazil/Acre.rb +11 -11
  572. data/lib/tzinfo/definitions/Brazil/DeNoronha.rb +11 -11
  573. data/lib/tzinfo/definitions/Brazil/East.rb +11 -11
  574. data/lib/tzinfo/definitions/Brazil/West.rb +11 -11
  575. data/lib/tzinfo/definitions/CET.rb +170 -160
  576. data/lib/tzinfo/definitions/CST6CDT.rb +185 -174
  577. data/lib/tzinfo/definitions/Canada/Atlantic.rb +11 -11
  578. data/lib/tzinfo/definitions/Canada/Central.rb +11 -11
  579. data/lib/tzinfo/definitions/Canada/East__m__Saskatchewan.rb +11 -11
  580. data/lib/tzinfo/definitions/Canada/Eastern.rb +11 -11
  581. data/lib/tzinfo/definitions/Canada/Mountain.rb +11 -11
  582. data/lib/tzinfo/definitions/Canada/Newfoundland.rb +11 -11
  583. data/lib/tzinfo/definitions/Canada/Pacific.rb +11 -11
  584. data/lib/tzinfo/definitions/Canada/Saskatchewan.rb +11 -11
  585. data/lib/tzinfo/definitions/Canada/Yukon.rb +11 -11
  586. data/lib/tzinfo/definitions/Chile/Continental.rb +11 -11
  587. data/lib/tzinfo/definitions/Chile/EasterIsland.rb +11 -11
  588. data/lib/tzinfo/definitions/Cuba.rb +9 -9
  589. data/lib/tzinfo/definitions/EET.rb +158 -148
  590. data/lib/tzinfo/definitions/EST.rb +10 -10
  591. data/lib/tzinfo/definitions/EST5EDT.rb +185 -174
  592. data/lib/tzinfo/definitions/Egypt.rb +9 -9
  593. data/lib/tzinfo/definitions/Eire.rb +9 -9
  594. data/lib/tzinfo/definitions/Etc/GMT.rb +12 -12
  595. data/lib/tzinfo/definitions/Etc/GMT0.rb +11 -11
  596. data/lib/tzinfo/definitions/Etc/GMT__m__0.rb +11 -11
  597. data/lib/tzinfo/definitions/Etc/GMT__m__1.rb +12 -12
  598. data/lib/tzinfo/definitions/Etc/GMT__m__10.rb +12 -12
  599. data/lib/tzinfo/definitions/Etc/GMT__m__11.rb +12 -12
  600. data/lib/tzinfo/definitions/Etc/GMT__m__12.rb +12 -12
  601. data/lib/tzinfo/definitions/Etc/GMT__m__13.rb +12 -12
  602. data/lib/tzinfo/definitions/Etc/GMT__m__14.rb +12 -12
  603. data/lib/tzinfo/definitions/Etc/GMT__m__2.rb +12 -12
  604. data/lib/tzinfo/definitions/Etc/GMT__m__3.rb +12 -12
  605. data/lib/tzinfo/definitions/Etc/GMT__m__4.rb +12 -12
  606. data/lib/tzinfo/definitions/Etc/GMT__m__5.rb +12 -12
  607. data/lib/tzinfo/definitions/Etc/GMT__m__6.rb +12 -12
  608. data/lib/tzinfo/definitions/Etc/GMT__m__7.rb +12 -12
  609. data/lib/tzinfo/definitions/Etc/GMT__m__8.rb +12 -12
  610. data/lib/tzinfo/definitions/Etc/GMT__m__9.rb +12 -12
  611. data/lib/tzinfo/definitions/Etc/GMT__p__0.rb +11 -11
  612. data/lib/tzinfo/definitions/Etc/GMT__p__1.rb +12 -12
  613. data/lib/tzinfo/definitions/Etc/GMT__p__10.rb +12 -12
  614. data/lib/tzinfo/definitions/Etc/GMT__p__11.rb +12 -12
  615. data/lib/tzinfo/definitions/Etc/GMT__p__12.rb +12 -12
  616. data/lib/tzinfo/definitions/Etc/GMT__p__2.rb +12 -12
  617. data/lib/tzinfo/definitions/Etc/GMT__p__3.rb +12 -12
  618. data/lib/tzinfo/definitions/Etc/GMT__p__4.rb +12 -12
  619. data/lib/tzinfo/definitions/Etc/GMT__p__5.rb +12 -12
  620. data/lib/tzinfo/definitions/Etc/GMT__p__6.rb +12 -12
  621. data/lib/tzinfo/definitions/Etc/GMT__p__7.rb +12 -12
  622. data/lib/tzinfo/definitions/Etc/GMT__p__8.rb +12 -12
  623. data/lib/tzinfo/definitions/Etc/GMT__p__9.rb +12 -12
  624. data/lib/tzinfo/definitions/Etc/Greenwich.rb +11 -11
  625. data/lib/tzinfo/definitions/Etc/UCT.rb +12 -12
  626. data/lib/tzinfo/definitions/Etc/UTC.rb +12 -12
  627. data/lib/tzinfo/definitions/Etc/Universal.rb +11 -11
  628. data/lib/tzinfo/definitions/Etc/Zulu.rb +11 -11
  629. data/lib/tzinfo/definitions/Europe/Amsterdam.rb +218 -208
  630. data/lib/tzinfo/definitions/Europe/Andorra.rb +146 -136
  631. data/lib/tzinfo/definitions/Europe/Athens.rb +176 -167
  632. data/lib/tzinfo/definitions/Europe/Belfast.rb +11 -11
  633. data/lib/tzinfo/definitions/Europe/Belgrade.rb +157 -147
  634. data/lib/tzinfo/definitions/Europe/Berlin.rb +181 -172
  635. data/lib/tzinfo/definitions/Europe/Bratislava.rb +11 -11
  636. data/lib/tzinfo/definitions/Europe/Brussels.rb +223 -214
  637. data/lib/tzinfo/definitions/Europe/Bucharest.rb +174 -167
  638. data/lib/tzinfo/definitions/Europe/Budapest.rb +191 -181
  639. data/lib/tzinfo/definitions/Europe/Chisinau.rb +177 -170
  640. data/lib/tzinfo/definitions/Europe/Copenhagen.rb +172 -163
  641. data/lib/tzinfo/definitions/Europe/Dublin.rb +265 -257
  642. data/lib/tzinfo/definitions/Europe/Gibraltar.rb +236 -227
  643. data/lib/tzinfo/definitions/Europe/Helsinki.rb +156 -147
  644. data/lib/tzinfo/definitions/Europe/Istanbul.rb +209 -201
  645. data/lib/tzinfo/definitions/Europe/Kaliningrad.rb +169 -159
  646. data/lib/tzinfo/definitions/Europe/Kiev.rb +157 -149
  647. data/lib/tzinfo/definitions/Europe/Lisbon.rb +259 -250
  648. data/lib/tzinfo/definitions/Europe/Ljubljana.rb +11 -11
  649. data/lib/tzinfo/definitions/Europe/London.rb +279 -271
  650. data/lib/tzinfo/definitions/Europe/Luxembourg.rb +221 -211
  651. data/lib/tzinfo/definitions/Europe/Madrid.rb +202 -193
  652. data/lib/tzinfo/definitions/Europe/Malta.rb +207 -198
  653. data/lib/tzinfo/definitions/Europe/Mariehamn.rb +11 -11
  654. data/lib/tzinfo/definitions/Europe/Minsk.rb +159 -147
  655. data/lib/tzinfo/definitions/Europe/Monaco.rb +223 -214
  656. data/lib/tzinfo/definitions/Europe/Moscow.rb +168 -158
  657. data/lib/tzinfo/definitions/Europe/Nicosia.rb +11 -11
  658. data/lib/tzinfo/definitions/Europe/Oslo.rb +179 -169
  659. data/lib/tzinfo/definitions/Europe/Paris.rb +222 -212
  660. data/lib/tzinfo/definitions/Europe/Prague.rb +180 -170
  661. data/lib/tzinfo/definitions/Europe/Riga.rb +164 -156
  662. data/lib/tzinfo/definitions/Europe/Rome.rb +208 -200
  663. data/lib/tzinfo/definitions/Europe/Samara.rb +155 -145
  664. data/lib/tzinfo/definitions/Europe/San_Marino.rb +11 -11
  665. data/lib/tzinfo/definitions/Europe/Sarajevo.rb +11 -11
  666. data/lib/tzinfo/definitions/Europe/Simferopol.rb +159 -151
  667. data/lib/tzinfo/definitions/Europe/Skopje.rb +11 -11
  668. data/lib/tzinfo/definitions/Europe/Sofia.rb +164 -157
  669. data/lib/tzinfo/definitions/Europe/Stockholm.rb +158 -149
  670. data/lib/tzinfo/definitions/Europe/Tallinn.rb +161 -152
  671. data/lib/tzinfo/definitions/Europe/Tirane.rb +171 -162
  672. data/lib/tzinfo/definitions/Europe/Tiraspol.rb +11 -11
  673. data/lib/tzinfo/definitions/Europe/Uzhgorod.rb +158 -153
  674. data/lib/tzinfo/definitions/Europe/Vaduz.rb +153 -144
  675. data/lib/tzinfo/definitions/Europe/Vatican.rb +11 -11
  676. data/lib/tzinfo/definitions/Europe/Vienna.rb +177 -170
  677. data/lib/tzinfo/definitions/Europe/Vilnius.rb +158 -148
  678. data/lib/tzinfo/definitions/Europe/Warsaw.rb +203 -195
  679. data/lib/tzinfo/definitions/Europe/Zagreb.rb +11 -11
  680. data/lib/tzinfo/definitions/Europe/Zaporozhye.rb +160 -150
  681. data/lib/tzinfo/definitions/Europe/Zurich.rb +160 -151
  682. data/lib/tzinfo/definitions/GB.rb +9 -9
  683. data/lib/tzinfo/definitions/GB__m__Eire.rb +9 -9
  684. data/lib/tzinfo/definitions/GMT.rb +9 -9
  685. data/lib/tzinfo/definitions/GMT0.rb +9 -9
  686. data/lib/tzinfo/definitions/GMT__m__0.rb +9 -9
  687. data/lib/tzinfo/definitions/GMT__p__0.rb +9 -9
  688. data/lib/tzinfo/definitions/Greenwich.rb +9 -9
  689. data/lib/tzinfo/definitions/HST.rb +10 -10
  690. data/lib/tzinfo/definitions/Hongkong.rb +9 -9
  691. data/lib/tzinfo/definitions/Iceland.rb +9 -9
  692. data/lib/tzinfo/definitions/Indian/Antananarivo.rb +15 -15
  693. data/lib/tzinfo/definitions/Indian/Chagos.rb +14 -14
  694. data/lib/tzinfo/definitions/Indian/Christmas.rb +13 -13
  695. data/lib/tzinfo/definitions/Indian/Cocos.rb +13 -13
  696. data/lib/tzinfo/definitions/Indian/Comoro.rb +13 -13
  697. data/lib/tzinfo/definitions/Indian/Kerguelen.rb +13 -13
  698. data/lib/tzinfo/definitions/Indian/Mahe.rb +13 -13
  699. data/lib/tzinfo/definitions/Indian/Maldives.rb +14 -14
  700. data/lib/tzinfo/definitions/Indian/Mauritius.rb +13 -13
  701. data/lib/tzinfo/definitions/Indian/Mayotte.rb +13 -13
  702. data/lib/tzinfo/definitions/Indian/Reunion.rb +13 -13
  703. data/lib/tzinfo/definitions/Iran.rb +9 -9
  704. data/lib/tzinfo/definitions/Israel.rb +9 -9
  705. data/lib/tzinfo/definitions/Jamaica.rb +9 -9
  706. data/lib/tzinfo/definitions/Japan.rb +9 -9
  707. data/lib/tzinfo/definitions/Kwajalein.rb +9 -9
  708. data/lib/tzinfo/definitions/Libya.rb +9 -9
  709. data/lib/tzinfo/definitions/MET.rb +170 -160
  710. data/lib/tzinfo/definitions/MST.rb +10 -10
  711. data/lib/tzinfo/definitions/MST7MDT.rb +185 -174
  712. data/lib/tzinfo/definitions/Mexico/BajaNorte.rb +11 -11
  713. data/lib/tzinfo/definitions/Mexico/BajaSur.rb +11 -11
  714. data/lib/tzinfo/definitions/Mexico/General.rb +11 -11
  715. data/lib/tzinfo/definitions/Mideast/Riyadh87.rb +11 -0
  716. data/lib/tzinfo/definitions/Mideast/Riyadh88.rb +11 -0
  717. data/lib/tzinfo/definitions/Mideast/Riyadh89.rb +11 -0
  718. data/lib/tzinfo/definitions/NZ.rb +9 -9
  719. data/lib/tzinfo/definitions/NZ__m__CHAT.rb +9 -9
  720. data/lib/tzinfo/definitions/Navajo.rb +9 -9
  721. data/lib/tzinfo/definitions/PRC.rb +9 -9
  722. data/lib/tzinfo/definitions/PST8PDT.rb +185 -174
  723. data/lib/tzinfo/definitions/Pacific/Apia.rb +15 -15
  724. data/lib/tzinfo/definitions/Pacific/Auckland.rb +192 -184
  725. data/lib/tzinfo/definitions/Pacific/Chatham.rb +165 -156
  726. data/lib/tzinfo/definitions/Pacific/Easter.rb +182 -174
  727. data/lib/tzinfo/definitions/Pacific/Efate.rb +33 -33
  728. data/lib/tzinfo/definitions/Pacific/Enderbury.rb +15 -15
  729. data/lib/tzinfo/definitions/Pacific/Fakaofo.rb +13 -13
  730. data/lib/tzinfo/definitions/Pacific/Fiji.rb +17 -17
  731. data/lib/tzinfo/definitions/Pacific/Funafuti.rb +13 -13
  732. data/lib/tzinfo/definitions/Pacific/Galapagos.rb +14 -14
  733. data/lib/tzinfo/definitions/Pacific/Gambier.rb +13 -13
  734. data/lib/tzinfo/definitions/Pacific/Guadalcanal.rb +13 -13
  735. data/lib/tzinfo/definitions/Pacific/Guam.rb +15 -15
  736. data/lib/tzinfo/definitions/Pacific/Honolulu.rb +19 -17
  737. data/lib/tzinfo/definitions/Pacific/Johnston.rb +12 -12
  738. data/lib/tzinfo/definitions/Pacific/Kiritimati.rb +15 -15
  739. data/lib/tzinfo/definitions/Pacific/Kosrae.rb +15 -15
  740. data/lib/tzinfo/definitions/Pacific/Kwajalein.rb +15 -15
  741. data/lib/tzinfo/definitions/Pacific/Majuro.rb +14 -14
  742. data/lib/tzinfo/definitions/Pacific/Marquesas.rb +13 -13
  743. data/lib/tzinfo/definitions/Pacific/Midway.rb +17 -17
  744. data/lib/tzinfo/definitions/Pacific/Nauru.rb +16 -16
  745. data/lib/tzinfo/definitions/Pacific/Niue.rb +15 -15
  746. data/lib/tzinfo/definitions/Pacific/Norfolk.rb +14 -14
  747. data/lib/tzinfo/definitions/Pacific/Noumea.rb +19 -19
  748. data/lib/tzinfo/definitions/Pacific/Pago_Pago.rb +17 -17
  749. data/lib/tzinfo/definitions/Pacific/Palau.rb +13 -13
  750. data/lib/tzinfo/definitions/Pacific/Pitcairn.rb +14 -14
  751. data/lib/tzinfo/definitions/Pacific/Ponape.rb +13 -13
  752. data/lib/tzinfo/definitions/Pacific/Port_Moresby.rb +14 -14
  753. data/lib/tzinfo/definitions/Pacific/Rarotonga.rb +39 -39
  754. data/lib/tzinfo/definitions/Pacific/Saipan.rb +16 -16
  755. data/lib/tzinfo/definitions/Pacific/Samoa.rb +11 -11
  756. data/lib/tzinfo/definitions/Pacific/Tahiti.rb +13 -13
  757. data/lib/tzinfo/definitions/Pacific/Tarawa.rb +13 -13
  758. data/lib/tzinfo/definitions/Pacific/Tongatapu.rb +20 -21
  759. data/lib/tzinfo/definitions/Pacific/Truk.rb +13 -13
  760. data/lib/tzinfo/definitions/Pacific/Wake.rb +13 -13
  761. data/lib/tzinfo/definitions/Pacific/Wallis.rb +13 -13
  762. data/lib/tzinfo/definitions/Pacific/Yap.rb +11 -11
  763. data/lib/tzinfo/definitions/Poland.rb +9 -9
  764. data/lib/tzinfo/definitions/Portugal.rb +9 -9
  765. data/lib/tzinfo/definitions/ROC.rb +9 -9
  766. data/lib/tzinfo/definitions/ROK.rb +9 -9
  767. data/lib/tzinfo/definitions/Singapore.rb +9 -9
  768. data/lib/tzinfo/definitions/Turkey.rb +9 -9
  769. data/lib/tzinfo/definitions/UCT.rb +9 -9
  770. data/lib/tzinfo/definitions/US/Alaska.rb +11 -11
  771. data/lib/tzinfo/definitions/US/Aleutian.rb +11 -11
  772. data/lib/tzinfo/definitions/US/Arizona.rb +11 -11
  773. data/lib/tzinfo/definitions/US/Central.rb +11 -11
  774. data/lib/tzinfo/definitions/US/East__m__Indiana.rb +11 -11
  775. data/lib/tzinfo/definitions/US/Eastern.rb +11 -11
  776. data/lib/tzinfo/definitions/US/Hawaii.rb +11 -11
  777. data/lib/tzinfo/definitions/US/Indiana__m__Starke.rb +11 -11
  778. data/lib/tzinfo/definitions/US/Michigan.rb +11 -11
  779. data/lib/tzinfo/definitions/US/Mountain.rb +11 -11
  780. data/lib/tzinfo/definitions/US/Pacific.rb +11 -11
  781. data/lib/tzinfo/definitions/US/Pacific__m__New.rb +11 -11
  782. data/lib/tzinfo/definitions/US/Samoa.rb +11 -11
  783. data/lib/tzinfo/definitions/UTC.rb +9 -9
  784. data/lib/tzinfo/definitions/Universal.rb +9 -9
  785. data/lib/tzinfo/definitions/WET.rb +158 -148
  786. data/lib/tzinfo/definitions/W__m__SU.rb +9 -9
  787. data/lib/tzinfo/definitions/Zulu.rb +9 -9
  788. data/lib/tzinfo/offset_rationals.rb +95 -0
  789. data/lib/tzinfo/time_or_datetime.rb +269 -0
  790. data/lib/tzinfo/timezone.rb +25 -44
  791. data/lib/tzinfo/timezone_period.rb +54 -87
  792. data/lib/tzinfo/timezone_period_list.rb +7 -2
  793. data/lib/tzinfo/tzdataparser.rb +378 -325
  794. data/test/tc_offset_rationals.rb +25 -0
  795. data/test/tc_time_or_datetime.rb +386 -0
  796. data/test/tc_timezone.rb +43 -7
  797. data/test/tc_timezone_london.rb +61 -1
  798. data/test/tc_timezone_melbourne.rb +61 -1
  799. data/test/tc_timezone_new_york.rb +61 -1
  800. data/test/tc_timezone_period.rb +152 -65
  801. data/test/ts_all.rb +4 -0
  802. metadata +14 -2
@@ -0,0 +1,25 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
2
+ require 'test/unit'
3
+ require 'tzinfo/offset_rationals'
4
+
5
+ include TZInfo
6
+
7
+ class TCOffsetRationals < Test::Unit::TestCase
8
+ def test_rational_for_offset
9
+ [0,1,2,3,4,-1,-2,-3,-4,30*60,-30*60,61*60,-61*60,14*60*60,-14*60*60,20*60*60,-20*60*60].each {|seconds|
10
+ assert_equal(Rational(seconds, 86400), OffsetRationals.rational_for_offset(seconds))
11
+ }
12
+ end
13
+
14
+ def test_rational_for_offset_constant
15
+ -28.upto(28) {|i|
16
+ seconds = i * 30 * 60
17
+
18
+ r1 = OffsetRationals.rational_for_offset(seconds)
19
+ r2 = OffsetRationals.rational_for_offset(seconds)
20
+
21
+ assert_equal(Rational(seconds, 86400), r1)
22
+ assert_same(r1, r2)
23
+ }
24
+ end
25
+ end
@@ -0,0 +1,386 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
2
+ require 'test/unit'
3
+ require 'tzinfo/time_or_datetime'
4
+
5
+ include TZInfo
6
+
7
+ class TCTimeOrDateTime < Test::Unit::TestCase
8
+ def test_initialize_time
9
+ TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3))
10
+ end
11
+
12
+ def test_initialize_time_local
13
+ tdt = TimeOrDateTime.new(Time.local(2006, 3, 24, 15, 32, 3))
14
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), tdt.to_time)
15
+ assert_equal('UTC', tdt.to_time.zone)
16
+ end
17
+
18
+ def test_initialize_datetime
19
+ TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3))
20
+ end
21
+
22
+ def test_initialize_int
23
+ TimeOrDateTime.new(1143214323)
24
+ end
25
+
26
+ def test_initialize_string
27
+ TimeOrDateTime.new('1143214323')
28
+ end
29
+
30
+ def test_to_time
31
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 3),
32
+ TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).to_time)
33
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 3),
34
+ TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).to_time)
35
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 3),
36
+ TimeOrDateTime.new(1143214323).to_time)
37
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 3),
38
+ TimeOrDateTime.new('1143214323').to_time)
39
+ end
40
+
41
+ def test_to_datetime
42
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3),
43
+ TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).to_datetime)
44
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3),
45
+ TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).to_datetime)
46
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3),
47
+ TimeOrDateTime.new(1143214323).to_datetime)
48
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3),
49
+ TimeOrDateTime.new('1143214323').to_datetime)
50
+ end
51
+
52
+ def test_to_i
53
+ assert_equal(1143214323,
54
+ TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).to_i)
55
+ assert_equal(1143214323,
56
+ TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).to_i)
57
+ assert_equal(1143214323,
58
+ TimeOrDateTime.new(1143214323).to_i)
59
+ assert_equal(1143214323,
60
+ TimeOrDateTime.new('1143214323').to_i)
61
+ end
62
+
63
+ def test_to_orig
64
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 3),
65
+ TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).to_orig)
66
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3),
67
+ TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).to_orig)
68
+ assert_equal(1143214323,
69
+ TimeOrDateTime.new(1143214323).to_orig)
70
+ assert_equal(1143214323,
71
+ TimeOrDateTime.new('1143214323').to_orig)
72
+ end
73
+
74
+ def test_to_s
75
+ assert_equal("Time: #{Time.utc(2006, 3, 24, 15, 32, 3).to_s}",
76
+ TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).to_s)
77
+ assert_equal("DateTime: #{DateTime.new(2006, 3, 24, 15, 32, 3)}",
78
+ TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).to_s)
79
+ assert_equal('Timestamp: 1143214323',
80
+ TimeOrDateTime.new(1143214323).to_s)
81
+ assert_equal('Timestamp: 1143214323',
82
+ TimeOrDateTime.new('1143214323').to_s)
83
+ end
84
+
85
+ def test_year
86
+ assert_equal(2006, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).year)
87
+ assert_equal(2006, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).year)
88
+ assert_equal(2006, TimeOrDateTime.new(1143214323).year)
89
+ end
90
+
91
+ def test_mon
92
+ assert_equal(3, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).mon)
93
+ assert_equal(3, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).mon)
94
+ assert_equal(3, TimeOrDateTime.new(1143214323).mon)
95
+ end
96
+
97
+ def test_month
98
+ assert_equal(3, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).month)
99
+ assert_equal(3, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).month)
100
+ assert_equal(3, TimeOrDateTime.new(1143214323).month)
101
+ end
102
+
103
+ def test_mday
104
+ assert_equal(24, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).mday)
105
+ assert_equal(24, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).mday)
106
+ assert_equal(24, TimeOrDateTime.new(1143214323).mday)
107
+ end
108
+
109
+ def test_day
110
+ assert_equal(24, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).day)
111
+ assert_equal(24, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).day)
112
+ assert_equal(24, TimeOrDateTime.new(1143214323).day)
113
+ end
114
+
115
+ def test_hour
116
+ assert_equal(15, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).hour)
117
+ assert_equal(15, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).hour)
118
+ assert_equal(15, TimeOrDateTime.new(1143214323).hour)
119
+ end
120
+
121
+ def test_min
122
+ assert_equal(32, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).min)
123
+ assert_equal(32, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).min)
124
+ assert_equal(32, TimeOrDateTime.new(1143214323).min)
125
+ end
126
+
127
+ def test_sec
128
+ assert_equal(3, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).sec)
129
+ assert_equal(3, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).sec)
130
+ assert_equal(3, TimeOrDateTime.new(1143214323).sec)
131
+ end
132
+
133
+ def test_compare_timeordatetime_time
134
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 4)))
135
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2007, 3, 24, 15, 32, 3)))
136
+ assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)))
137
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 2)))
138
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2005, 3, 24, 15, 32, 3)))
139
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 4)))
140
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2007, 3, 24, 15, 32, 3)))
141
+ assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)))
142
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 2)))
143
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2005, 3, 24, 15, 32, 3)))
144
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)))
145
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)))
146
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 4)))
147
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(Time.utc(2007, 3, 24, 15, 32, 3)))
148
+ assert_equal(0, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)))
149
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 2)))
150
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(Time.utc(2005, 3, 24, 15, 32, 3)))
151
+ end
152
+
153
+ def test_compare_timeordatetime_datetime
154
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 4)))
155
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)))
156
+ assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)))
157
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 2)))
158
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)))
159
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 4)))
160
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)))
161
+ assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)))
162
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 2)))
163
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)))
164
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)))
165
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)))
166
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 4)))
167
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)))
168
+ assert_equal(0, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)))
169
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 2)))
170
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)))
171
+ end
172
+
173
+ def test_compare_timeordatetime_timestamp
174
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214324))
175
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1174750323))
176
+ assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214323))
177
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214322))
178
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1111678323))
179
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214324))
180
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1174750323))
181
+ assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214323))
182
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214322))
183
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1111678323))
184
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214323))
185
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> TimeOrDateTime.new(1143214323))
186
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(1143214324))
187
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(1174750323))
188
+ assert_equal(0, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(1143214323))
189
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(1143214322))
190
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> TimeOrDateTime.new(1111678323))
191
+ end
192
+
193
+ def test_compare_time
194
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 4))
195
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2007, 3, 24, 15, 32, 3))
196
+ assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 3))
197
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 2))
198
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2005, 3, 24, 15, 32, 3))
199
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 4))
200
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2007, 3, 24, 15, 32, 3))
201
+ assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 3))
202
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 2))
203
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> Time.utc(2005, 3, 24, 15, 32, 3))
204
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 3))
205
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> Time.utc(2006, 3, 24, 15, 32, 3))
206
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> Time.utc(2006, 3, 24, 15, 32, 4))
207
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> Time.utc(2007, 3, 24, 15, 32, 3))
208
+ assert_equal(0, TimeOrDateTime.new(1143214323) <=> Time.utc(2006, 3, 24, 15, 32, 3))
209
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> Time.utc(2006, 3, 24, 15, 32, 2))
210
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> Time.utc(2005, 3, 24, 15, 32, 3))
211
+ end
212
+
213
+ def test_compare_datetime
214
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 4))
215
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2040, 3, 24, 15, 32, 3))
216
+ assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 3))
217
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 2))
218
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(1960, 3, 24, 15, 32, 3))
219
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 4))
220
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2040, 3, 24, 15, 32, 3))
221
+ assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 3))
222
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 2))
223
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> DateTime.new(1960, 3, 24, 15, 32, 3))
224
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 3))
225
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> DateTime.new(2006, 3, 24, 15, 32, 3))
226
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> DateTime.new(2006, 3, 24, 15, 32, 4))
227
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> DateTime.new(2040, 3, 24, 15, 32, 3))
228
+ assert_equal(0, TimeOrDateTime.new(1143214323) <=> DateTime.new(2006, 3, 24, 15, 32, 3))
229
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> DateTime.new(2006, 3, 24, 15, 32, 2))
230
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> DateTime.new(1960, 3, 24, 15, 32, 3))
231
+ end
232
+
233
+ def test_compare_timestamp
234
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> 1143214324)
235
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> 1174750323)
236
+ assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> 1143214323)
237
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> 1143214322)
238
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> 1111678323)
239
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> 1143214324)
240
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> 1174750323)
241
+ assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> 1143214323)
242
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> 1143214322)
243
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> 1111678323)
244
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> 1143214323)
245
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> 1143214323)
246
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> 1143214324)
247
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> 1174750323)
248
+ assert_equal(0, TimeOrDateTime.new(1143214323) <=> 1143214323)
249
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> 1143214322)
250
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> 1111678323)
251
+ end
252
+
253
+ def test_compare_timestamp_str
254
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> '1143214324')
255
+ assert_equal(-1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> '1174750323')
256
+ assert_equal(0, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> '1143214323')
257
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> '1143214322')
258
+ assert_equal(1, TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) <=> '1111678323')
259
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> '1143214324')
260
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> '1174750323')
261
+ assert_equal(0, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> '1143214323')
262
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> '1143214322')
263
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) <=> '1111678323')
264
+ assert_equal(-1, TimeOrDateTime.new(DateTime.new(1960, 3, 24, 15, 32, 3)) <=> '1143214323')
265
+ assert_equal(1, TimeOrDateTime.new(DateTime.new(2040, 3, 24, 15, 32, 3)) <=> '1143214323')
266
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> '1143214324')
267
+ assert_equal(-1, TimeOrDateTime.new(1143214323) <=> '1174750323')
268
+ assert_equal(0, TimeOrDateTime.new(1143214323) <=> '1143214323')
269
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> '1143214322')
270
+ assert_equal(1, TimeOrDateTime.new(1143214323) <=> '1111678323')
271
+ end
272
+
273
+ def test_add
274
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) + 0).to_orig)
275
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) + 0).to_orig)
276
+ assert_equal(1143214323, (TimeOrDateTime.new(1143214323) + 0).to_orig)
277
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) + 1).to_orig)
278
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) + 1).to_orig)
279
+ assert_equal(1143214324, (TimeOrDateTime.new(1143214323) + 1).to_orig)
280
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) + (-1)).to_orig)
281
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) + (-1)).to_orig)
282
+ assert_equal(1143214322, (TimeOrDateTime.new(1143214323) + (-1)).to_orig)
283
+ end
284
+
285
+ def test_subtract
286
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) - 0).to_orig)
287
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) - 0).to_orig)
288
+ assert_equal(1143214323, (TimeOrDateTime.new(1143214323) - 0).to_orig)
289
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) - 1).to_orig)
290
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) - 1).to_orig)
291
+ assert_equal(1143214322, (TimeOrDateTime.new(1143214323) - 1).to_orig)
292
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)) - (-1)).to_orig)
293
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4), (TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)) - (-1)).to_orig)
294
+ assert_equal(1143214324, (TimeOrDateTime.new(1143214323) - (-1)).to_orig)
295
+ end
296
+
297
+ def test_add_with_convert
298
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).add_with_convert(0).to_orig)
299
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).add_with_convert(0).to_orig)
300
+ assert_equal(1143214323, TimeOrDateTime.new(1143214323).add_with_convert(0).to_orig)
301
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 4), TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).add_with_convert(1).to_orig)
302
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).add_with_convert(1).to_orig)
303
+ assert_equal(1143214324, TimeOrDateTime.new(1143214323).add_with_convert(1).to_orig)
304
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 2), TimeOrDateTime.new(Time.utc(2006, 3, 24, 15, 32, 3)).add_with_convert(-1).to_orig)
305
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 2), TimeOrDateTime.new(DateTime.new(2006, 3, 24, 15, 32, 3)).add_with_convert(-1).to_orig)
306
+ assert_equal(1143214322, TimeOrDateTime.new(1143214323).add_with_convert(-1).to_orig)
307
+
308
+ assert_equal(DateTime.new(1969, 12, 31, 23, 59, 59), TimeOrDateTime.new(Time.utc(1970, 1, 1, 0, 0, 0)).add_with_convert(-1).to_orig)
309
+ assert_equal(DateTime.new(2038, 1, 19, 3, 14, 8), TimeOrDateTime.new(Time.utc(2038, 1, 19, 3, 14, 7)).add_with_convert(1).to_orig)
310
+ end
311
+
312
+ def test_wrap_time
313
+ t = TimeOrDateTime.wrap(Time.utc(2006, 3, 24, 15, 32, 3))
314
+ assert_instance_of(TimeOrDateTime, t)
315
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), t.to_orig)
316
+ end
317
+
318
+ def test_wrap_datetime
319
+ t = TimeOrDateTime.wrap(DateTime.new(2006, 3, 24, 15, 32, 3))
320
+ assert_instance_of(TimeOrDateTime, t)
321
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3), t.to_orig)
322
+ end
323
+
324
+ def test_wrap_timestamp
325
+ t = TimeOrDateTime.wrap(1143214323)
326
+ assert_instance_of(TimeOrDateTime, t)
327
+ assert_equal(1143214323, t.to_orig)
328
+ end
329
+
330
+ def test_wrap_timestamp_str
331
+ t = TimeOrDateTime.wrap('1143214323')
332
+ assert_instance_of(TimeOrDateTime, t)
333
+ assert_equal(1143214323, t.to_orig)
334
+ end
335
+
336
+ def test_wrap_timeordatetime
337
+ t = TimeOrDateTime.new(1143214323)
338
+ t2 = TimeOrDateTime.wrap(t)
339
+ assert_same(t, t2)
340
+ end
341
+
342
+ def test_wrap_block_time
343
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 4), TimeOrDateTime.wrap(Time.utc(2006, 3, 24, 15, 32, 3)) {|t|
344
+ assert_instance_of(TimeOrDateTime, t)
345
+ assert_equal(Time.utc(2006, 3, 24, 15, 32, 3), t.to_orig)
346
+ t + 1
347
+ })
348
+ end
349
+
350
+ def test_wrap_block_datetime
351
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 4), TimeOrDateTime.wrap(DateTime.new(2006, 3, 24, 15, 32, 3)) {|t|
352
+ assert_instance_of(TimeOrDateTime, t)
353
+ assert_equal(DateTime.new(2006, 3, 24, 15, 32, 3), t.to_orig)
354
+ t + 1
355
+ })
356
+ end
357
+
358
+ def test_wrap_block_timestamp
359
+ assert_equal(1143214324, TimeOrDateTime.wrap(1143214323) {|t|
360
+ assert_instance_of(TimeOrDateTime, t)
361
+ assert_equal(1143214323, t.to_orig)
362
+ t + 1
363
+ })
364
+ end
365
+
366
+ def test_wrap_block_timestamp_str
367
+ assert_equal(1143214324, TimeOrDateTime.wrap('1143214323') {|t|
368
+ assert_instance_of(TimeOrDateTime, t)
369
+ assert_equal(1143214323, t.to_orig)
370
+ t + 1
371
+ })
372
+ end
373
+
374
+ def test_wrap_block_timeordatetime
375
+ t1 = TimeOrDateTime.new(1143214323)
376
+
377
+ t2 = TimeOrDateTime.wrap(t1) {|t|
378
+ assert_same(t1, t)
379
+ t + 1
380
+ }
381
+
382
+ assert_not_nil(t2)
383
+ assert_instance_of(TimeOrDateTime, t2)
384
+ assert_equal(1143214324, t2.to_orig)
385
+ end
386
+ end
data/test/tc_timezone.rb CHANGED
@@ -216,29 +216,49 @@ class TCTimezone < Test::Unit::TestCase
216
216
  def test_period_for_utc
217
217
  dt = DateTime.new(2005,2,18,16,24,23)
218
218
  t = Time.utc(2005,2,18,16,24,23)
219
+ t2 = Time.local(2005,2,18,16,24,23)
220
+ ts = t.to_i
219
221
 
220
222
  dt_period = Timezone.get('Europe/London').period_for_utc(dt)
221
223
  t_period = Timezone.get('Europe/London').period_for_utc(t)
224
+ t2_period = Timezone.get('Europe/London').period_for_utc(t2)
225
+ ts_period = Timezone.get('Europe/London').period_for_utc(ts)
222
226
 
223
227
  assert_equal(DateTime.new(2004,10,31,1,0,0), dt_period.utc_start)
224
- assert_equal(DateTime.new(2005,3,27,1,0,0), dt_period.utc_end)
228
+ assert_equal(DateTime.new(2005,3,27,1,0,0), dt_period.utc_end)
225
229
 
226
230
  assert_equal(DateTime.new(2004,10,31,1,0,0), t_period.utc_start)
227
231
  assert_equal(DateTime.new(2005,3,27,1,0,0), t_period.utc_end)
232
+
233
+ assert_equal(DateTime.new(2004,10,31,1,0,0), t2_period.utc_start)
234
+ assert_equal(DateTime.new(2005,3,27,1,0,0), t2_period.utc_end)
235
+
236
+ assert_equal(DateTime.new(2004,10,31,1,0,0), ts_period.utc_start)
237
+ assert_equal(DateTime.new(2005,3,27,1,0,0), ts_period.utc_end)
228
238
  end
229
239
 
230
240
  def test_period_for_local
231
241
  dt = DateTime.new(2005,2,18,16,24,23)
232
242
  t = Time.utc(2005,2,18,16,24,23)
243
+ t2 = Time.local(2005,2,18,16,24,23)
244
+ ts = t.to_i
233
245
 
234
246
  dt_period = Timezone.get('Europe/London').period_for_local(dt)
235
247
  t_period = Timezone.get('Europe/London').period_for_local(t)
248
+ t2_period = Timezone.get('Europe/London').period_for_local(t2)
249
+ ts_period = Timezone.get('Europe/London').period_for_local(ts)
236
250
 
237
251
  assert_equal(DateTime.new(2004,10,31,1,0,0), dt_period.utc_start)
238
252
  assert_equal(DateTime.new(2005,3,27,1,0,0), dt_period.utc_end)
239
253
 
240
254
  assert_equal(DateTime.new(2004,10,31,1,0,0), t_period.utc_start)
241
255
  assert_equal(DateTime.new(2005,3,27,1,0,0), t_period.utc_end)
256
+
257
+ assert_equal(DateTime.new(2004,10,31,1,0,0), t2_period.utc_start)
258
+ assert_equal(DateTime.new(2005,3,27,1,0,0), t2_period.utc_end)
259
+
260
+ assert_equal(DateTime.new(2004,10,31,1,0,0), ts_period.utc_start)
261
+ assert_equal(DateTime.new(2005,3,27,1,0,0), ts_period.utc_end)
242
262
  end
243
263
 
244
264
  def test_period_for_local_invalid
@@ -339,33 +359,49 @@ class TCTimezone < Test::Unit::TestCase
339
359
  def test_utc_to_local
340
360
  dt = DateTime.new(2005,2,18,16,24,23)
341
361
  t = Time.utc(2005,2,18,16,24,23)
362
+ t2 = Time.local(2005,2,18,16,24,23)
363
+ ts = t.to_i
342
364
 
343
- assert_equal(dt, Timezone.get('Europe/London').utc_to_local(dt))
344
- assert_not_equal(t, Timezone.get('Europe/London').utc_to_local(dt))
365
+ assert_equal(dt, Timezone.get('Europe/London').utc_to_local(dt))
345
366
  assert_equal(t, Timezone.get('Europe/London').utc_to_local(t))
346
- assert_not_equal(dt, Timezone.get('Europe/London').utc_to_local(t))
367
+ assert_equal(t, Timezone.get('Europe/London').utc_to_local(t2))
368
+ assert_equal(ts, Timezone.get('Europe/London').utc_to_local(ts))
347
369
  end
348
370
 
349
371
  def test_local_to_utc
350
372
  dt = DateTime.new(2005,2,18,16,24,23)
351
373
  t = Time.utc(2005,2,18,16,24,23)
374
+ t2 = Time.local(2005,2,18,16,24,23)
375
+ ts = t.to_i
352
376
 
353
- assert_equal(dt, Timezone.get('Europe/London').local_to_utc(dt))
354
- assert_not_equal(t, Timezone.get('Europe/London').local_to_utc(dt))
377
+ assert_equal(dt, Timezone.get('Europe/London').local_to_utc(dt))
355
378
  assert_equal(t, Timezone.get('Europe/London').local_to_utc(t))
356
- assert_not_equal(dt, Timezone.get('Europe/London').local_to_utc(t))
379
+ assert_equal(t, Timezone.get('Europe/London').local_to_utc(t2))
380
+ assert_equal(ts, Timezone.get('Europe/London').local_to_utc(ts))
357
381
  end
358
382
 
359
383
  def test_local_to_utc_invalid
360
384
  assert_raise(PeriodNotFound) {
361
385
  Timezone.get('America/New_York').local_to_utc(DateTime.new(2004,4,4,2,30,0))
362
386
  }
387
+ assert_raise(PeriodNotFound) {
388
+ Timezone.get('America/New_York').local_to_utc(Time.utc(2004,4,4,2,30,0))
389
+ }
390
+ assert_raise(PeriodNotFound) {
391
+ Timezone.get('America/New_York').local_to_utc(Time.utc(2004,4,4,2,30,0).to_i)
392
+ }
363
393
  end
364
394
 
365
395
  def test_local_to_utc_ambiguous
366
396
  assert_raise(AmbiguousTime) {
367
397
  Timezone.get('America/New_York').local_to_utc(DateTime.new(2004,10,31,1,30,0))
368
398
  }
399
+ assert_raise(AmbiguousTime) {
400
+ Timezone.get('America/New_York').local_to_utc(Time.utc(2004,10,31,1,30,0))
401
+ }
402
+ assert_raise(AmbiguousTime) {
403
+ Timezone.get('America/New_York').local_to_utc(Time.utc(2004,10,31,1,30,0).to_i)
404
+ }
369
405
  end
370
406
 
371
407
  def test_local_to_utc_dst_flag_resolved