activesupport 3.2.22.5 → 4.0.0.beta1

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 (214) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +325 -136
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +4 -2
  5. data/lib/active_support.rb +8 -21
  6. data/lib/active_support/backtrace_cleaner.rb +33 -25
  7. data/lib/active_support/basic_object.rb +7 -17
  8. data/lib/active_support/benchmarkable.rb +19 -15
  9. data/lib/active_support/buffered_logger.rb +9 -113
  10. data/lib/active_support/cache.rb +203 -171
  11. data/lib/active_support/cache/file_store.rb +12 -12
  12. data/lib/active_support/cache/mem_cache_store.rb +24 -30
  13. data/lib/active_support/cache/memory_store.rb +2 -0
  14. data/lib/active_support/callbacks.rb +195 -247
  15. data/lib/active_support/concern.rb +16 -23
  16. data/lib/active_support/concurrency/latch.rb +27 -0
  17. data/lib/active_support/configurable.rb +69 -12
  18. data/lib/active_support/core_ext.rb +1 -0
  19. data/lib/active_support/core_ext/array.rb +0 -1
  20. data/lib/active_support/core_ext/array/access.rb +17 -9
  21. data/lib/active_support/core_ext/array/conversions.rb +113 -55
  22. data/lib/active_support/core_ext/array/extract_options.rb +2 -2
  23. data/lib/active_support/core_ext/array/grouping.rb +21 -22
  24. data/lib/active_support/core_ext/array/uniq_by.rb +12 -9
  25. data/lib/active_support/core_ext/array/wrap.rb +11 -14
  26. data/lib/active_support/core_ext/big_decimal/conversions.rb +7 -24
  27. data/lib/active_support/core_ext/class/attribute.rb +12 -8
  28. data/lib/active_support/core_ext/class/attribute_accessors.rb +14 -12
  29. data/lib/active_support/core_ext/class/delegating_attributes.rb +15 -19
  30. data/lib/active_support/core_ext/class/subclasses.rb +11 -5
  31. data/lib/active_support/core_ext/date.rb +6 -0
  32. data/lib/active_support/core_ext/date/calculations.rb +34 -188
  33. data/lib/active_support/core_ext/date/conversions.rb +16 -38
  34. data/lib/active_support/core_ext/date/infinite_comparable.rb +5 -0
  35. data/lib/active_support/core_ext/date/zones.rb +25 -2
  36. data/lib/active_support/core_ext/date_and_time/calculations.rb +232 -0
  37. data/lib/active_support/core_ext/date_time.rb +5 -0
  38. data/lib/active_support/core_ext/date_time/acts_like.rb +0 -1
  39. data/lib/active_support/core_ext/date_time/calculations.rb +73 -65
  40. data/lib/active_support/core_ext/date_time/conversions.rb +21 -33
  41. data/lib/active_support/core_ext/date_time/infinite_comparable.rb +5 -0
  42. data/lib/active_support/core_ext/date_time/zones.rb +11 -8
  43. data/lib/active_support/core_ext/enumerable.rb +26 -73
  44. data/lib/active_support/core_ext/file.rb +0 -1
  45. data/lib/active_support/core_ext/file/atomic.rb +27 -11
  46. data/lib/active_support/core_ext/hash.rb +0 -1
  47. data/lib/active_support/core_ext/hash/conversions.rb +145 -79
  48. data/lib/active_support/core_ext/hash/deep_merge.rb +14 -8
  49. data/lib/active_support/core_ext/hash/diff.rb +5 -4
  50. data/lib/active_support/core_ext/hash/except.rb +1 -9
  51. data/lib/active_support/core_ext/hash/indifferent_access.rb +4 -5
  52. data/lib/active_support/core_ext/hash/keys.rb +108 -24
  53. data/lib/active_support/core_ext/hash/reverse_merge.rb +2 -3
  54. data/lib/active_support/core_ext/hash/slice.rb +12 -12
  55. data/lib/active_support/core_ext/infinite_comparable.rb +35 -0
  56. data/lib/active_support/core_ext/integer/inflections.rb +13 -1
  57. data/lib/active_support/core_ext/integer/time.rb +17 -12
  58. data/lib/active_support/core_ext/kernel/debugger.rb +2 -2
  59. data/lib/active_support/core_ext/kernel/reporting.rb +36 -22
  60. data/lib/active_support/core_ext/kernel/singleton_class.rb +0 -7
  61. data/lib/active_support/core_ext/load_error.rb +7 -5
  62. data/lib/active_support/core_ext/logger.rb +7 -23
  63. data/lib/active_support/core_ext/marshal.rb +19 -0
  64. data/lib/active_support/core_ext/module.rb +1 -3
  65. data/lib/active_support/core_ext/module/aliasing.rb +8 -9
  66. data/lib/active_support/core_ext/module/anonymous.rb +2 -7
  67. data/lib/active_support/core_ext/module/attr_internal.rb +0 -1
  68. data/lib/active_support/core_ext/module/attribute_accessors.rb +12 -10
  69. data/lib/active_support/core_ext/module/delegation.rb +57 -40
  70. data/lib/active_support/core_ext/module/deprecation.rb +19 -3
  71. data/lib/active_support/core_ext/module/introspection.rb +17 -27
  72. data/lib/active_support/core_ext/module/qualified_const.rb +8 -20
  73. data/lib/active_support/core_ext/module/remove_method.rb +1 -5
  74. data/lib/active_support/core_ext/numeric.rb +2 -0
  75. data/lib/active_support/core_ext/numeric/conversions.rb +135 -0
  76. data/lib/active_support/core_ext/numeric/infinite_comparable.rb +9 -0
  77. data/lib/active_support/core_ext/numeric/time.rb +6 -6
  78. data/lib/active_support/core_ext/object.rb +1 -0
  79. data/lib/active_support/core_ext/object/acts_like.rb +4 -4
  80. data/lib/active_support/core_ext/object/blank.rb +7 -23
  81. data/lib/active_support/core_ext/object/deep_dup.rb +46 -0
  82. data/lib/active_support/core_ext/object/duplicable.rb +1 -30
  83. data/lib/active_support/core_ext/object/inclusion.rb +6 -6
  84. data/lib/active_support/core_ext/object/instance_variables.rb +7 -12
  85. data/lib/active_support/core_ext/object/to_json.rb +8 -0
  86. data/lib/active_support/core_ext/object/to_param.rb +5 -2
  87. data/lib/active_support/core_ext/object/try.rb +46 -25
  88. data/lib/active_support/core_ext/object/with_options.rb +7 -8
  89. data/lib/active_support/core_ext/proc.rb +3 -0
  90. data/lib/active_support/core_ext/range.rb +0 -2
  91. data/lib/active_support/core_ext/range/conversions.rb +0 -2
  92. data/lib/active_support/core_ext/range/include_range.rb +1 -1
  93. data/lib/active_support/core_ext/range/overlaps.rb +1 -1
  94. data/lib/active_support/core_ext/string.rb +2 -2
  95. data/lib/active_support/core_ext/string/access.rb +95 -90
  96. data/lib/active_support/core_ext/string/conversions.rb +29 -38
  97. data/lib/active_support/core_ext/string/encoding.rb +6 -9
  98. data/lib/active_support/core_ext/string/filters.rb +24 -18
  99. data/lib/active_support/core_ext/string/indent.rb +43 -0
  100. data/lib/active_support/core_ext/string/inflections.rb +70 -60
  101. data/lib/active_support/core_ext/string/inquiry.rb +2 -2
  102. data/lib/active_support/core_ext/string/multibyte.rb +41 -64
  103. data/lib/active_support/core_ext/string/output_safety.rb +59 -51
  104. data/lib/active_support/core_ext/string/zones.rb +13 -0
  105. data/lib/active_support/core_ext/struct.rb +6 -0
  106. data/lib/active_support/core_ext/thread.rb +74 -0
  107. data/lib/active_support/core_ext/time.rb +6 -0
  108. data/lib/active_support/core_ext/time/calculations.rb +105 -193
  109. data/lib/active_support/core_ext/time/conversions.rb +27 -51
  110. data/lib/active_support/core_ext/time/infinite_comparable.rb +5 -0
  111. data/lib/active_support/core_ext/time/marshal.rb +0 -27
  112. data/lib/active_support/core_ext/time/zones.rb +27 -17
  113. data/lib/active_support/core_ext/uri.rb +13 -17
  114. data/lib/active_support/dependencies.rb +160 -141
  115. data/lib/active_support/dependencies/autoload.rb +47 -20
  116. data/lib/active_support/deprecation.rb +39 -14
  117. data/lib/active_support/deprecation/behaviors.rb +44 -30
  118. data/lib/active_support/deprecation/instance_delegator.rb +24 -0
  119. data/lib/active_support/deprecation/method_wrappers.rb +33 -18
  120. data/lib/active_support/deprecation/proxy_wrappers.rb +58 -13
  121. data/lib/active_support/deprecation/reporting.rb +40 -11
  122. data/lib/active_support/descendants_tracker.rb +34 -19
  123. data/lib/active_support/duration.rb +6 -8
  124. data/lib/active_support/file_update_checker.rb +63 -47
  125. data/lib/active_support/gzip.rb +11 -5
  126. data/lib/active_support/hash_with_indifferent_access.rb +112 -37
  127. data/lib/active_support/i18n.rb +4 -0
  128. data/lib/active_support/i18n_railtie.rb +5 -22
  129. data/lib/active_support/inflections.rb +14 -12
  130. data/lib/active_support/inflector/inflections.rb +108 -71
  131. data/lib/active_support/inflector/methods.rb +181 -160
  132. data/lib/active_support/inflector/transliterate.rb +16 -17
  133. data/lib/active_support/json/decoding.rb +18 -17
  134. data/lib/active_support/json/encoding.rb +93 -39
  135. data/lib/active_support/json/variable.rb +10 -1
  136. data/lib/active_support/key_generator.rb +75 -0
  137. data/lib/active_support/lazy_load_hooks.rb +21 -19
  138. data/lib/active_support/locale/en.yml +100 -3
  139. data/lib/active_support/log_subscriber.rb +56 -36
  140. data/lib/active_support/log_subscriber/test_helper.rb +18 -15
  141. data/lib/active_support/logger.rb +57 -0
  142. data/lib/active_support/logger_silence.rb +24 -0
  143. data/lib/active_support/message_encryptor.rb +32 -29
  144. data/lib/active_support/message_verifier.rb +8 -14
  145. data/lib/active_support/multibyte.rb +5 -28
  146. data/lib/active_support/multibyte/chars.rb +80 -333
  147. data/lib/active_support/multibyte/unicode.rb +74 -64
  148. data/lib/active_support/notifications.rb +57 -25
  149. data/lib/active_support/notifications/fanout.rb +105 -18
  150. data/lib/active_support/notifications/instrumenter.rb +32 -13
  151. data/lib/active_support/number_helper.rb +636 -0
  152. data/lib/active_support/ordered_hash.rb +8 -190
  153. data/lib/active_support/ordered_options.rb +21 -23
  154. data/lib/active_support/proxy_object.rb +13 -0
  155. data/lib/active_support/rails.rb +27 -0
  156. data/lib/active_support/railtie.rb +12 -32
  157. data/lib/active_support/rescuable.rb +9 -4
  158. data/lib/active_support/string_inquirer.rb +13 -8
  159. data/lib/active_support/tagged_logging.rb +51 -73
  160. data/lib/active_support/test_case.rb +46 -17
  161. data/lib/active_support/testing/assertions.rb +56 -26
  162. data/lib/active_support/testing/autorun.rb +5 -0
  163. data/lib/active_support/testing/constant_lookup.rb +52 -0
  164. data/lib/active_support/testing/declarative.rb +1 -1
  165. data/lib/active_support/testing/deprecation.rb +0 -19
  166. data/lib/active_support/testing/isolation.rb +25 -58
  167. data/lib/active_support/testing/pending.rb +5 -43
  168. data/lib/active_support/testing/setup_and_teardown.rb +6 -92
  169. data/lib/active_support/testing/tagged_logging.rb +25 -0
  170. data/lib/active_support/time.rb +6 -21
  171. data/lib/active_support/time_with_zone.rb +78 -43
  172. data/lib/active_support/values/time_zone.rb +77 -58
  173. data/lib/active_support/values/unicode_tables.dat +0 -0
  174. data/lib/active_support/version.rb +4 -4
  175. data/lib/active_support/xml_mini.rb +35 -17
  176. data/lib/active_support/xml_mini/jdom.rb +9 -17
  177. data/lib/active_support/xml_mini/libxml.rb +1 -2
  178. data/lib/active_support/xml_mini/libxmlsax.rb +1 -2
  179. data/lib/active_support/xml_mini/nokogiri.rb +1 -2
  180. data/lib/active_support/xml_mini/nokogirisax.rb +1 -2
  181. data/lib/active_support/xml_mini/rexml.rb +6 -8
  182. metadata +107 -77
  183. data/lib/active_support/base64.rb +0 -54
  184. data/lib/active_support/core_ext/array/random_access.rb +0 -30
  185. data/lib/active_support/core_ext/date/freeze.rb +0 -33
  186. data/lib/active_support/core_ext/exception.rb +0 -3
  187. data/lib/active_support/core_ext/file/path.rb +0 -5
  188. data/lib/active_support/core_ext/float.rb +0 -1
  189. data/lib/active_support/core_ext/float/rounding.rb +0 -19
  190. data/lib/active_support/core_ext/hash/deep_dup.rb +0 -18
  191. data/lib/active_support/core_ext/io.rb +0 -15
  192. data/lib/active_support/core_ext/module/method_names.rb +0 -14
  193. data/lib/active_support/core_ext/module/synchronization.rb +0 -45
  194. data/lib/active_support/core_ext/process.rb +0 -1
  195. data/lib/active_support/core_ext/process/daemon.rb +0 -23
  196. data/lib/active_support/core_ext/range/blockless_step.rb +0 -29
  197. data/lib/active_support/core_ext/range/cover.rb +0 -3
  198. data/lib/active_support/core_ext/rexml.rb +0 -46
  199. data/lib/active_support/core_ext/string/interpolation.rb +0 -2
  200. data/lib/active_support/core_ext/time/publicize_conversion_methods.rb +0 -10
  201. data/lib/active_support/memoizable.rb +0 -116
  202. data/lib/active_support/multibyte/exceptions.rb +0 -8
  203. data/lib/active_support/multibyte/utils.rb +0 -60
  204. data/lib/active_support/ruby/shim.rb +0 -22
  205. data/lib/active_support/security_utils.rb +0 -27
  206. data/lib/active_support/testing/mochaing.rb +0 -7
  207. data/lib/active_support/testing/performance.rb +0 -317
  208. data/lib/active_support/testing/performance/jruby.rb +0 -115
  209. data/lib/active_support/testing/performance/rubinius.rb +0 -113
  210. data/lib/active_support/testing/performance/ruby.rb +0 -152
  211. data/lib/active_support/testing/performance/ruby/mri.rb +0 -57
  212. data/lib/active_support/testing/performance/ruby/yarv.rb +0 -57
  213. data/lib/active_support/time/autoload.rb +0 -5
  214. data/lib/active_support/whiny_nil.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b15bde7001a62e9472c83fc6f8e6db88beb52ec
