activesupport 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activesupport might be problematic. Click here for more details.

Files changed (163) hide show
  1. data/CHANGELOG +13 -1
  2. data/lib/active_support.rb +6 -0
  3. data/lib/active_support/cache.rb +3 -1
  4. data/lib/active_support/cache/compressed_mem_cache_store.rb +4 -4
  5. data/lib/active_support/core_ext/date/behavior.rb +26 -0
  6. data/lib/active_support/core_ext/date/calculations.rb +1 -1
  7. data/lib/active_support/core_ext/hash/except.rb +4 -3
  8. data/lib/active_support/core_ext/hash/slice.rb +3 -1
  9. data/lib/active_support/core_ext/module.rb +5 -0
  10. data/lib/active_support/core_ext/module/model_naming.rb +22 -0
  11. data/lib/active_support/core_ext/object/extending.rb +9 -8
  12. data/lib/active_support/core_ext/range/blockless_step.rb +2 -2
  13. data/lib/active_support/core_ext/rexml.rb +35 -0
  14. data/lib/active_support/core_ext/string/unicode.rb +11 -13
  15. data/lib/active_support/core_ext/time.rb +22 -1
  16. data/lib/active_support/dependencies.rb +393 -392
  17. data/lib/active_support/deprecation.rb +27 -9
  18. data/lib/active_support/inflections.rb +51 -49
  19. data/lib/active_support/inflector.rb +267 -262
  20. data/lib/active_support/json/encoders/date_time.rb +1 -1
  21. data/lib/active_support/ordered_options.rb +14 -12
  22. data/lib/active_support/string_inquirer.rb +11 -0
  23. data/lib/active_support/time_with_zone.rb +34 -13
  24. data/lib/active_support/values/time_zone.rb +348 -346
  25. data/lib/active_support/vendor.rb +2 -2
  26. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo.rb +0 -0
  27. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/data_timezone.rb +0 -0
  28. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/data_timezone_info.rb +2 -0
  29. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Algiers.rb +0 -0
  30. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Cairo.rb +0 -0
  31. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Casablanca.rb +2 -0
  32. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Harare.rb +0 -0
  33. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Johannesburg.rb +0 -0
  34. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Monrovia.rb +0 -0
  35. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Nairobi.rb +0 -0
  36. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +0 -0
  37. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Argentina/San_Juan.rb +0 -0
  38. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Bogota.rb +0 -0
  39. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Caracas.rb +0 -0
  40. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Chicago.rb +0 -0
  41. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Chihuahua.rb +0 -0
  42. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Denver.rb +0 -0
  43. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Godthab.rb +0 -0
  44. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Guatemala.rb +0 -0
  45. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Halifax.rb +0 -0
  46. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Indiana/Indianapolis.rb +0 -0
  47. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Juneau.rb +0 -0
  48. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/La_Paz.rb +0 -0
  49. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Lima.rb +0 -0
  50. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Los_Angeles.rb +0 -0
  51. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Mazatlan.rb +0 -0
  52. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Mexico_City.rb +0 -0
  53. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Monterrey.rb +0 -0
  54. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/New_York.rb +0 -0
  55. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Phoenix.rb +0 -0
  56. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Regina.rb +0 -0
  57. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Santiago.rb +0 -0
  58. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/St_Johns.rb +0 -0
  59. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Tijuana.rb +0 -0
  60. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Almaty.rb +0 -0
  61. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Baghdad.rb +0 -0
  62. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Baku.rb +0 -0
  63. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Bangkok.rb +0 -0
  64. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Chongqing.rb +0 -0
  65. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Dhaka.rb +0 -0
  66. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Hong_Kong.rb +0 -0
  67. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Irkutsk.rb +0 -0
  68. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Jakarta.rb +0 -0
  69. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Jerusalem.rb +0 -0
  70. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Kabul.rb +0 -0
  71. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Kamchatka.rb +0 -0
  72. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Karachi.rb +2 -0
  73. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Katmandu.rb +0 -0
  74. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Kolkata.rb +0 -0
  75. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Krasnoyarsk.rb +0 -0
  76. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Kuala_Lumpur.rb +0 -0
  77. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Kuwait.rb +0 -0
  78. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Magadan.rb +0 -0
  79. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Muscat.rb +0 -0
  80. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Novosibirsk.rb +0 -0
  81. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Rangoon.rb +0 -0
  82. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Riyadh.rb +0 -0
  83. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Seoul.rb +0 -0
  84. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Shanghai.rb +0 -0
  85. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Singapore.rb +0 -0
  86. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Taipei.rb +0 -0
  87. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Tashkent.rb +0 -0
  88. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Tbilisi.rb +0 -0
  89. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Tehran.rb +0 -0
  90. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Tokyo.rb +0 -0
  91. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Ulaanbaatar.rb +0 -0
  92. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Urumqi.rb +0 -0
  93. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Vladivostok.rb +0 -0
  94. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Yakutsk.rb +0 -0
  95. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Yekaterinburg.rb +0 -0
  96. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Yerevan.rb +0 -0
  97. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Atlantic/Azores.rb +0 -0
  98. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Atlantic/Cape_Verde.rb +0 -0
  99. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Atlantic/South_Georgia.rb +0 -0
  100. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Australia/Adelaide.rb +0 -0
  101. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Australia/Brisbane.rb +0 -0
  102. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Australia/Darwin.rb +0 -0
  103. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Australia/Hobart.rb +0 -0
  104. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Australia/Melbourne.rb +0 -0
  105. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Australia/Perth.rb +0 -0
  106. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Australia/Sydney.rb +0 -0
  107. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Etc/UTC.rb +0 -0
  108. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Amsterdam.rb +0 -0
  109. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Athens.rb +0 -0
  110. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Belgrade.rb +0 -0
  111. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Berlin.rb +0 -0
  112. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Bratislava.rb +0 -0
  113. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Brussels.rb +0 -0
  114. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Bucharest.rb +0 -0
  115. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Budapest.rb +0 -0
  116. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Copenhagen.rb +0 -0
  117. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Dublin.rb +0 -0
  118. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Helsinki.rb +0 -0
  119. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Istanbul.rb +0 -0
  120. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Kiev.rb +0 -0
  121. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Lisbon.rb +0 -0
  122. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Ljubljana.rb +0 -0
  123. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/London.rb +0 -0
  124. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Madrid.rb +0 -0
  125. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Minsk.rb +0 -0
  126. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Moscow.rb +0 -0
  127. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Paris.rb +0 -0
  128. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Prague.rb +0 -0
  129. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Riga.rb +0 -0
  130. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Rome.rb +0 -0
  131. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Sarajevo.rb +0 -0
  132. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Skopje.rb +0 -0
  133. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Sofia.rb +0 -0
  134. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Stockholm.rb +0 -0
  135. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Tallinn.rb +0 -0
  136. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Vienna.rb +0 -0
  137. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Vilnius.rb +0 -0
  138. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Warsaw.rb +0 -0
  139. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Europe/Zagreb.rb +0 -0
  140. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Pacific/Auckland.rb +0 -0
  141. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Pacific/Fiji.rb +0 -0
  142. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Pacific/Guam.rb +0 -0
  143. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Pacific/Honolulu.rb +0 -0
  144. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Pacific/Majuro.rb +0 -0
  145. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Pacific/Midway.rb +0 -0
  146. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Pacific/Noumea.rb +0 -0
  147. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Pacific/Pago_Pago.rb +0 -0
  148. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Pacific/Port_Moresby.rb +0 -0
  149. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Pacific/Tongatapu.rb +0 -0
  150. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/info_timezone.rb +0 -0
  151. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/linked_timezone.rb +0 -0
  152. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/linked_timezone_info.rb +0 -0
  153. data/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/offset_rationals.rb +95 -0
  154. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/time_or_datetime.rb +0 -0
  155. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/timezone.rb +6 -6
  156. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/timezone_definition.rb +0 -0
  157. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/timezone_info.rb +0 -0
  158. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/timezone_offset_info.rb +4 -4
  159. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/timezone_period.rb +0 -0
  160. data/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/timezone_transition_info.rb +2 -2
  161. data/lib/active_support/version.rb +1 -1
  162. metadata +154 -151
  163. data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/offset_rationals.rb +0 -95
