activesupport 3.0.0.beta4 → 3.0.pre

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 (333) hide show
  1. data/CHANGELOG +1 -100
  2. data/lib/active_support.rb +4 -38
  3. data/lib/active_support/autoload.rb +28 -0
  4. data/lib/active_support/backtrace_cleaner.rb +9 -31
  5. data/lib/active_support/benchmarkable.rb +0 -1
  6. data/lib/active_support/buffered_logger.rb +1 -0
  7. data/lib/active_support/cache.rb +81 -436
  8. data/lib/active_support/cache/compressed_mem_cache_store.rb +13 -6
  9. data/lib/active_support/cache/file_store.rb +41 -139
  10. data/lib/active_support/cache/mem_cache_store.rb +75 -120
  11. data/lib/active_support/cache/memory_store.rb +27 -127
  12. data/lib/active_support/cache/strategy/local_cache.rb +58 -111
  13. data/lib/active_support/cache/synchronized_memory_store.rb +38 -2
  14. data/lib/active_support/callbacks.rb +48 -87
  15. data/lib/active_support/configurable.rb +18 -19
  16. data/lib/active_support/core_ext/array.rb +0 -1
  17. data/lib/active_support/core_ext/array/access.rb +1 -1
  18. data/lib/active_support/core_ext/array/conversions.rb +54 -29
  19. data/lib/active_support/core_ext/array/extract_options.rb +1 -16
  20. data/lib/active_support/core_ext/array/random_access.rb +5 -19
  21. data/lib/active_support/core_ext/array/wrap.rb +9 -13
  22. data/lib/active_support/core_ext/benchmark.rb +12 -0
  23. data/lib/active_support/core_ext/boolean.rb +1 -0
  24. data/lib/active_support/core_ext/boolean/conversions.rb +11 -0
  25. data/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb +0 -2
  26. data/lib/active_support/core_ext/class.rb +1 -1
  27. data/lib/active_support/core_ext/class/attribute_accessors.rb +27 -33
  28. data/lib/active_support/core_ext/class/delegating_attributes.rb +41 -35
  29. data/lib/active_support/core_ext/class/inheritable_attributes.rb +13 -22
  30. data/lib/active_support/core_ext/class/removal.rb +53 -0
  31. data/lib/active_support/core_ext/date.rb +7 -0
  32. data/lib/active_support/core_ext/date/calculations.rb +8 -30
  33. data/lib/active_support/core_ext/date/conversions.rb +2 -2
  34. data/lib/active_support/core_ext/date_time.rb +5 -0
  35. data/lib/active_support/core_ext/date_time/calculations.rb +1 -2
  36. data/lib/active_support/core_ext/date_time/conversions.rb +5 -23
  37. data/lib/active_support/core_ext/enumerable.rb +9 -5
  38. data/lib/active_support/core_ext/exception.rb +47 -0
  39. data/lib/active_support/core_ext/file.rb +0 -1
  40. data/lib/active_support/core_ext/file/atomic.rb +2 -3
  41. data/lib/active_support/core_ext/float/rounding.rb +2 -3
  42. data/lib/active_support/core_ext/hash/conversions.rb +145 -65
  43. data/lib/active_support/core_ext/hash/deep_merge.rb +7 -6
  44. data/lib/active_support/core_ext/hash/except.rb +0 -8
  45. data/lib/active_support/core_ext/hash/indifferent_access.rb +0 -5
  46. data/lib/active_support/core_ext/hash/keys.rb +11 -10
  47. data/lib/active_support/core_ext/hash/slice.rb +0 -6
  48. data/lib/active_support/core_ext/integer.rb +1 -1
  49. data/lib/active_support/core_ext/integer/even_odd.rb +16 -0
  50. data/lib/active_support/core_ext/kernel.rb +1 -1
  51. data/lib/active_support/core_ext/kernel/daemonizing.rb +7 -0
  52. data/lib/active_support/core_ext/kernel/debugger.rb +2 -3
  53. data/lib/active_support/core_ext/kernel/reporting.rb +1 -2
  54. data/lib/active_support/core_ext/load_error.rb +30 -17
  55. data/lib/active_support/core_ext/logger.rb +1 -1
  56. data/lib/active_support/core_ext/module.rb +3 -5
  57. data/lib/active_support/core_ext/module/aliasing.rb +1 -1
  58. data/lib/active_support/core_ext/module/attr_accessor_with_default.rb +1 -1
  59. data/lib/active_support/core_ext/module/attr_internal.rb +2 -2
  60. data/lib/active_support/core_ext/module/attribute_accessors.rb +21 -25
  61. data/lib/active_support/core_ext/module/delegation.rb +10 -21
  62. data/lib/active_support/core_ext/module/inclusion.rb +30 -0
  63. data/lib/active_support/core_ext/module/introspection.rb +8 -8
  64. data/lib/active_support/core_ext/module/loading.rb +23 -0
  65. data/lib/active_support/core_ext/module/synchronization.rb +1 -2
  66. data/lib/active_support/core_ext/name_error.rb +1 -3
  67. data/lib/active_support/core_ext/nil.rb +1 -0
  68. data/lib/active_support/core_ext/nil/conversions.rb +5 -0
  69. data/lib/active_support/core_ext/object.rb +2 -6
  70. data/lib/active_support/core_ext/object/blank.rb +2 -20
  71. data/lib/active_support/core_ext/object/conversions.rb +16 -2
  72. data/lib/active_support/core_ext/object/duplicable.rb +1 -23
  73. data/lib/active_support/core_ext/object/extending.rb +77 -8
  74. data/lib/active_support/core_ext/object/instance_variables.rb +7 -0
  75. data/lib/active_support/core_ext/object/metaclass.rb +13 -0
  76. data/lib/active_support/core_ext/object/misc.rb +1 -0
  77. data/lib/active_support/core_ext/object/tap.rb +16 -0
  78. data/lib/active_support/core_ext/object/with_options.rb +0 -2
  79. data/lib/active_support/core_ext/proc.rb +4 -4
  80. data/lib/active_support/core_ext/regexp.rb +22 -0
  81. data/lib/active_support/core_ext/rexml.rb +1 -4
  82. data/lib/active_support/core_ext/string.rb +2 -3
  83. data/lib/active_support/core_ext/string/access.rb +2 -4
  84. data/lib/active_support/core_ext/string/bytesize.rb +5 -0
  85. data/lib/active_support/core_ext/string/conversions.rb +1 -36
  86. data/lib/active_support/core_ext/string/filters.rb +0 -29
  87. data/lib/active_support/core_ext/string/inflections.rb +12 -1
  88. data/lib/active_support/core_ext/string/interpolation.rb +92 -2
  89. data/lib/active_support/core_ext/string/iterators.rb +13 -0
  90. data/lib/active_support/core_ext/string/multibyte.rb +19 -16
  91. data/lib/active_support/core_ext/string/output_safety.rb +35 -101
  92. data/lib/active_support/core_ext/string/starts_ends_with.rb +14 -0
  93. data/lib/active_support/core_ext/string/xchar.rb +1 -1
  94. data/lib/active_support/core_ext/symbol.rb +1 -0
  95. data/lib/active_support/core_ext/symbol/to_proc.rb +14 -0
  96. data/lib/active_support/core_ext/time.rb +10 -0
  97. data/lib/active_support/core_ext/time/calculations.rb +7 -9
  98. data/lib/active_support/core_ext/time/conversions.rb +0 -1
  99. data/lib/active_support/core_ext/time/marshal_with_utc_flag.rb +22 -0
  100. data/lib/active_support/core_ext/uri.rb +4 -10
  101. data/lib/active_support/dependencies.rb +192 -179
  102. data/lib/active_support/deprecated_callbacks.rb +283 -0
  103. data/lib/active_support/deprecation/behaviors.rb +1 -1
  104. data/lib/active_support/deprecation/method_wrappers.rb +9 -10
  105. data/lib/active_support/deprecation/reporting.rb +1 -2
  106. data/lib/active_support/duration.rb +2 -6
  107. data/lib/active_support/hash_with_indifferent_access.rb +1 -9
  108. data/lib/active_support/inflections.rb +1 -1
  109. data/lib/active_support/inflector.rb +407 -4
  110. data/lib/active_support/json/backends/jsongem.rb +9 -12
  111. data/lib/active_support/json/decoding.rb +1 -16
  112. data/lib/active_support/json/encoding.rb +12 -42
  113. data/lib/active_support/locale/en.yml +1 -4
  114. data/lib/active_support/memoizable.rb +1 -1
  115. data/lib/active_support/message_encryptor.rb +0 -1
  116. data/lib/active_support/message_verifier.rb +5 -6
  117. data/lib/active_support/multibyte.rb +22 -7
  118. data/lib/active_support/multibyte/chars.rb +392 -164
  119. data/lib/active_support/multibyte/unicode_database.rb +71 -0
  120. data/lib/active_support/multibyte/utils.rb +7 -6
  121. data/lib/active_support/notifications.rb +113 -23
  122. data/lib/active_support/ordered_hash.rb +11 -35
  123. data/lib/active_support/ordered_options.rb +0 -6
  124. data/lib/active_support/rescuable.rb +4 -7
  125. data/lib/active_support/ruby/shim.rb +6 -4
  126. data/lib/active_support/test_case.rb +7 -2
  127. data/lib/active_support/testing/assertions.rb +0 -15
  128. data/lib/active_support/testing/declarative.rb +1 -1
  129. data/lib/active_support/testing/isolation.rb +19 -63
  130. data/lib/active_support/testing/performance.rb +337 -342
  131. data/lib/active_support/testing/setup_and_teardown.rb +29 -51
  132. data/lib/active_support/time.rb +3 -23
  133. data/lib/active_support/time_with_zone.rb +10 -5
  134. data/lib/active_support/values/time_zone.rb +84 -40
  135. data/lib/active_support/values/unicode_tables.dat +0 -0
  136. data/lib/active_support/vendor.rb +16 -0
  137. data/lib/active_support/vendor/builder-2.1.2/lib/blankslate.rb +113 -0
  138. data/lib/active_support/vendor/builder-2.1.2/lib/builder.rb +13 -0
  139. data/lib/active_support/vendor/builder-2.1.2/lib/builder/blankslate.rb +20 -0
  140. data/lib/active_support/vendor/builder-2.1.2/lib/builder/css.rb +250 -0
  141. data/lib/active_support/vendor/builder-2.1.2/lib/builder/xchar.rb +115 -0
  142. data/lib/active_support/vendor/builder-2.1.2/lib/builder/xmlbase.rb +139 -0
  143. data/lib/active_support/vendor/builder-2.1.2/lib/builder/xmlevents.rb +63 -0
  144. data/lib/active_support/vendor/builder-2.1.2/lib/builder/xmlmarkup.rb +328 -0
  145. data/lib/active_support/vendor/i18n-0.1.3/MIT-LICENSE +20 -0
  146. data/lib/active_support/vendor/i18n-0.1.3/README.textile +20 -0
  147. data/lib/active_support/vendor/i18n-0.1.3/Rakefile +5 -0
  148. data/lib/active_support/vendor/i18n-0.1.3/i18n.gemspec +27 -0
  149. data/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb +204 -0
  150. data/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb +215 -0
  151. data/lib/active_support/vendor/i18n-0.1.3/lib/i18n/exceptions.rb +53 -0
  152. data/lib/active_support/vendor/i18n-0.1.3/test/all.rb +5 -0
  153. data/lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb +99 -0
  154. data/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb +124 -0
  155. data/lib/active_support/vendor/i18n-0.1.3/test/locale/en.rb +1 -0
  156. data/lib/active_support/vendor/i18n-0.1.3/test/locale/en.yml +3 -0
  157. data/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb +567 -0
  158. data/lib/active_support/vendor/memcache-client-1.7.5/lib/memcache.rb +1133 -0
  159. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo.rb +33 -0
  160. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/data_timezone.rb +47 -0
  161. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/data_timezone_info.rb +228 -0
  162. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Algiers.rb +55 -0
  163. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Cairo.rb +219 -0
  164. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Casablanca.rb +42 -0
  165. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Harare.rb +18 -0
  166. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Johannesburg.rb +25 -0
  167. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Monrovia.rb +22 -0
  168. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Nairobi.rb +23 -0
  169. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +166 -0
  170. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Argentina/San_Juan.rb +86 -0
  171. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Bogota.rb +23 -0
  172. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Caracas.rb +23 -0
  173. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Chicago.rb +283 -0
  174. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Chihuahua.rb +136 -0
  175. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Denver.rb +204 -0
  176. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Godthab.rb +161 -0
  177. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Guatemala.rb +27 -0
  178. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Halifax.rb +274 -0
  179. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Indiana/Indianapolis.rb +149 -0
  180. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Juneau.rb +194 -0
  181. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/La_Paz.rb +22 -0
  182. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Lima.rb +35 -0
  183. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Los_Angeles.rb +232 -0
  184. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Mazatlan.rb +139 -0
  185. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Mexico_City.rb +144 -0
  186. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Monterrey.rb +131 -0
  187. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/New_York.rb +282 -0
  188. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Phoenix.rb +30 -0
  189. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Regina.rb +74 -0
  190. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Santiago.rb +205 -0
  191. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Sao_Paulo.rb +171 -0
  192. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/St_Johns.rb +288 -0
  193. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Tijuana.rb +196 -0
  194. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Almaty.rb +67 -0
  195. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Baghdad.rb +73 -0
  196. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Baku.rb +161 -0
  197. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Bangkok.rb +20 -0
  198. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Chongqing.rb +33 -0
  199. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Colombo.rb +30 -0
  200. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Dhaka.rb +27 -0
  201. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Hong_Kong.rb +87 -0
  202. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Irkutsk.rb +165 -0
  203. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Jakarta.rb +30 -0
  204. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Jerusalem.rb +163 -0
  205. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kabul.rb +20 -0
  206. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kamchatka.rb +163 -0
  207. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Karachi.rb +32 -0
  208. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kathmandu.rb +20 -0
  209. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kolkata.rb +25 -0
  210. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Krasnoyarsk.rb +163 -0
  211. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kuala_Lumpur.rb +31 -0
  212. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kuwait.rb +18 -0
  213. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Magadan.rb +163 -0
  214. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Muscat.rb +18 -0
  215. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Novosibirsk.rb +164 -0
  216. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Rangoon.rb +24 -0
  217. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Riyadh.rb +18 -0
  218. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Seoul.rb +34 -0
  219. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Shanghai.rb +35 -0
  220. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Singapore.rb +33 -0
  221. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Taipei.rb +59 -0
  222. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Tashkent.rb +47 -0
  223. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Tbilisi.rb +78 -0
  224. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Tehran.rb +121 -0
  225. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Tokyo.rb +30 -0
  226. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Ulaanbaatar.rb +65 -0
  227. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Urumqi.rb +33 -0
  228. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Vladivostok.rb +164 -0
  229. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Yakutsk.rb +163 -0
  230. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Yekaterinburg.rb +165 -0
  231. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Yerevan.rb +165 -0
  232. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Atlantic/Azores.rb +270 -0
  233. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Atlantic/Cape_Verde.rb +23 -0
  234. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Atlantic/South_Georgia.rb +18 -0
  235. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Adelaide.rb +187 -0
  236. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Brisbane.rb +35 -0
  237. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Darwin.rb +29 -0
  238. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Hobart.rb +193 -0
  239. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Melbourne.rb +185 -0
  240. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Perth.rb +37 -0
  241. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Sydney.rb +185 -0
  242. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Etc/UTC.rb +16 -0
  243. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Amsterdam.rb +228 -0
  244. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Athens.rb +185 -0
  245. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Belgrade.rb +163 -0
  246. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Berlin.rb +188 -0
  247. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Bratislava.rb +13 -0
  248. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Brussels.rb +232 -0
  249. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Bucharest.rb +181 -0
  250. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Budapest.rb +197 -0
  251. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Copenhagen.rb +179 -0
  252. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Dublin.rb +276 -0
  253. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Helsinki.rb +163 -0
  254. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Istanbul.rb +218 -0
  255. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Kiev.rb +168 -0
  256. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Lisbon.rb +268 -0
  257. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Ljubljana.rb +13 -0
  258. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/London.rb +288 -0
  259. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Madrid.rb +211 -0
  260. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Minsk.rb +170 -0
  261. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Moscow.rb +181 -0
  262. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Paris.rb +232 -0
  263. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Prague.rb +187 -0
  264. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Riga.rb +176 -0
  265. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Rome.rb +215 -0
  266. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Sarajevo.rb +13 -0
  267. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Skopje.rb +13 -0
  268. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Sofia.rb +173 -0
  269. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Stockholm.rb +165 -0
  270. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Tallinn.rb +172 -0
  271. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Vienna.rb +183 -0
  272. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Vilnius.rb +170 -0
  273. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Warsaw.rb +212 -0
  274. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Zagreb.rb +13 -0
  275. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Auckland.rb +202 -0
  276. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Fiji.rb +23 -0
  277. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Guam.rb +22 -0
  278. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Honolulu.rb +28 -0
  279. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Majuro.rb +20 -0
  280. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Midway.rb +25 -0
  281. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Noumea.rb +25 -0
  282. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Pago_Pago.rb +26 -0
  283. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Port_Moresby.rb +20 -0
  284. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Tongatapu.rb +27 -0
  285. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/info_timezone.rb +52 -0
  286. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/linked_timezone.rb +51 -0
  287. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/linked_timezone_info.rb +44 -0
  288. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/offset_rationals.rb +98 -0
  289. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/ruby_core_support.rb +56 -0
  290. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/time_or_datetime.rb +292 -0
  291. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone.rb +508 -0
  292. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone_definition.rb +56 -0
  293. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone_info.rb +40 -0
  294. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone_offset_info.rb +94 -0
  295. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone_period.rb +198 -0
  296. data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone_transition_info.rb +129 -0
  297. data/lib/active_support/version.rb +2 -3
  298. data/lib/active_support/whiny_nil.rb +7 -9
  299. data/lib/active_support/xml_mini.rb +1 -126
  300. data/lib/active_support/xml_mini/jdom.rb +0 -2
  301. data/lib/active_support/xml_mini/libxml.rb +86 -24
  302. data/lib/active_support/xml_mini/nokogiri.rb +24 -27
  303. data/lib/active_support/xml_mini/rexml.rb +1 -7
  304. metadata +191 -49
  305. data/lib/active_support/builder.rb +0 -6
  306. data/lib/active_support/core_ext/array/uniq_by.rb +0 -17
  307. data/lib/active_support/core_ext/class/attribute.rb +0 -67
  308. data/lib/active_support/core_ext/class/subclasses.rb +0 -55
  309. data/lib/active_support/core_ext/file/path.rb +0 -5
  310. data/lib/active_support/core_ext/integer/multiple.rb +0 -6
  311. data/lib/active_support/core_ext/kernel/singleton_class.rb +0 -13
  312. data/lib/active_support/core_ext/module/anonymous.rb +0 -24
  313. data/lib/active_support/core_ext/module/method_names.rb +0 -14
  314. data/lib/active_support/core_ext/module/reachable.rb +0 -10
  315. data/lib/active_support/core_ext/module/remove_method.rb +0 -6
  316. data/lib/active_support/core_ext/object/to_param.rb +0 -49
  317. data/lib/active_support/core_ext/object/to_query.rb +0 -27
  318. data/lib/active_support/core_ext/string/encoding.rb +0 -11
  319. data/lib/active_support/core_ext/string/exclude.rb +0 -6
  320. data/lib/active_support/core_ext/time/marshal.rb +0 -56
  321. data/lib/active_support/dependencies/autoload.rb +0 -50
  322. data/lib/active_support/i18n.rb +0 -8
  323. data/lib/active_support/inflector/inflections.rb +0 -211
  324. data/lib/active_support/inflector/methods.rb +0 -141
  325. data/lib/active_support/inflector/transliterate.rb +0 -97
  326. data/lib/active_support/json/backends/yajl.rb +0 -40
  327. data/lib/active_support/lazy_load_hooks.rb +0 -27
  328. data/lib/active_support/multibyte/unicode.rb +0 -393
  329. data/lib/active_support/notifications/fanout.rb +0 -93
  330. data/lib/active_support/notifications/instrumenter.rb +0 -56
  331. data/lib/active_support/railtie.rb +0 -100
  332. data/lib/active_support/xml_mini/libxmlsax.rb +0 -85
  333. data/lib/active_support/xml_mini/nokogirisax.rb +0 -83