4
- data.tar.gz: 303f5296b0c7e8aecd64a8113f3facc515a5415a
3
+ metadata.gz: 78f08847e1d3d08c65ad482067228990e85ae1aa
4
+ data.tar.gz: 2267d7e11f8bd76ea6ce4a89ca4f41417ee2778f
5
5
  SHA512:
6
- metadata.gz: b31859710c9973c587e6eae0a1156360f7a4d4a1f34b120de08672f93c5bb87222a3d97ecaeb3fa6a3c195713a17018244d2979834fcbaecf44e6b530ca37cbf
7
- data.tar.gz: af7fbe3a0fc5916afcacabfb17e3390483641773af5f1b38e917e0d009f74761f4e3a94bc0c83f68b9022532f609c7c18c475e6b227ce18e7653643764011e15
6
+ metadata.gz: bf18285e1446e0a6b2a2a7f4986bb331a69032fa1e67d5b8dd12a6c828e46d7321f4360709b05e40c9fb0a45df1a8c68e179583906f769f5f329357b077a2177
7
+ data.tar.gz: 9364c3e0046164fd3a8789f1a679ea8a43bbaf71b108ac3617536c4b3a28013bb20c02fd9f094a0a71db8886c0b668c8c5af2ad2ebf02a4a0659d8ee9ebc5c12
@@ -1,128 +1,233 @@
1
- ## Rails 3.2.22 (Jun 16, 2015) ##
1
+ ## Rails 4.0.0.beta1 (February 25, 2013) ##
2
2
 