@@ -20,7 +20,7 @@ rescue Gem::LoadError
20
20
  end
21
21
 
22
22
  begin
23
- gem 'tzinfo', '~> 0.3.8'
23
+ gem 'tzinfo', '~> 0.3.9'
24
24
  rescue Gem::LoadError
25
- $:.unshift "#{File.dirname(__FILE__)}/vendor/tzinfo-0.3.8"
25
+ $:.unshift "#{File.dirname(__FILE__)}/vendor/tzinfo-0.3.9"
26
26
  end
@@ -40,6 +40,8 @@ module TZInfo
40
40
  super(identifier)
41
41
  @offsets = {}
42
42
  @transitions = []
43
+ @previous_offset = nil
44
+ @transitions_index = nil
43
45
  end
44
46
 
45
47
  # Defines a offset. The id uniquely identifies this offset within the
@@ -31,6 +31,8 @@ module TZInfo
31
31
  tz.transition 1978, 8, :o1, 271033200
32
32
  tz.transition 1984, 3, :o3, 448243200
33
33
  tz.transition 1985, 12, :o1, 504918000
34
+ tz.transition 2008, 6, :o2, 1212278400
35
+ tz.transition 2008, 9, :o1, 1222556400
34
36
  end
35
37
  end
36
38
  end
@@ -21,6 +21,8 @@ module TZInfo
21
21
  tz.transition 1971, 3, :o4, 38775600