@@ -0,0 +1,71 @@
1
+ # encoding: utf-8
2
+
3
+ module ActiveSupport #:nodoc:
4
+ module Multibyte #:nodoc:
5
+ # Holds data about a codepoint in the Unicode database
6
+ class Codepoint
7
+ attr_accessor :code, :combining_class, :decomp_type, :decomp_mapping, :uppercase_mapping, :lowercase_mapping
8
+ end
9
+
10
+ # Holds static data from the Unicode database
11
+ class UnicodeDatabase
12
+ ATTRIBUTES = :codepoints, :composition_exclusion, :composition_map, :boundary, :cp1252
13
+
14
+ attr_writer(*ATTRIBUTES)
15
+
16
+ def initialize
17
+ @codepoints = Hash.new(Codepoint.new)
18
+ @composition_exclusion = []
19
+ @composition_map = {}
20
+ @boundary = {}
21
+ @cp1252 = {}
22
+ end
23
+
24
+ # Lazy load the Unicode database so it's only loaded when it's actually used
25
+ ATTRIBUTES.each do |attr_name|
26
+ class_eval(<<-EOS, __FILE__, __LINE__ + 1)
27
+ def #{attr_name} # def codepoints
28
+ load # load
29
+ @#{attr_name} # @codepoints
30
+ end # end
31
+ EOS
32
+ end
33
+
34
+ # Loads the Unicode database and returns all the internal objects of UnicodeDatabase.
35
+ def load
36
+ begin
37
+ @codepoints, @composition_exclusion, @composition_map, @boundary, @cp1252 = File.open(self.class.filename, 'rb') { |f| Marshal.load f.read }
38
+ rescue Exception => e
39
+ raise IOError.new("Couldn't load the Unicode tables for UTF8Handler (#{e.message}), ActiveSupport::Multibyte is unusable")
40
+ end
41
+
42
+ # Redefine the === method so we can write shorter rules for grapheme cluster breaks
43
+ @boundary.each do |k,_|
44
+ @boundary[k].instance_eval do
45
+ def ===(other)
46
+ detect { |i| i === other } ? true : false
47
+ end
48
+ end if @boundary[k].kind_of?(Array)
49
+ end
50
+
51
+ # define attr_reader methods for the instance variables
52
+ class << self
53
+ attr_reader(*ATTRIBUTES)
54
+ end
55
+ end
56
+
57
+ # Returns the directory in which the data files are stored
58
+ def self.dirname
59
+ File.dirname(__FILE__) + '/../values/'
60
+ end
61
+
62
+ # Returns the filename for the data file for this version
63
+ def self.filename
64
+ File.expand_path File.join(dirname, "unicode_tables.dat")
65
+ end
66
+ end
67
+
68
+ # UniCode Database
69
+ UCD = UnicodeDatabase.new
70
+ end
71
+ end
@@ -26,11 +26,11 @@ module ActiveSupport #:nodoc:
26
26
  else