3
- * Fix denial of service vulnerability in the XML processing.
3
+ * Prevent `DateTime#change` from truncating the second fraction, when seconds
4
+ do not need to be changed.
4
5
 
5
- CVE-2015-3227.
6
+ *Chris Baynes*
6
7
 
7
- *Aaron Patterson*
8
+ * Added `ActiveSupport::TimeWithZone#to_r` for `Time#at` compatibility.
8
9
 
10
+ Before this change:
9
11
 
10
- ## Rails 3.2.19 (Jul 2, 2014) ##
12
+ Time.zone = 'Tokyo'
13
+ time = Time.zone.now
14
+ time == Time.at(time) # => false
11
15
 
12
- * Make sure Active Support configurations are applied correctly.
16
+ After the change:
13
17
 
14
- Before this change configuration set using `config.active_support`
15
- would not be set.
18
+ Time.zone = 'Tokyo'
19
+ time = Time.zone.now
20
+ time == Time.at(time) # => true
16
21
 
17
- *Rafael Mendonça França*
22
+ *stopdropandrew*
18
23
 
24
+ * `ActiveSupport::NumberHelper#number_to_human` returns the number unaltered when
25
+ the given units hash does not contain the needed key, e.g. when the number provided
26
+ is less than the largest key provided.
27
+ Fixes #9269.
19
28
 
