activesupport 3.2.22.5 → 4.0.0

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