22
22
  tz.transition 2002, 4, :o5, 1018119660
23
23
  tz.transition 2002, 10, :o4, 1033840860
24
+ tz.transition 2008, 5, :o5, 1212260400
25
+ tz.transition 2008, 8, :o4, 1220205600
24
26
  end
25
27
  end
26
28
  end
@@ -0,0 +1,95 @@
1
+ #--
2
+ # Copyright (c) 2006 Philip Ross
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in all
12
+ # copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ # THE SOFTWARE.
21
+ #++
22
+
23
+ module TZInfo
24
+
25
+ # Provides a method for getting Rationals for a timezone offset in seconds.
26
+ # Pre-reduced rationals are returned for all the half-hour intervals between
27
+ # -14 and +14 hours to avoid having to call gcd at runtime.
28
+ module OffsetRationals #:nodoc:
29
+ @@rational_cache = {
30
+ -50400 => Rational.send(:new!, -7,12),
31
+ -48600 => Rational.send(:new!, -9,16),
32
+ -46800 => Rational.send(:new!, -13,24),
33
+ -45000 => Rational.send(:new!, -25,48),
34
+ -43200 => Rational.send(:new!, -1,2),
35
+ -41400 => Rational.send(:new!, -23,48),
36
+ -39600 => Rational.send(:new!, -11,24),
37
+ -37800 => Rational.send(:new!, -7,16),
38
+ -36000 => Rational.send(:new!, -5,12),
39
+ -34200 => Rational.send(:new!, -19,48),
40
+ -32400 => Rational.send(:new!, -3,8),
41
+ -30600 => Rational.send(:new!, -17,48),
42
+ -28800 => Rational.send(:new!, -1,3),
43
+ -27000 => Rational.send(:new!, -5,16),
44
+ -25200 => Rational.send(:new!, -7,24),
45
+ -23400 => Rational.send(:new!, -13,48),
46
+ -21600 => Rational.send(:new!, -1,4),
47
+ -19800 => Rational.send(:new!, -11,48),
48
+ -18000 => Rational.send(:new!, -5,24),
49
+ -16200 => Rational.send(:new!, -3,16),
50
+ -14400 => Rational.send(:new!, -1,6),
51
+ -12600 => Rational.send(:new!, -7,48),
52
+ -10800 => Rational.send(:new!, -1,8),
53
+ -9000 => Rational.send(:new!, -5,48),
54
+ -7200 => Rational.send(:new!, -1,12),
55
+ -5400 => Rational.send(:new!, -1,16),
56
+ -3600 => Rational.send(:new!, -1,24),
57
+ -1800 => Rational.send(:new!, -1,48),
58
+ 0 => Rational.send(:new!, 0,1),
59
+ 1800 => Rational.send(:new!, 1,48),
60
+ 3600 => Rational.send(:new!, 1,24),
61
+ 5400 => Rational.send(:new!, 1,16),
62
+ 7200 => Rational.send(:new!, 1,12),
63
+ 9000 => Rational.send(:new!, 5,48),
64
+ 10800 => Rational.send(:new!, 1,8),
65
+ 12600 => Rational.send(:new!, 7,48),
66
+ 14400 => Rational.send(:new!, 1,6),
67
+ 16200 => Rational.send(:new!, 3,16),
68
+ 18000 => Rational.send(:new!, 5,24),
69
+ 19800 => Rational.send(:new!, 11,48),
70
+ 21600 => Rational.send(:new!, 1,4),
71
+ 23400 => Rational.send(:new!, 13,48),
72
+ 25200 => Rational.send(:new!, 7,24),
73
+ 27000 => Rational.send(:new!, 5,16),
74
+ 28800 => Rational.send(:new!, 1,3),
75
+ 30600 => Rational.send(:new!, 17,48),
76
+ 32400 => Rational.send(:new!, 3,8),
77
+ 34200 => Rational.send(:new!, 19,48),
78
+ 36000 => Rational.send(:new!, 5,12),
79
+ 37800 => Rational.send(:new!, 7,16),
80
+ 39600 => Rational.send(:new!, 11,24),
81
+ 41400 => Rational.send(:new!, 23,48),
82
+ 43200 => Rational.send(:new!, 1,2),
83
+ 45000 => Rational.send(:new!, 25,48),
84
+ 46800 => Rational.send(:new!, 13,24),
85
+ 48600 => Rational.send(:new!, 9,16),
86
+ 50400 => Rational.send(:new!, 7,12)}
87
+
88
+ # Returns a Rational expressing the fraction of a day that offset in
89
+ # seconds represents (i.e. equivalent to Rational(offset, 86400)).
90
+ def rational_for_offset(offset)
91
+ @@rational_cache[offset] || Rational(offset, 86400)
92
+ end
93
+ module_function :rational_for_offset
94
+ end
95
+ end