20
- ## Rails 3.2.18 (May 6, 2014) ##
29
+ Examples:
21
30
 
22
- * No changes.
31
+ number_to_human(123, units: {}) # => 123
32
+ number_to_human(123, units: { thousand: 'k' }) # => 123
23
33
 
34
+ *Michael Hoffman*
24
35
 
25
- ## Rails 3.2.17 (Feb 18, 2014) ##
36
+ * Added `beginning_of_minute` support to core ext calculations for `Time` and `DateTime`.
26
37
 
27
- * No changes.
38
+ *Gagan Awhad*
28
39
 
40
+ * Add `:nsec` date format.
29
41
 
30
- ## Rails 3.2.16 (Dec 3, 2013) ##
42
+ *Jamie Gaskins*
31
43
 
32
- * No changes.
44
+ * `ActiveSupport::Gzip.compress` allows two optional arguments for compression
45
+ level and strategy.
33
46
 
47
+ *Beyond*
34
48
 
35
- ## Rails 3.2.15 (Oct 16, 2013) ##
49
+ * Modify `TimeWithZone#as_json` to include 3 decimal places of sub-second accuracy
50
+ by default, which is optional as per the ISO8601 spec, but extremely useful. Also
51
+ the default behaviour of `Date#toJSON()` in recent versions of Chrome, Safari and
52
+ Firefox.
36
53
 
37
- * Fix ActiveSupport::Cache::FileStore#cleanup to no longer rely on missing each_key method.
54
+ *James Harton*
38
55
 
39
- *Murray Steele*
56
+ * Improve `String#squish` to handle Unicode whitespace. *Antoine Lyset*
40
57
 
41
- * Add respond_to_missing? for TaggedLogging which is best practice when overriding method_missing. This permits
42
- wrapping TaggedLogging by another log abstraction such as em-logger.
58
+ * Standardise on `to_time` returning an instance of `Time` in the local system timezone
59
+ across `String`, `Time`, `Date`, `DateTime` and `ActiveSupport::TimeWithZone`.
43
60
 
44
- *Wolfram Arnold*
61
+ *Andrew White*
45
62
 
63
+ * Extract `ActiveSupport::Testing::Performance` into https://github.com/rails/rails-perftest
64
+ You can add the gem to your `Gemfile` to keep using performance tests.
46
65
 
47
- ## Rails 3.2.14 (Jul 22, 2013) ##
66
+ gem 'rails-perftest'
48
67
 
49
- * Make `Time.at_with_coercion` retain the second fraction and return local time.
68
+ *Yves Senn*
50
69
 
51
- Fixes #11350
70
+ * `Hash.from_xml` raises when it encounters `type="symbol"` or `type="yaml"`.
71
+ Use `Hash.from_trusted_xml` to parse this XML.
52
72
 
53
- *Neer Friedman*, *Andrew White*
73
+ CVE-2013-0156
54
74
 
55
- * Fix `ActiveSupport::TaggedLogging` incorrectly providing program name the same as log message
56
- even when block is not provided.
75
+ *Jeremy Kemper*
57
76
 
58
- *Carson Reinke*
77
+ * Deprecate `assert_present` and `assert_blank` in favor of
78
+ `assert object.blank?` and `assert object.present?`
59
79
 
60
- * Override `Time.at` to support the passing of Time-like values when called with a single argument.
80
+ *Yves Senn*
61
81
 
62
- *Andrew White*
82
+ * Change `String#to_date` to use `Date.parse`. This gives more consistent error
83
+ messages and allows the use of partial dates.
63
84
 
64
- * Revert the changes on unicode character encoding from `ActiveSupport::JSON.encode`.
65
- This was causing a regression where the resulting string is always returning UTF-8.
66
- Also it changes the behavior of this method on a stable release.
67
- Fixes #9498.
85
+ "gibberish".to_date => Argument Error: invalid date
86
+ "3rd Feb".to_date => Sun, 03 Feb 2013
68
87
 
69
- *Rafael Mendonça França*
88
+ *Kelly Stannard*
70
89
 
71
- * Fix `ActiveSupport::TimeZone.parse` when time is at a local DST jump.
72
- Fixes #9678.
90
+ * It's now possible to compare `Date`, `DateTime`, `Time` and `TimeWithZone`
91
+ with `Float::INFINITY`. This allows to create date/time ranges with one infinite bound.
92
+ Example:
73
93
 
74
- *Andrew White*
94
+ range = Range.new(Date.today, Float::INFINITY)
95
+
96
+ Also it's possible to check inclusion of date/time in range with conversion.
97
+
98
+ range.include?(Time.now + 1.year) # => true
99
+ range.include?(DateTime.now + 1.year) # => true
100
+
101
+ *Alexander Grebennik*
75
102
 
103
+ * Remove meaningless `ActiveSupport::FrozenObjectError`, which was just an alias of `RuntimeError`.
76
104
 
77
- ## Rails 3.2.13 (Mar 18, 2013) ##
105
+ *Akira Matsuda*
78
106
 