27
27
  def self.verify(string)
28
28
  if expression = valid_character
29
- # Splits the string on character boundaries, which are determined based on $KCODE.
30
- string.split(//).all? { |c| expression =~ c }
31
- else
32
- true
29
+ for c in string.split(//)
30
+ return false unless expression.match(c)
31
+ end
33
32
  end
33
+ true
34
34
  end
35
35
  end
36
36
 
@@ -49,8 +49,9 @@ module ActiveSupport #:nodoc:
49
49
  else
50
50
  def self.clean(string)
51
51
  if expression = valid_character
52
- # Splits the string on character boundaries, which are determined based on $KCODE.
53
- string.split(//).grep(expression).join
52
+ stripped = []; for c in string.split(//)
53
+ stripped << c if expression.match(c)
54
+ end; stripped.join
54
55
  else
55
56
  string
56
57
  end
@@ -1,4 +1,6 @@
1
+ require 'thread'
1
2
  require 'active_support/core_ext/module/delegation'
3
+ require 'active_support/core_ext/module/attribute_accessors'
2
4
 
3
5
  module ActiveSupport
4
6
  # Notifications provides an instrumentation API for Ruby. To instrument an
@@ -9,12 +11,12 @@ module ActiveSupport
9
11
  # end
10
12
  #
11
13
  # You can consume those events and the information they provide by registering
12
- # a log subscriber. For instance, let's store all instrumented events in an array:
14
+ # a subscriber. For instance, let's store all instrumented events in an array:
13
15
  #
14
16
  # @events = []
15
17
  #
16
- # ActiveSupport::Notifications.subscribe do |*args|
17
- # @events << ActiveSupport::Notifications::Event.new(*args)
18
+ # ActiveSupport::Notifications.subscribe do |event|
19
+ # @events << event
18
20
  # end
19
21
  #
20
22
  # ActiveSupport::Notifications.instrument(:render, :extra => :information) do
@@ -22,6 +24,7 @@ module ActiveSupport
22
24
  # end
23
25
  #
24
26
  # event = @events.first
27
+ # event.class #=> ActiveSupport::Notifications::Event
25
28
  # event.name #=> :render
26
29
  # event.duration #=> 10 (in miliseconds)
27
30
  # event.result #=> "Foo"
@@ -35,47 +38,134 @@ module ActiveSupport
35
38
  # end
36
39
  #
37
40
  # Notifications ships with a queue implementation that consumes and publish events
38
- # to log subscribers in a thread. You can use any queue implementation you want.
41
+ # to subscribers in a thread. You can use any queue implementation you want.
39
42
  #
40
43
  module Notifications
41
- autoload :Instrumenter, 'active_support/notifications/instrumenter'
42
- autoload :Event, 'active_support/notifications/instrumenter'
43
- autoload :Fanout, 'active_support/notifications/fanout'
44
+ mattr_accessor :queue
44
45
 
45
46
  class << self
46
- attr_writer :notifier
47
- delegate :publish, :subscribe, :unsubscribe, :to => :notifier
48
47
  delegate :instrument, :to => :instrumenter
49
48
 
50
- def notifier
51
- @notifier ||= Notifier.new
49
+ def instrumenter
50
+ Thread.current[:notifications_instrumeter] ||= Instrumenter.new(publisher)
52
51
  end
53
52
 
54
- def instrumenter
55
- Thread.current[:"instrumentation_#{notifier.object_id}"] ||= Instrumenter.new(notifier)
53
+ def publisher
54
+ @publisher ||= Publisher.new(queue)
55
+ end
56
+
57
+ def subscribe(pattern=nil, &block)
58
+ Subscriber.new(queue).bind(pattern).subscribe(&block)
59
+ end
60
+ end
61
+
62
+ class Instrumenter
63
+ def initialize(publisher)
64
+ @publisher = publisher
65
+ end
66
+
67
+ def instrument(name, payload={})
68
+ payload[:time] = Time.now
69
+ payload[:thread_id] = Thread.current.object_id
70
+ payload[:result] = yield if block_given?
71
+ ensure
72
+ payload[:duration] = 1000 * (Time.now.to_f - payload[:time].to_f)
73
+ @publisher.publish(name, payload)
74
+ end
75
+ end
76
+
77
+ class Publisher
78
+ def initialize(queue)
79
+ @queue = queue
80
+ end
81
+
82
+ def publish(name, payload)
83
+ @queue.publish(name, payload)
56
84
  end
57
85
  end
58
86
 
59
- class Notifier
60
- def initialize(queue = Fanout.new)
87
+ class Subscriber
88
+ def initialize(queue)
61
89
  @queue = queue
62
90
  end
63
91
 
64
- def publish(*args)
65
- @queue.publish(*args)
92
+ def bind(pattern)
93
+ @pattern = pattern
94
+ self
95
+ end
96
+
97
+ def subscribe
98
+ @queue.subscribe(@pattern) do |name, payload|
99
+ yield Event.new(name, payload)
100
+ end
101
+ end
102
+ end
103
+
104
+ class Event
105
+ attr_reader :name, :time, :duration, :thread_id, :result, :payload
106
+
107
+ def initialize(name, payload)
108
+ @name = name
109
+ @payload = payload.dup
110
+ @time = @payload.delete(:time)
111
+ @thread_id = @payload.delete(:thread_id)
112
+ @result = @payload.delete(:result)
113
+ @duration = @payload.delete(:duration)
114
+ end
115
+
116
+ def parent_of?(event)
117
+ start = (self.time - event.time) * 1000
118
+ start <= 0 && (start + self.duration >= event.duration)
119
+ end
120
+ end
121
+
122
+ # This is a default queue implementation that ships with Notifications. It
123
+ # consumes events in a thread and publish them to all registered subscribers.
124
+ #
125
+ class LittleFanout
126
+ def initialize
127
+ @listeners, @stream = [], Queue.new
128
+ @thread = Thread.new { consume }
129
+ end
130
+
131
+ def publish(*event)
132
+ @stream.push(event)
66
133
  end
67
134
 
68
- def subscribe(pattern = nil, &block)
69
- @queue.bind(pattern).subscribe(&block)
135
+ def subscribe(pattern=nil, &block)
136
+ @listeners << Listener.new(pattern, &block)
70
137
  end
71
138
 
72
- def unsubscribe(subscriber)
73
- @queue.unsubscribe(subscriber)
139
+ def consume
140
+ while event = @stream.shift
141
+ @listeners.each { |l| l.publish(*event) }
142
+ end
74
143
  end
75
144
 
76
- def wait
77
- @queue.wait
145
+ class Listener
146
+ attr_reader :thread
147
+
148
+ def initialize(pattern, &block)
149
+ @pattern = pattern
150
+ @subscriber = block
151
+ @queue = Queue.new
152
+ @thread = Thread.new { consume }
153
+ end
154
+
155
+ def publish(name, payload)
156
+ unless @pattern && !(@pattern === name.to_s)
157
+ @queue << [name, payload]
158
+ end
159
+ end
160
+
161
+ def consume
162
+ while event = @queue.shift
163
+ @subscriber.call(*event)
164
+ end
165
+ end
78
166
  end
79
167
  end
80
168
  end
169
+
170
+ Notifications.queue = Notifications::LittleFanout.new
81
171
  end
@@ -1,28 +1,10 @@
1
- require 'yaml'
2
-
3
- YAML.add_builtin_type("omap") do |type, val|
4
- ActiveSupport::OrderedHash[val.map(&:to_a).map(&:first)]
5
- end
6
-
7
1
  # OrderedHash is namespaced to prevent conflicts with other implementations
8
2
  module ActiveSupport
9
- class OrderedHash < ::Hash #:nodoc:
10
- def to_yaml_type
11
- "!tag:yaml.org,2002:omap"
12
- end
13
-
14
- def to_yaml(opts = {})
15
- YAML.quick_emit(self, opts) do |out|
16
- out.seq(taguri, to_yaml_style) do |seq|
17
- each do |k, v|
18
- seq.add(k => v)
19
- end
20
- end
21
- end
22
- end
23
-
24
- # Hash is ordered in Ruby 1.9!
25
- if RUBY_VERSION < '1.9'
3
+ # Hash is ordered in Ruby 1.9!
4
+ if RUBY_VERSION >= '1.9'
5
+ OrderedHash = ::Hash
6
+ else
7
+ class OrderedHash < Hash #:nodoc:
26
8
  def initialize(*args, &block)
27
9
  super
28
10
  @keys = []
@@ -70,7 +52,7 @@ module ActiveSupport
70
52
  end
71
53
  super
72
54
  end
73
-
55
+
74
56
  def delete_if
75
57
  super
76
58
  sync_keys!
@@ -138,21 +120,15 @@ module ActiveSupport
138
120
  dup.merge!(other_hash)
139
121
  end
140
122
 
141
- # When replacing with another hash, the initial order of our keys must come from the other hash -ordered or not.
142
- def replace(other)
143
- super
144
- @keys = other.keys
145
- self
146
- end
147
-
148
123
  def inspect
149
124
  "#<OrderedHash #{super}>"
150
125
  end
151
126
 
152
- private
153
- def sync_keys!
154
- @keys.delete_if {|k| !has_key?(k)}
155
- end
127
+ private
128
+
129
+ def sync_keys!
130
+ @keys.delete_if {|k| !has_key?(k)}
131
+ end
156
132
  end
157
133
  end
158
134
  end
@@ -18,10 +18,4 @@ module ActiveSupport #:nodoc:
18
18
  end
19
19
  end
20
20
  end
21
-
22
- class InheritableOptions < OrderedOptions
23
- def initialize(parent)
24
- super() { |h,k| parent[k] }
25
- end
26
- end
27
21
  end
@@ -1,8 +1,5 @@
1
- require 'active_support/concern'
2
- require 'active_support/core_ext/class/attribute'
1
+ require 'active_support/core_ext/class/inheritable_attributes'
3
2
  require 'active_support/core_ext/proc'
4
- require 'active_support/core_ext/string/inflections'
5
- require 'active_support/core_ext/array/extract_options'
6
3
 
7
4
  module ActiveSupport
8
5
  # Rescuable module adds support for easier exception handling.
@@ -10,7 +7,7 @@ module ActiveSupport
10
7
  extend Concern
11
8
 
12
9
  included do
13
- class_attribute :rescue_handlers
10
+ class_inheritable_accessor :rescue_handlers
14
11
  self.rescue_handlers = []
15
12
  end
16
13
 
@@ -68,7 +65,7 @@ module ActiveSupport
68
65
  end
69
66
 
70
67
  # put the new handler at the end because the list is read in reverse
71
- self.rescue_handlers += [[key, options[:with]]]
68
+ rescue_handlers << [key, options[:with]]
72
69
  end
73
70
  end
74
71
  end
@@ -84,7 +81,7 @@ module ActiveSupport
84
81
  def handler_for_rescue(exception)
85
82
  # We go from right to left because pairs are pushed onto rescue_handlers
86
83
  # as rescue_from declarations are found.
87
- _, rescuer = self.class.rescue_handlers.reverse.detect do |klass_name, handler|
84
+ _, rescuer = Array(rescue_handlers).reverse.detect do |klass_name, handler|
88
85
  # The purpose of allowing strings in rescue_from is to support the
89
86
  # declaration of handler associations for exception classes whose
90
87
  # definition is yet unknown.
@@ -4,19 +4,21 @@
4
4
  # Date next_year, next_month
5
5
  # DateTime to_date, to_datetime, xmlschema
6
6
  # Enumerable group_by, each_with_object, none?
7
+ # Integer even?, odd?
8
+ # Object tap
7
9
  # Process Process.daemon
8
10
  # REXML security fix
9
11
  # String ord
12
+ # Symbol to_proc
10
13
  # Time to_date, to_time, to_datetime
11
14
  require 'active_support'
12
15
  require 'active_support/core_ext/date/calculations'
13
16
  require 'active_support/core_ext/date_time/conversions'
14
17
  require 'active_support/core_ext/enumerable'
18
+ require 'active_support/core_ext/integer/even_odd'
19
+ require 'active_support/core_ext/object/tap'
15
20
  require 'active_support/core_ext/process/daemon'
16
21
  require 'active_support/core_ext/string/conversions'
17
- require 'active_support/core_ext/string/interpolation'
18
- require 'active_support/core_ext/string/encoding'
19
22
  require 'active_support/core_ext/rexml'
23
+ require 'active_support/core_ext/symbol/to_proc'
20
24
  require 'active_support/core_ext/time/conversions'
21
- require 'active_support/core_ext/file/path'
22
- require 'active_support/core_ext/module/method_names'
@@ -5,10 +5,9 @@ require 'active_support/testing/deprecation'
5
5
  require 'active_support/testing/declarative'
6
6
  require 'active_support/testing/pending'
7
7
  require 'active_support/testing/isolation'
8
- require 'active_support/core_ext/kernel/reporting'
9
8
 
10
9
  begin
11
- silence_warnings { require 'mocha' }
10
+ require 'mocha'
12
11
  rescue LoadError
13
12
  # Fake Mocha::ExpectationError so we can rescue it in #run. Bleh.
14
13
  Object.const_set :Mocha, Module.new
@@ -22,6 +21,12 @@ module ActiveSupport
22
21
  alias_method :method_name, :name if method_defined? :name
23
22
  alias_method :method_name, :__name__ if method_defined? :__name__
24
23
  else
24
+ # TODO: Figure out how to get the Rails::BacktraceFilter into minitest/unit
25
+ if defined?(Rails) && ENV['BACKTRACE'].nil?
26
+ require 'rails/backtrace_cleaner'
27
+ Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit }
28
+ end
29
+
25
30
  Assertion = Test::Unit::AssertionFailedError
26
31
 
27
32
  require 'active_support/testing/default'