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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +364 -135
- data/MIT-LICENSE +1 -1
- data/README.rdoc +6 -4
- data/lib/active_support/backtrace_cleaner.rb +33 -25
- data/lib/active_support/basic_object.rb +7 -17
- data/lib/active_support/benchmarkable.rb +19 -15
- data/lib/active_support/buffered_logger.rb +9 -113
- data/lib/active_support/cache/file_store.rb +14 -14
- data/lib/active_support/cache/mem_cache_store.rb +24 -30
- data/lib/active_support/cache/memory_store.rb +2 -0
- data/lib/active_support/cache/strategy/local_cache.rb +48 -37
- data/lib/active_support/cache.rb +228 -183
- data/lib/active_support/callbacks.rb +201 -253
- data/lib/active_support/concern.rb +16 -23
- data/lib/active_support/concurrency/latch.rb +27 -0
- data/lib/active_support/configurable.rb +69 -12
- data/lib/active_support/core_ext/array/access.rb +17 -9
- data/lib/active_support/core_ext/array/conversions.rb +115 -55
- data/lib/active_support/core_ext/array/extract_options.rb +2 -2
- data/lib/active_support/core_ext/array/grouping.rb +21 -22
- data/lib/active_support/core_ext/array/uniq_by.rb +12 -9
- data/lib/active_support/core_ext/array/wrap.rb +13 -16
- data/lib/active_support/core_ext/array.rb +0 -1
- data/lib/active_support/core_ext/benchmark.rb +7 -0
- data/lib/active_support/core_ext/big_decimal/conversions.rb +8 -24
- data/lib/active_support/core_ext/class/attribute.rb +40 -32
- data/lib/active_support/core_ext/class/attribute_accessors.rb +14 -12
- data/lib/active_support/core_ext/class/delegating_attributes.rb +15 -19
- data/lib/active_support/core_ext/class/subclasses.rb +11 -5
- data/lib/active_support/core_ext/date/calculations.rb +44 -187
- data/lib/active_support/core_ext/date/conversions.rb +16 -38
- data/lib/active_support/core_ext/date/zones.rb +25 -2
- data/lib/active_support/core_ext/date.rb +5 -0
- data/lib/active_support/core_ext/date_and_time/calculations.rb +232 -0
- data/lib/active_support/core_ext/date_time/acts_like.rb +0 -1
- data/lib/active_support/core_ext/date_time/calculations.rb +77 -62
- data/lib/active_support/core_ext/date_time/conversions.rb +21 -33
- data/lib/active_support/core_ext/date_time/zones.rb +11 -8
- data/lib/active_support/core_ext/date_time.rb +4 -0
- data/lib/active_support/core_ext/enumerable.rb +26 -73
- data/lib/active_support/core_ext/file/atomic.rb +27 -11
- data/lib/active_support/core_ext/file.rb +0 -1
- data/lib/active_support/core_ext/hash/conversions.rb +145 -79
- data/lib/active_support/core_ext/hash/deep_merge.rb +14 -8
- data/lib/active_support/core_ext/hash/diff.rb +5 -4
- data/lib/active_support/core_ext/hash/except.rb +1 -9
- data/lib/active_support/core_ext/hash/indifferent_access.rb +4 -5
- data/lib/active_support/core_ext/hash/keys.rb +108 -24
- data/lib/active_support/core_ext/hash/reverse_merge.rb +2 -3
- data/lib/active_support/core_ext/hash/slice.rb +12 -12
- data/lib/active_support/core_ext/hash.rb +0 -1
- data/lib/active_support/core_ext/integer/inflections.rb +13 -1
- data/lib/active_support/core_ext/integer/time.rb +17 -12
- data/lib/active_support/core_ext/kernel/debugger.rb +2 -2
- data/lib/active_support/core_ext/kernel/reporting.rb +36 -22
- data/lib/active_support/core_ext/kernel/singleton_class.rb +0 -7
- data/lib/active_support/core_ext/load_error.rb +7 -5
- data/lib/active_support/core_ext/logger.rb +7 -23
- data/lib/active_support/core_ext/marshal.rb +21 -0
- data/lib/active_support/core_ext/module/aliasing.rb +8 -9
- data/lib/active_support/core_ext/module/anonymous.rb +2 -7
- data/lib/active_support/core_ext/module/attr_internal.rb +0 -1
- data/lib/active_support/core_ext/module/attribute_accessors.rb +12 -10
- data/lib/active_support/core_ext/module/delegation.rb +92 -49
- data/lib/active_support/core_ext/module/deprecation.rb +19 -3
- data/lib/active_support/core_ext/module/introspection.rb +17 -27
- data/lib/active_support/core_ext/module/qualified_const.rb +8 -20
- data/lib/active_support/core_ext/module/remove_method.rb +1 -5
- data/lib/active_support/core_ext/module.rb +1 -3
- data/lib/active_support/core_ext/numeric/conversions.rb +135 -0
- data/lib/active_support/core_ext/numeric/time.rb +6 -6
- data/lib/active_support/core_ext/numeric.rb +1 -0
- data/lib/active_support/core_ext/object/acts_like.rb +4 -4
- data/lib/active_support/core_ext/object/blank.rb +7 -23
- data/lib/active_support/core_ext/object/deep_dup.rb +46 -0
- data/lib/active_support/core_ext/object/duplicable.rb +1 -30
- data/lib/active_support/core_ext/object/inclusion.rb +8 -7
- data/lib/active_support/core_ext/object/instance_variables.rb +7 -12
- data/lib/active_support/core_ext/object/to_json.rb +8 -0
- data/lib/active_support/core_ext/object/to_param.rb +5 -2
- data/lib/active_support/core_ext/object/try.rb +46 -25
- data/lib/active_support/core_ext/object/with_options.rb +7 -8
- data/lib/active_support/core_ext/object.rb +1 -0
- data/lib/active_support/core_ext/proc.rb +3 -0
- data/lib/active_support/core_ext/range/conversions.rb +0 -2
- data/lib/active_support/core_ext/range/include_range.rb +3 -1
- data/lib/active_support/core_ext/range/overlaps.rb +1 -1
- data/lib/active_support/core_ext/range.rb +0 -2
- data/lib/active_support/core_ext/string/access.rb +95 -90
- data/lib/active_support/core_ext/string/conversions.rb +27 -38
- data/lib/active_support/core_ext/string/encoding.rb +6 -9
- data/lib/active_support/core_ext/string/filters.rb +24 -18
- data/lib/active_support/core_ext/string/indent.rb +43 -0
- data/lib/active_support/core_ext/string/inflections.rb +70 -60
- data/lib/active_support/core_ext/string/inquiry.rb +2 -2
- data/lib/active_support/core_ext/string/multibyte.rb +41 -64
- data/lib/active_support/core_ext/string/output_safety.rb +59 -51
- data/lib/active_support/core_ext/string/zones.rb +13 -0
- data/lib/active_support/core_ext/string.rb +2 -3
- data/lib/active_support/core_ext/struct.rb +6 -0
- data/lib/active_support/core_ext/thread.rb +74 -0
- data/lib/active_support/core_ext/time/calculations.rb +108 -184
- data/lib/active_support/core_ext/time/conversions.rb +27 -51
- data/lib/active_support/core_ext/time/marshal.rb +0 -27
- data/lib/active_support/core_ext/time/zones.rb +27 -17
- data/lib/active_support/core_ext/time.rb +5 -0
- data/lib/active_support/core_ext/uri.rb +13 -17
- data/lib/active_support/core_ext.rb +3 -2
- data/lib/active_support/dependencies/autoload.rb +47 -20
- data/lib/active_support/dependencies.rb +160 -141
- data/lib/active_support/deprecation/behaviors.rb +44 -30
- data/lib/active_support/deprecation/instance_delegator.rb +24 -0
- data/lib/active_support/deprecation/method_wrappers.rb +33 -18
- data/lib/active_support/deprecation/proxy_wrappers.rb +58 -13
- data/lib/active_support/deprecation/reporting.rb +40 -11
- data/lib/active_support/deprecation.rb +39 -14
- data/lib/active_support/descendants_tracker.rb +34 -19
- data/lib/active_support/duration.rb +6 -8
- data/lib/active_support/file_update_checker.rb +63 -47
- data/lib/active_support/gzip.rb +11 -5
- data/lib/active_support/hash_with_indifferent_access.rb +127 -42
- data/lib/active_support/i18n.rb +4 -0
- data/lib/active_support/i18n_railtie.rb +5 -22
- data/lib/active_support/inflections.rb +14 -12
- data/lib/active_support/inflector/inflections.rb +108 -71
- data/lib/active_support/inflector/methods.rb +181 -160
- data/lib/active_support/inflector/transliterate.rb +16 -17
- data/lib/active_support/json/decoding.rb +18 -17
- data/lib/active_support/json/encoding.rb +93 -39
- data/lib/active_support/json/variable.rb +10 -1
- data/lib/active_support/key_generator.rb +75 -0
- data/lib/active_support/lazy_load_hooks.rb +21 -19
- data/lib/active_support/locale/en.yml +100 -3
- data/lib/active_support/log_subscriber/test_helper.rb +18 -15
- data/lib/active_support/log_subscriber.rb +35 -52
- data/lib/active_support/logger.rb +57 -0
- data/lib/active_support/logger_silence.rb +24 -0
- data/lib/active_support/message_encryptor.rb +38 -35
- data/lib/active_support/message_verifier.rb +9 -15
- data/lib/active_support/multibyte/chars.rb +80 -333
- data/lib/active_support/multibyte/unicode.rb +74 -64
- data/lib/active_support/multibyte.rb +5 -28
- data/lib/active_support/notifications/fanout.rb +112 -18
- data/lib/active_support/notifications/instrumenter.rb +33 -14
- data/lib/active_support/notifications.rb +79 -26
- data/lib/active_support/number_helper.rb +637 -0
- data/lib/active_support/ordered_hash.rb +8 -190
- data/lib/active_support/ordered_options.rb +21 -23
- data/lib/active_support/per_thread_registry.rb +52 -0
- data/lib/active_support/proxy_object.rb +13 -0
- data/lib/active_support/rails.rb +27 -0
- data/lib/active_support/railtie.rb +12 -32
- data/lib/active_support/rescuable.rb +9 -4
- data/lib/active_support/string_inquirer.rb +13 -8
- data/lib/active_support/subscriber.rb +93 -0
- data/lib/active_support/tagged_logging.rb +51 -73
- data/lib/active_support/test_case.rb +46 -17
- data/lib/active_support/testing/assertions.rb +56 -26
- data/lib/active_support/testing/autorun.rb +5 -0
- data/lib/active_support/testing/constant_lookup.rb +54 -0
- data/lib/active_support/testing/declarative.rb +1 -1
- data/lib/active_support/testing/deprecation.rb +0 -19
- data/lib/active_support/testing/isolation.rb +29 -58
- data/lib/active_support/testing/pending.rb +5 -43
- data/lib/active_support/testing/setup_and_teardown.rb +6 -92
- data/lib/active_support/testing/tagged_logging.rb +25 -0
- data/lib/active_support/time.rb +6 -21
- data/lib/active_support/time_with_zone.rb +80 -43
- data/lib/active_support/values/time_zone.rb +81 -60
- data/lib/active_support/values/unicode_tables.dat +0 -0
- data/lib/active_support/version.rb +7 -6
- data/lib/active_support/xml_mini/jdom.rb +9 -11
- data/lib/active_support/xml_mini/libxml.rb +1 -2
- data/lib/active_support/xml_mini/libxmlsax.rb +2 -3
- data/lib/active_support/xml_mini/nokogiri.rb +1 -2
- data/lib/active_support/xml_mini/nokogirisax.rb +2 -3
- data/lib/active_support/xml_mini/rexml.rb +6 -8
- data/lib/active_support/xml_mini.rb +35 -17
- data/lib/active_support.rb +8 -21
- metadata +104 -72
- data/lib/active_support/base64.rb +0 -54
- data/lib/active_support/core_ext/array/random_access.rb +0 -30
- data/lib/active_support/core_ext/date/freeze.rb +0 -33
- data/lib/active_support/core_ext/exception.rb +0 -3
- data/lib/active_support/core_ext/file/path.rb +0 -5
- data/lib/active_support/core_ext/float/rounding.rb +0 -19
- data/lib/active_support/core_ext/float.rb +0 -1
- data/lib/active_support/core_ext/hash/deep_dup.rb +0 -18
- data/lib/active_support/core_ext/io.rb +0 -15
- data/lib/active_support/core_ext/module/method_names.rb +0 -14
- data/lib/active_support/core_ext/module/synchronization.rb +0 -45
- data/lib/active_support/core_ext/process/daemon.rb +0 -23
- data/lib/active_support/core_ext/process.rb +0 -1
- data/lib/active_support/core_ext/range/blockless_step.rb +0 -29
- data/lib/active_support/core_ext/range/cover.rb +0 -3
- data/lib/active_support/core_ext/rexml.rb +0 -46
- data/lib/active_support/core_ext/string/interpolation.rb +0 -2
- data/lib/active_support/core_ext/string/xchar.rb +0 -18
- data/lib/active_support/core_ext/time/publicize_conversion_methods.rb +0 -10
- data/lib/active_support/memoizable.rb +0 -116
- data/lib/active_support/multibyte/exceptions.rb +0 -8
- data/lib/active_support/multibyte/utils.rb +0 -60
- data/lib/active_support/ruby/shim.rb +0 -22
- data/lib/active_support/security_utils.rb +0 -27
- data/lib/active_support/testing/mochaing.rb +0 -7
- data/lib/active_support/testing/performance/jruby.rb +0 -115
- data/lib/active_support/testing/performance/rubinius.rb +0 -113
- data/lib/active_support/testing/performance/ruby/mri.rb +0 -57
- data/lib/active_support/testing/performance/ruby/yarv.rb +0 -57
- data/lib/active_support/testing/performance/ruby.rb +0 -152
- data/lib/active_support/testing/performance.rb +0 -317
- data/lib/active_support/time/autoload.rb +0 -5
- data/lib/active_support/whiny_nil.rb +0 -24
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f245ce1f4a2b4ef8b365844871de9379d23117b0
|
|
4
|
+
data.tar.gz: f107b6936aa6763ba2274bd98fd92e573fc49e84
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 39ba79acc5ca41a56c59b54359fdbaa8123301d2812b39285f8b99614d94998d43a0436d5fba6e4002bf172019e2eeb38eb2baa73e803cb987294eb599891b2e
|
|
7
|
+
data.tar.gz: 73dd55afe205d557d98a6d07488ac5cb393a2c6892205416a9dbff867cdc0923b193f334be3d126c39d933cea8a90f4e7a693b90037ea5538d552e3dd4f04965
|
data/CHANGELOG.md
CHANGED
|
@@ -1,128 +1,273 @@
|
|
|
1
|
-
## Rails
|
|
1
|
+
## Rails 4.0.0 (June 25, 2013) ##
|
|
2
2
|
|
|
3
|
-
*
|
|
3
|
+
* Override `Time.at` to support the passing of Time-like values when called with a single argument.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
*Andrew White*
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
* Allow Date to be compared with Time (like it was possible to compare Time with Date).
|
|
8
8
|
|
|
9
|
+
*DHH*
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
* Deprecate multiple parameters support of `Object#in?`.
|
|
11
12
|
|
|
12
|
-
*
|
|
13
|
+
*Brian Morearty + Carlos Antonio da Silva*
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
25
|
+
*Agis Anastasopoulos*
|
|
21
26
|
|
|
22
|
-
*
|
|
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
|
-
|
|
32
|
+
*stopdropandrew*
|
|
26
33
|
|
|
27
|
-
*
|
|
34
|
+
* `ActiveSupport::TimeWithZone` raises `NoMethodError` in proper context.
|
|
35
|
+
Fixes #9772.
|
|
28
36
|
|
|
37
|
+
*Yves Senn*
|
|
29
38
|
|
|
30
|
-
|
|
39
|
+
* Fix deletion of empty directories in `ActiveSupport::Cache::FileStore`.
|
|
31
40
|
|
|
32
|
-
*
|
|
41
|
+
*Charles Jones*
|
|
33
42
|
|
|
43
|
+
* Improve singularizing a singular for multiple cases.
|
|
44
|
+
Fixes #2608 #1825 #2395.
|
|
34
45
|
|
|
35
|
-
|
|
46
|
+
Example:
|
|
36
47
|
|
|
37
|
-
|
|
48
|
+
# Before
|
|
49
|
+
'address'.singularize # => 'addres'
|
|
38
50
|
|
|
39
|
-
|
|
51
|
+
# After
|
|
52
|
+
'address'.singularize # => 'address'
|
|
40
53
|
|
|
41
|
-
*
|
|
42
|
-
wrapping TaggedLogging by another log abstraction such as em-logger.
|
|
54
|
+
*Mark McSpadden*
|
|
43
55
|
|
|
44
|
-
|
|
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
|
-
|
|
61
|
+
* Added `ActiveSupport::TimeWithZone#to_r` for `Time#at` compatibility.
|
|
48
62
|
|
|
49
|
-
|
|
63
|
+
Before this change:
|
|
50
64
|
|
|
51
|
-
|
|
65
|
+
Time.zone = 'Tokyo'
|
|
66
|
+
time = Time.zone.now
|
|
67
|
+
time == Time.at(time) # => false
|
|
52
68
|
|
|
53
|
-
|
|
69
|
+
After the change:
|
|
54
70
|
|
|
55
|
-
|
|
56
|
-
|
|
71
|
+
Time.zone = 'Tokyo'
|
|
72
|
+
time = Time.zone.now
|
|
73
|
+
time == Time.at(time) # => true
|
|
57
74
|
|
|
58
|
-
*
|
|
75
|
+
*stopdropandrew*
|
|
59
76
|
|
|
60
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
72
|
-
|
|
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
|
-
|
|
151
|
+
before_save :foo, :bar, :foo
|
|
78
152
|
|
|
79
|
-
|
|
153
|
+
will at first call `bar`, then `foo`. `foo` will no more be called
|
|
154
|
+
twice.
|
|
80
155
|
|
|
81
|
-
*
|
|
156
|
+
*Dmitriy Kiriyenko*
|
|
82
157
|
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
93
|
-
|
|
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
|
-
*
|
|
98
|
-
its chown and chmod calls. [Backport #8027]
|
|
228
|
+
* Deprecate `Hash#diff` in favor of minitest's #diff. *Steve Klabnik*
|
|
99
229
|
|
|
100
|
-
|
|
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
|
-
|
|
234
|
+
*Nikita Afanasenko*
|
|
104
235
|
|
|
105
|
-
*
|
|
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
|
-
|
|
241
|
+
*Alexey Gaziev*
|
|
109
242
|
|
|
110
|
-
*
|
|
111
|
-
Use Hash.from_trusted_xml to parse this XML.
|
|
243
|
+
* Implement `HashWithIndifferentAccess#replace` so `key?` works correctly. *David Graham*
|
|
112
244
|
|
|
113
|
-
|
|
245
|
+
* Handle the possible permission denied errors `atomic.rb` might trigger due to its `chown`
|
|
246
|
+
and `chmod` calls.
|
|
114
247
|
|
|
115
|
-
*
|
|
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
|
-
|
|
261
|
+
* Optimize `ActiveSupport::Cache::Entry` to reduce memory and processing overhead. *Brian Durand*
|
|
119
262
|
|
|
120
|
-
*
|
|
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
|
-
|
|
268
|
+
*Jeremy Kemper*
|
|
124
269
|
|
|
125
|
-
* Add logger.push_tags and
|
|
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
|
-
*
|
|
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
|
-
|
|
292
|
+
delegate :hello, to: :class
|
|
293
|
+
end
|
|
143
294
|
|
|
144
|
-
*
|
|
295
|
+
*Marc-Andre Lafortune*
|
|
145
296
|
|
|
146
|
-
*
|
|
297
|
+
* `Date.beginning_of_week` thread local and `beginning_of_week` application
|
|
298
|
+
config option added (default is Monday).
|
|
147
299
|
|
|
148
|
-
*
|
|
300
|
+
*Innokenty Mikhailov*
|
|
149
301
|
|
|
302
|
+
* An optional block can be passed to `config_accessor` to set its default value
|
|
150
303
|
|
|
151
|
-
|
|
304
|
+
class User
|
|
305
|
+
include ActiveSupport::Configurable
|
|
152
306
|
|
|
153
|
-
|
|
307
|
+
config_accessor :hair_colors do
|
|
308
|
+
[:brown, :black, :blonde, :red]
|
|
309
|
+
end
|
|
310
|
+
end
|
|
154
311
|
|
|
155
|
-
|
|
312
|
+
User.hair_colors # => [:brown, :black, :blonde, :red]
|
|
156
313
|
|
|
157
|
-
*
|
|
314
|
+
*Larry Lv*
|
|
158
315
|
|
|
159
|
-
*
|
|
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
|
-
*
|
|
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
|
-
|
|
324
|
+
*Pranas Kiziela*
|
|
165
325
|
|
|
166
|
-
*
|
|
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
|
-
|
|
331
|
+
deprecate :method_name, deprecator: deprecator_instance
|
|
170
332
|
|
|
171
|
-
|
|
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
|
-
|
|
338
|
+
class MyGem
|
|
339
|
+
def self.deprecator
|
|
340
|
+
ActiveSupport::Deprecation.new('2.0', 'MyGem')
|
|
341
|
+
end
|
|
176
342
|
|
|
177
|
-
|
|
178
|
-
|
|
343
|
+
def old_method
|
|
344
|
+
end
|
|
179
345
|
|
|
346
|
+
def new_method
|
|
347
|
+
end
|
|
180
348
|
|
|
181
|
-
|
|
349
|
+
deprecate old_method: :new_method, deprecator: deprecator
|
|
350
|
+
end
|
|
182
351
|
|
|
183
|
-
|
|
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
|
-
|
|
357
|
+
* `ERB::Util.html_escape` encodes single quote as `#39`. Decimal form has better support in old browsers. *Kalys Osmonov*
|
|
187
358
|
|
|
188
|
-
*
|
|
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
|
-
|
|
364
|
+
class MyFilter
|
|
365
|
+
def filter(controller)
|
|
366
|
+
end
|
|
367
|
+
end
|
|
192
368
|
|
|
193
|
-
|
|
369
|
+
Is now deprecated with recommendation to use the corresponding filter type
|
|
370
|
+
(`#before`, `#after` or `#around`):
|
|
194
371
|
|
|
195
|
-
|
|
372
|
+
before_filter MyFilter.new
|
|
196
373
|
|
|
197
|
-
|
|
198
|
-
|
|
374
|
+
class MyFilter
|
|
375
|
+
def before(controller)
|
|
376
|
+
end
|
|
377
|
+
end
|
|
199
378
|
|
|
200
|
-
*
|
|
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
|
-
|
|
385
|
+
*Leo Cassarani*
|
|
204
386
|
|
|
205
|
-
*
|
|
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
|
-
*
|
|
208
|
-
from ruby's standard library.
|
|
391
|
+
*Akira Matsuda*
|
|
209
392
|
|
|
210
|
-
*
|
|
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
|
-
*
|
|
395
|
+
*Guillermo Iguaran*
|
|
214
396
|
|
|
215
|
-
*
|
|
397
|
+
* Add default values to all `ActiveSupport::NumberHelper` methods, to avoid
|
|
398
|
+
errors with empty locales or missing values.
|
|
216
399
|
|
|
217
|
-
*
|
|
218
|
-
in the standard API, but accept qualified constant names. *fxn*
|
|
400
|
+
*Carlos Antonio da Silva*
|
|
219
401
|
|
|
220
|
-
*
|
|
221
|
-
|
|
402
|
+
* `ActiveSupport::JSON::Variable` is deprecated. Define your own `#as_json` and
|
|
403
|
+
`#encode_json` methods for custom JSON string literals.
|
|
222
404
|
|
|
223
|
-
*
|
|
405
|
+
*Erich Menge*
|
|
224
406
|
|
|
225
|
-
|
|
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
|
-
*
|
|
409
|
+
* Inflections can now be defined per locale. `singularize` and `pluralize`
|
|
410
|
+
accept locale as an extra argument.
|
|
231
411
|
|
|
232
|
-
*
|
|
412
|
+
*David Celis*
|
|
233
413
|
|
|
234
|
-
*
|
|
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
|
-
*
|
|
237
|
-
Also, in 1.8 the ideographic space U+3000 is considered to be whitespace. *Akira Matsuda, Damien Mathieu*
|
|
418
|
+
*DHH*
|
|
238
419
|
|
|
239
|
-
*
|
|
420
|
+
* `ERB::Util.html_escape` now escapes single quotes. *Santiago Pastorino*
|
|
240
421
|
|
|
241
|
-
*
|
|
422
|
+
* `Time#change` now works with time values with offsets other than UTC or the local time zone. *Andrew White*
|
|
242
423
|
|
|
243
|
-
*
|
|
424
|
+
* `ActiveSupport::Callbacks`: deprecate usage of filter object with `#before` and `#after` methods as `around` callback. *Bogdan Gusiev*
|
|
244
425
|
|
|
245
|
-
*
|
|
426
|
+
* Add `Time#prev_quarter` and `Time#next_quarter` short-hands for `months_ago(3)` and `months_since(3)`. *SungHee Kang*
|
|
246
427
|
|
|
247
|
-
*
|
|
428
|
+
* Remove obsolete and unused `require_association` method from dependencies. *fxn*
|
|
248
429
|
|
|
249
|
-
*
|
|
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
|
-
|
|
253
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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::
|
|
263
|
-
|
|
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
|
-
|
|
266
|
-
f.sync = true
|
|
267
|
-
ActiveSupport::BufferedLogger.new f
|
|
496
|
+
* Unicode database updated to 6.1.0. *Norman Clarke*
|
|
268
497
|
|
|
269
|
-
|
|
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
|
-
*
|
|
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-
|
|
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