79
- * Fix DateTime comparison with DateTime::Infinity object.
107
+ * Introduce `assert_not` to replace warty `assert !foo`. *Jeremy Kemper*
80
108
 
81
- *Dan Kubb*
109
+ * Prevent `Callbacks#set_callback` from setting the same callback twice.
82
110
 
83
- * Remove surrogate unicode character encoding from ActiveSupport::JSON.encode
84
- The encoding scheme was broken for unicode characters outside the basic
85
- multilingual plane; since json is assumed to be UTF-8, and we already force the
86
- encoding to UTF-8 simply pass through the un-encoded characters.
111
+ before_save :foo, :bar, :foo
112
+
113
+ will at first call `bar`, then `foo`. `foo` will no more be called
114
+ twice.
115
+
116
+ *Dmitriy Kiriyenko*
117
+
118
+ * Add `ActiveSupport::Logger#silence` that works the same as the old `Logger#silence` extension.
119
+
120
+ *DHH*
121
+
122
+ * Remove surrogate unicode character encoding from `ActiveSupport::JSON.encode`
123
+ The encoding scheme was broken for unicode characters outside the basic multilingual plane;
124
+ since json is assumed to be UTF-8, and we already force the encoding to UTF-8,
125
+ simply pass through the un-encoded characters.
87
126
 
88
127
  *Brett Carter*
89
128
 
90
- * Fix mocha v0.13.0 compatibility. *James Mead*
129
+ * Deprecate `Time.time_with_date_fallback`, `Time.utc_time` and `Time.local_time`.
130
+ These methods were added to handle the limited range of Ruby's native `Time`
131
+ implementation. Those limitations no longer apply so we are deprecating them in 4.0
132
+ and they will be removed in 4.1.
133
+
134
+ *Andrew White*
135
+
136
+ * Deprecate `Date#to_time_in_current_zone` and add `Date#in_time_zone`. *Andrew White*
137
+
138
+ * Add `String#in_time_zone` method to convert a string to an `ActiveSupport::TimeWithZone`. *Andrew White*
139
+
140
+ * Deprecate `ActiveSupport::BasicObject` in favor of `ActiveSupport::ProxyObject`.
141
+ This class is used for proxy classes. It avoids confusion with Ruby's `BasicObject`
142
+ class.
91
143
 
92
- * `#as_json` isolates options when encoding a hash. [Backport #8185]
93
- Fix #8182
144
+ *Francesco Rodriguez*
145
+
146
+ * Patched `Marshal#load` to work with constant autoloading. Fixes autoloading
147
+ with cache stores that rely on `Marshal` (`MemCacheStore` and `FileStore`).
148
+ Fixes #8167.
149
+
150
+ *Uriel Katz*
151
+
152
+ * Make `Time.zone.parse` to work with JavaScript format date strings. *Andrew White*
153
+
154
+ * Add `DateTime#seconds_until_end_of_day` and `Time#seconds_until_end_of_day`
155
+ as a complement for `seconds_from_midnight`; useful when setting expiration
156
+ times for caches, e.g.:
157
+
158
+ <% cache('dashboard', expires_in: Date.current.seconds_until_end_of_day) do %>
159
+ ...
160
+
161
+ *Olek Janiszewski*
162
+
163
+ * No longer proxy `ActiveSupport::Multibyte#class`. *Steve Klabnik*
164
+
165
+ * Deprecate `ActiveSupport::TestCase#pending` method, use `skip` from minitest instead. *Carlos Antonio da Silva*
166
+
167
+ * `XmlMini.with_backend` now may be safely used with threads:
168
+
169
+ Thread.new do
170
+ XmlMini.with_backend("REXML") { rexml_power }
171
+ end
172
+ Thread.new do
173
+ XmlMini.with_backend("LibXML") { libxml_power }
174
+ end
175
+
176
+ Each thread will use it's own backend.
177
+
178
+ *Nikita Afanasenko*
179
+
180
+ * Dependencies no longer trigger `Kernel#autoload` in `remove_constant`. Fixes #8213. *Xavier Noria*
181
+
182
+ * Simplify `mocha` integration and remove monkey-patches, bumping `mocha` to 0.13.0. *James Mead*
183
+
184
+ * `#as_json` isolates options when encoding a hash. Fixes #8182.
94
185
 
95
186
  *Yves Senn*
96
187
 
97
- * Handle the possible Permission Denied errors atomic.rb might trigger due to
98
- its chown and chmod calls. [Backport #8027]
188
+ * Deprecate `Hash#diff` in favor of minitest's #diff. *Steve Klabnik*
99
189
 
100
- *Daniele Sluijters*
190
+ * `Kernel#capture` can catch output from subprocesses. *Dmitry Vorotilin*
101
191
 
192
+ * `to_xml` conversions now use builder's `tag!` method instead of explicit invocation of `method_missing`.
102
193
 
103
- ## Rails 3.2.12 (Feb 11, 2013) ##
194
+ *Nikita Afanasenko*
104
195
 
105
- * No changes.
196
+ * Fixed timezone mapping of the Solomon Islands. *Steve Klabnik*
106
197
 
198
+ * Make callstack attribute optional in `ActiveSupport::Deprecation::Reporting`
199
+ methods `warn` and `deprecation_warning`.
107
200
 
108
- ## Rails 3.2.11 (Jan 8, 2012) ##
201
+ *Alexey Gaziev*
109
202
 
110
- * Hash.from_xml raises when it encounters type="symbol" or type="yaml".
111
- Use Hash.from_trusted_xml to parse this XML.
203
+ * Implement `HashWithIndifferentAccess#replace` so `key?` works correctly. *David Graham*
112
204
 
113
- CVE-2013-0156
205
+ * Handle the possible permission denied errors `atomic.rb` might trigger due to its `chown`
206
+ and `chmod` calls.
114
207
 
115
- *Jeremy Kemper*
208
+ *Daniele Sluijters*
116
209
 
210
+ * `Hash#extract!` returns only those keys that present in the receiver.
117
211
 
118
- ## Rails 3.2.10 (Jan 2, 2013) ##
212
+ {a: 1, b: 2}.extract!(:a, :x) # => {:a => 1}
119
213
 
120
- * No changes.
214
+ *Mikhail Dieterle*
121
215
 
216
+ * `Hash#extract!` returns the same subclass, that the receiver is. I.e.
217
+ `HashWithIndifferentAccess#extract!` returns a `HashWithIndifferentAccess` instance.
122
218
 
123
- ## Rails 3.2.9 (Nov 12, 2012) ##
219
+ *Mikhail Dieterle*
124
220
 
125
- * Add logger.push_tags and .pop_tags to complement logger.tagged:
221
+ * Optimize `ActiveSupport::Cache::Entry` to reduce memory and processing overhead. *Brian Durand*
222
+
223
+ * Tests tag the Rails log with the current test class and test case:
224
+
225
+ [SessionsControllerTest] [test_0002_sign in] Processing by SessionsController#create as HTML
226
+ [SessionsControllerTest] [test_0002_sign in] ...
227
+
228
+ *Jeremy Kemper*
229
+
230
+ * Add `logger.push_tags` and `.pop_tags` to complement `logger.tagged`:
126
231
 
127
232
  class Job
128
233
  def before
@@ -136,139 +241,223 @@
136
241
 
137
242
  *Jeremy Kemper*
138
243
 
139
- * Add %:z and %::z format string support to ActiveSupport::TimeWithZone#strftime. [fixes #6962] *kennyj*
244
+ * Allow delegation to the class using the `:class` keyword, replacing
245
+ `self.class` usage:
246
+
247
+ class User
248
+ def self.hello
249
+ "world"
250
+ end
251
+
252
+ delegate :hello, to: :class
253
+ end
254
+
255
+ *Marc-Andre Lafortune*
256
+
257
+ * `Date.beginning_of_week` thread local and `beginning_of_week` application
258
+ config option added (default is Monday).
259
+
260
+ *Innokenty Mikhailov*
261
+
262
+ * An optional block can be passed to `config_accessor` to set its default value
263
+
264
+ class User
265
+ include ActiveSupport::Configurable
266
+
267
+ config_accessor :hair_colors do
268
+ [:brown, :black, :blonde, :red]
269
+ end
270
+ end
271
+
272
+ User.hair_colors # => [:brown, :black, :blonde, :red]
273
+
274
+ *Larry Lv*
275
+
276
+ * `ActiveSupport::Benchmarkable#silence` has been deprecated due to its lack of
277
+ thread safety. It will be removed without replacement in Rails 4.1.
278
+
279
+ *Steve Klabnik*
140
280
 
281
+ * An optional block can be passed to `Hash#deep_merge`. The block will be invoked
282
+ for each duplicated key and used to resolve the conflict.
141
283
 
142
- ## Rails 3.2.8 (Aug 9, 2012) ##
284
+ *Pranas Kiziela*
143
285
 
144
- * Fix ActiveSupport integration with Mocha > 0.12.1. *Mike Gunderloy*
286
+ * `ActiveSupport::Deprecation` is now a class. It is possible to create an instance
287
+ of deprecator. Backwards compatibility has been preserved.
145
288
 
146
- * Reverted the deprecation of ActiveSupport::JSON::Variable. *Rafael Mendonça França*
289
+ You can choose which instance of the deprecator will be used.
147
290
 
148
- * ERB::Util.html_escape now escapes single quotes. *Santiago Pastorino*
291
+ deprecate :method_name, deprecator: deprecator_instance
149
292
 
293
+ You can use `ActiveSupport::Deprecation` in your gem.
150
294
 
151
- ## Rails 3.2.7 (Jul 26, 2012) ##
295
+ require 'active_support/deprecation'
296
+ require 'active_support/core_ext/module/deprecation'
152
297
 
153
- * Hash#fetch(fetch) is not the same as doing hash[key]
298
+ class MyGem
299
+ def self.deprecator
300
+ ActiveSupport::Deprecation.new('2.0', 'MyGem')
301
+ end
154
302
 
155
- * adds a missing require [fixes #6896]
303
+ def old_method
304
+ end
156
305
 
157
- * make sure the inflection rules are loaded when cherry-picking active_support/core_ext/string/inflections.rb [fixes #6884]
306
+ def new_method
307
+ end
158
308
 
159
- * Merge pull request #6857 from rsutphin/as_core_ext_time_missing_require
309
+ deprecate old_method: :new_method, deprecator: deprecator
310
+ end
160
311
 
161
- * bump AS deprecation_horizon to 4.0
312
+ MyGem.new.old_method
313
+ # => DEPRECATION WARNING: old_method is deprecated and will be removed from MyGem 2.0 (use new_method instead). (called from <main> at file.rb:18)
162
314
 
315
+ *Piotr Niełacny & Robert Pankowecki*
163
316
 
164
- ## Rails 3.2.6 (Jun 12, 2012) ##
317
+ * `ERB::Util.html_escape` encodes single quote as `#39`. Decimal form has better support in old browsers. *Kalys Osmonov*
165
318
 
166
- * No changes.
319
+ * `ActiveSupport::Callbacks`: deprecate monkey patch of object callbacks.
320
+ Using the `filter` method like this:
167
321
 
322
+ before_filter MyFilter.new
168
323
 
169
- ## Rails 3.2.5 (Jun 1, 2012) ##
324
+ class MyFilter
325
+ def filter(controller)
326
+ end
327
+ end
170
328
 
171
- * ActiveSupport::JSON::Variable is deprecated. Define your own #as_json and #encode_json methods
172
- for custom JSON string literals. *Erich Menge*
329
+ Is now deprecated with recommendation to use the corresponding filter type
330
+ (`#before`, `#after` or `#around`):
173
331
 
332
+ before_filter MyFilter.new
174
333
 
175
- ## Rails 3.2.4 (May 31, 2012) ##
334
+ class MyFilter
335
+ def before(controller)
336
+ end
337
+ end
338
+
339
+ *Bogdan Gusiev*
176
340
 
177
- * Added #beginning_of_hour and #end_of_hour to Time and DateTime core
178
- extensions. *Mark J. Titorenko*
341
+ * An optional block can be passed to `HashWithIndifferentAccess#update` and `#merge`.
342
+ The block will be invoked for each duplicated key, and used to resolve the conflict,
343
+ thus replicating the behaviour of the corresponding methods on the `Hash` class.
179
344
 
345
+ *Leo Cassarani*
180
346
 
181
- ## Rails 3.2.3 (March 30, 2012) ##
347
+ * Remove `j` alias for `ERB::Util#json_escape`.
348
+ The `j` alias is already used for `ActionView::Helpers::JavaScriptHelper#escape_javascript`
349
+ and both modules are included in the view context that would confuse the developers.
182
350
 
183
- * No changes.
351
+ *Akira Matsuda*
184
352
 
353
+ * Replace deprecated `memcache-client` gem with `dalli` in `ActiveSupport::Cache::MemCacheStore`.
185
354
 
186
- ## Rails 3.2.2 (March 1, 2012) ##
355
+ *Guillermo Iguaran*
187
356
 
188
- * No changes.
357
+ * Add default values to all `ActiveSupport::NumberHelper` methods, to avoid
358
+ errors with empty locales or missing values.
189
359
 
360
+ *Carlos Antonio da Silva*
190
361
 
191
- ## Rails 3.2.1 (January 26, 2012) ##
362
+ * `ActiveSupport::JSON::Variable` is deprecated. Define your own `#as_json` and
363
+ `#encode_json` methods for custom JSON string literals.
192
364
 
193
- * Documentation fixes and improvements.
365
+ *Erich Menge*
194
366
 
195
- * Update time zone offset information. *Ravil Bayramgalin*
367
+ * Add `String#indent`. *fxn & Ace Suares*
196
368
 
197
- * The deprecated `ActiveSupport::Base64.decode64` calls `::Base64.decode64`
198
- now. *Jonathan Viney*
369
+ * Inflections can now be defined per locale. `singularize` and `pluralize`
370
+ accept locale as an extra argument.
199
371
 
200
- * Fixes uninitialized constant `ActiveSupport::TaggedLogging::ERROR`. *kennyj*
372
+ *David Celis*
201
373
 
374
+ * `Object#try` will now return `nil` instead of raise a `NoMethodError` if the
375
+ receiving object does not implement the method, but you can still get the
376
+ old behavior by using the new `Object#try!`.
202
377
 
203
- ## Rails 3.2.0 (January 20, 2012) ##
378
+ *DHH*
204
379
 
205
- * ActiveSupport::Base64 is deprecated in favor of ::Base64. *Sergey Nartimov*
380
+ * `ERB::Util.html_escape` now escapes single quotes. *Santiago Pastorino*
206
381
 
207
- * Module#synchronize is deprecated with no replacement. Please use `monitor`
208
- from ruby's standard library.
382
+ * `Time#change` now works with time values with offsets other than UTC or the local time zone. *Andrew White*
209
383
 
210
- * (Date|DateTime|Time)#beginning_of_week accept an optional argument to
211
- be able to set the day at which weeks are assumed to start.
384
+ * `ActiveSupport::Callbacks`: deprecate usage of filter object with `#before` and `#after` methods as `around` callback. *Bogdan Gusiev*
212
385
 
213
- * Deprecated ActiveSupport::MessageEncryptor#encrypt and decrypt. *José Valim*
386
+ * Add `Time#prev_quarter` and `Time#next_quarter` short-hands for `months_ago(3)` and `months_since(3)`. *SungHee Kang*
214
387
 
215
- * ActiveSupport::Notifications.subscribed provides subscriptions to events while a block runs. *fxn*
388
+ * Remove obsolete and unused `require_association` method from dependencies. *fxn*
216
389
 
217
- * Module#qualified_const_(defined?|get|set) are analogous to the corresponding methods
218
- in the standard API, but accept qualified constant names. *fxn*
390
+ * Add `:instance_accessor` option for `config_accessor`.
391
+
392
+ class User
393
+ include ActiveSupport::Configurable
394
+ config_accessor :allowed_access, instance_accessor: false
395
+ end
219
396
 
220
- * Added inflection #deconstantize which complements #demodulize. This inflection
221
- removes the righmost segment in a qualified constant name. *fxn*
397
+ User.new.allowed_access = true # => NoMethodError
398
+ User.new.allowed_access # => NoMethodError
222
399
 
223
- * Added ActiveSupport:TaggedLogging that can wrap any standard Logger class to provide tagging capabilities *DHH*
400
+ *Francesco Rodriguez*
224
401
 
225
- Logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
226
- Logger.tagged("BCX") { Logger.info "Stuff" } # Logs "[BCX] Stuff"
227
- Logger.tagged("BCX", "Jason") { Logger.info "Stuff" } # Logs "[BCX] [Jason] Stuff"
228
- Logger.tagged("BCX") { Logger.tagged("Jason") { Logger.info "Stuff" } } # Logs "[BCX] [Jason] Stuff"
402
+ * `ActionView::Helpers::NumberHelper` methods have been moved to `ActiveSupport::NumberHelper` and are now available via
403
+ `Numeric#to_s`. `Numeric#to_s` now accepts the formatting options `:phone`, `:currency`, `:percentage`, `:delimited`,
404
+ `:rounded`, `:human`, and `:human_size`.
229
405
 
230
- * Added safe_constantize that constantizes a string but returns nil instead of an exception if the constant (or part of it) does not exist *Ryan Oblak*
406
+ *Andrew Mutz*
231
407
 
232
- * ActiveSupport::OrderedHash is now marked as extractable when using Array#extract_options! *Prem Sichanugrist*
408
+ * Add `Hash#transform_keys`, `Hash#transform_keys!`, `Hash#deep_transform_keys`, and `Hash#deep_transform_keys!`. *Mark McSpadden*
233
409
 
234
- * Added Array#prepend as an alias for Array#unshift and Array#append as an alias for Array#<< *DHH*
410
+ * Changed XML type `datetime` to `dateTime` (with upper case letter `T`). *Angelo Capilleri*
235
411
 
236
- * The definition of blank string for Ruby 1.9 has been extended to Unicode whitespace.
237
- Also, in 1.8 the ideographic space U+3000 is considered to be whitespace. *Akira Matsuda, Damien Mathieu*
412
+ * Add `:instance_accessor` option for `class_attribute`. *Alexey Vakhov*
238
413
 
239
- * The inflector understands acronyms. *dlee*
414
+ * `constantize` now looks in the ancestor chain. *Marc-Andre Lafortune & Andrew White*
240
415
 
241
- * Deprecated ActiveSupport::Memoizable in favor of Ruby memoization pattern *José Valim*
416
+ * Adds `Hash#deep_stringify_keys` and `Hash#deep_stringify_keys!` to convert all keys from a `Hash` instance into strings. *Lucas Húngaro*
242
417
 
243
- * Added Time#all_day/week/quarter/year as a way of generating ranges (example: Event.where(created_at: Time.now.all_week)) *DHH*
418
+ * Adds `Hash#deep_symbolize_keys` and `Hash#deep_symbolize_keys!` to convert all keys from a `Hash` instance into symbols. *Lucas Húngaro*
244
419
 
245
- * Added instance_accessor: false as an option to Class#cattr_accessor and friends *DHH*
420
+ * `Object#try` can't call private methods. *Vasiliy Ermolovich*
246
421
 
247
- * Removed ActiveSupport::SecureRandom in favor of SecureRandom from the standard library *Jon Leighton*
422
+ * `AS::Callbacks#run_callbacks` remove `key` argument. *Francesco Rodriguez*
248
423
 
249
- * ActiveSupport::OrderedHash now has different behavior for #each and
250
- \#each_pair when given a block accepting its parameters with a splat. *Andrew Radev*
424
+ * `deep_dup` works more expectedly now and duplicates also values in `Hash` instances and elements in `Array` instances. *Alexey Gaziev*
251
425
 
252
- * ActiveSupport::BufferedLogger#silence is deprecated. If you want to squelch
253
- logs for a certain block, change the log level for that block.
426
+ * Inflector no longer applies ice -> ouse to words like "slice", "police", etc. *Wes Morgan*
254
427
 
255
- * ActiveSupport::BufferedLogger#open_log is deprecated. This method should
256
- not have been public in the first place.
428
+ * Add `ActiveSupport::Deprecations.behavior = :silence` to completely ignore Rails runtime deprecations. *twinturbo*
257
429
 
258
- * ActiveSupport::BufferedLogger's behavior of automatically creating the
259
- directory for your log file is deprecated. Please make sure to create the
260
- directory for your log file before instantiating.
430
+ * Make `Module#delegate` stop using `send` - can no longer delegate to private methods. *dasch*
261
431
 
262
- * ActiveSupport::BufferedLogger#auto_flushing is deprecated. Either set the
263
- sync level on the underlying file handle like this:
432
+ * `ActiveSupport::Callbacks`: deprecate `:rescuable` option. *Bogdan Gusiev*
433
+
434
+ * Adds `Integer#ordinal` to get the ordinal suffix string of an integer. *Tim Gildea*
435
+
436
+ * `ActiveSupport::Callbacks`: `:per_key` option is no longer supported. *Bogdan Gusiev*
437
+
438
+ * `ActiveSupport::Callbacks#define_callbacks`: add `:skip_after_callbacks_if_terminated` option. *Bogdan Gusiev*
439
+
440
+ * Add `html_escape_once` to `ERB::Util`, and delegate the `escape_once` tag helper to it. *Carlos Antonio da Silva*
441
+
442
+ * Deprecates the compatibility method `Module#local_constant_names`,
443
+ use `Module#local_constants` instead (which returns symbols). *Xavier Noria*
444
+
445
+ * Deletes the compatibility method `Module#method_names`,
446
+ use `Module#methods` from now on (which returns symbols). *Xavier Noria*
447
+
448
+ * Deletes the compatibility method `Module#instance_method_names`,
449
+ use `Module#instance_methods` from now on (which returns symbols). *Xavier Noria*
450
+
451
+ * `BufferedLogger` is deprecated. Use `ActiveSupport::Logger`, or the logger
452
+ from the Ruby standard library.
453
+
454
+ *Aaron Patterson*
264
455
 
265
- f = File.open('foo.log', 'w')
266
- f.sync = true
267
- ActiveSupport::BufferedLogger.new f
456
+ * Unicode database updated to 6.1.0. *Norman Clarke*
268
457
 
269
- Or tune your filesystem. The FS cache is now what controls flushing.
458
+ * Adds `encode_big_decimal_as_string` option to force JSON serialization of `BigDecimal` as numeric instead
459
+ of wrapping them in strings for safety.
270
460
 
271
- * ActiveSupport::BufferedLogger#flush is deprecated. Set sync on your
272
- filehandle, or tune your filesystem.
461
+ * Optimize log subscribers to check log level before doing any processing. *Brian Durand*
273
462
 
274
- Please check [3-1-stable](https://github.com/rails/rails/blob/3-1-stable/activesupport/CHANGELOG.md) for previous changes.
463
+ Please check [3-2-stable](https://github.com/rails/rails/blob/3-2-stable/activesupport/CHANGELOG.md) for previous changes.