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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +325 -136
- data/MIT-LICENSE +1 -1
- data/README.rdoc +4 -2
- data/lib/active_support.rb +8 -21
- 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.rb +203 -171
- data/lib/active_support/cache/file_store.rb +12 -12
- 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/callbacks.rb +195 -247
- 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.rb +1 -0
- data/lib/active_support/core_ext/array.rb +0 -1
- data/lib/active_support/core_ext/array/access.rb +17 -9
- data/lib/active_support/core_ext/array/conversions.rb +113 -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 +11 -14
- data/lib/active_support/core_ext/big_decimal/conversions.rb +7 -24
- data/lib/active_support/core_ext/class/attribute.rb +12 -8
- 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.rb +6 -0
- data/lib/active_support/core_ext/date/calculations.rb +34 -188
- data/lib/active_support/core_ext/date/conversions.rb +16 -38
- data/lib/active_support/core_ext/date/infinite_comparable.rb +5 -0
- data/lib/active_support/core_ext/date/zones.rb +25 -2
- data/lib/active_support/core_ext/date_and_time/calculations.rb +232 -0
- data/lib/active_support/core_ext/date_time.rb +5 -0
- data/lib/active_support/core_ext/date_time/acts_like.rb +0 -1
- data/lib/active_support/core_ext/date_time/calculations.rb +73 -65
- data/lib/active_support/core_ext/date_time/conversions.rb +21 -33
- data/lib/active_support/core_ext/date_time/infinite_comparable.rb +5 -0
- data/lib/active_support/core_ext/date_time/zones.rb +11 -8
- data/lib/active_support/core_ext/enumerable.rb +26 -73
- data/lib/active_support/core_ext/file.rb +0 -1
- data/lib/active_support/core_ext/file/atomic.rb +27 -11
- data/lib/active_support/core_ext/hash.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/infinite_comparable.rb +35 -0
- 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 +19 -0
- data/lib/active_support/core_ext/module.rb +1 -3
- 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 +57 -40
- 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/numeric.rb +2 -0
- data/lib/active_support/core_ext/numeric/conversions.rb +135 -0
- data/lib/active_support/core_ext/numeric/infinite_comparable.rb +9 -0
- data/lib/active_support/core_ext/numeric/time.rb +6 -6
- data/lib/active_support/core_ext/object.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 +6 -6
- 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/proc.rb +3 -0
- data/lib/active_support/core_ext/range.rb +0 -2
- data/lib/active_support/core_ext/range/conversions.rb +0 -2
- data/lib/active_support/core_ext/range/include_range.rb +1 -1
- data/lib/active_support/core_ext/range/overlaps.rb +1 -1
- data/lib/active_support/core_ext/string.rb +2 -2
- data/lib/active_support/core_ext/string/access.rb +95 -90
- data/lib/active_support/core_ext/string/conversions.rb +29 -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/struct.rb +6 -0
- data/lib/active_support/core_ext/thread.rb +74 -0
- data/lib/active_support/core_ext/time.rb +6 -0
- data/lib/active_support/core_ext/time/calculations.rb +105 -193
- data/lib/active_support/core_ext/time/conversions.rb +27 -51
- data/lib/active_support/core_ext/time/infinite_comparable.rb +5 -0
- 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/uri.rb +13 -17
- data/lib/active_support/dependencies.rb +160 -141
- data/lib/active_support/dependencies/autoload.rb +47 -20
- data/lib/active_support/deprecation.rb +39 -14
- 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/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 +112 -37
- 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.rb +56 -36
- data/lib/active_support/log_subscriber/test_helper.rb +18 -15
- data/lib/active_support/logger.rb +57 -0
- data/lib/active_support/logger_silence.rb +24 -0
- data/lib/active_support/message_encryptor.rb +32 -29
- data/lib/active_support/message_verifier.rb +8 -14
- data/lib/active_support/multibyte.rb +5 -28
- data/lib/active_support/multibyte/chars.rb +80 -333
- data/lib/active_support/multibyte/unicode.rb +74 -64
- data/lib/active_support/notifications.rb +57 -25
- data/lib/active_support/notifications/fanout.rb +105 -18
- data/lib/active_support/notifications/instrumenter.rb +32 -13
- data/lib/active_support/number_helper.rb +636 -0
- data/lib/active_support/ordered_hash.rb +8 -190
- data/lib/active_support/ordered_options.rb +21 -23
- 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/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 +52 -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 +25 -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 +78 -43
- data/lib/active_support/values/time_zone.rb +77 -58
- data/lib/active_support/values/unicode_tables.dat +0 -0
- data/lib/active_support/version.rb +4 -4
- data/lib/active_support/xml_mini.rb +35 -17
- data/lib/active_support/xml_mini/jdom.rb +9 -17
- data/lib/active_support/xml_mini/libxml.rb +1 -2
- data/lib/active_support/xml_mini/libxmlsax.rb +1 -2
- data/lib/active_support/xml_mini/nokogiri.rb +1 -2
- data/lib/active_support/xml_mini/nokogirisax.rb +1 -2
- data/lib/active_support/xml_mini/rexml.rb +6 -8
- metadata +107 -77
- 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.rb +0 -1
- data/lib/active_support/core_ext/float/rounding.rb +0 -19
- 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.rb +0 -1
- data/lib/active_support/core_ext/process/daemon.rb +0 -23
- 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/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.rb +0 -317
- 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.rb +0 -152
- 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/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: 78f08847e1d3d08c65ad482067228990e85ae1aa
|
4
|
+
data.tar.gz: 2267d7e11f8bd76ea6ce4a89ca4f41417ee2778f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf18285e1446e0a6b2a2a7f4986bb331a69032fa1e67d5b8dd12a6c828e46d7321f4360709b05e40c9fb0a45df1a8c68e179583906f769f5f329357b077a2177
|
7
|
+
data.tar.gz: 9364c3e0046164fd3a8789f1a679ea8a43bbaf71b108ac3617536c4b3a28013bb20c02fd9f094a0a71db8886c0b668c8c5af2ad2ebf02a4a0659d8ee9ebc5c12
|
data/CHANGELOG.md
CHANGED
@@ -1,128 +1,233 @@
|
|
1
|
-
## Rails
|
1
|
+
## Rails 4.0.0.beta1 (February 25, 2013) ##
|
2
2
|
|
3
|
-
*
|
3
|
+
* Prevent `DateTime#change` from truncating the second fraction, when seconds
|
4
|
+
do not need to be changed.
|
4
5
|
|
5
|
-
|
6
|
+
*Chris Baynes*
|
6
7
|
|
7
|
-
|
8
|
+
* Added `ActiveSupport::TimeWithZone#to_r` for `Time#at` compatibility.
|
8
9
|
|
10
|
+
Before this change:
|
9
11
|
|
10
|
-
|
12
|
+
Time.zone = 'Tokyo'
|
13
|
+
time = Time.zone.now
|
14
|
+
time == Time.at(time) # => false
|
11
15
|
|
12
|
-
|
16
|
+
After the change:
|
13
17
|
|
14
|
-
|
15
|
-
|
18
|
+
Time.zone = 'Tokyo'
|
19
|
+
time = Time.zone.now
|
20
|
+
time == Time.at(time) # => true
|
16
21
|
|
17
|
-
*
|
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
|
-
|
29
|
+
Examples:
|
21
30
|
|
22
|
-
|
31
|
+
number_to_human(123, units: {}) # => 123
|
32
|
+
number_to_human(123, units: { thousand: 'k' }) # => 123
|
23
33
|
|
34
|
+
*Michael Hoffman*
|
24
35
|
|
25
|
-
|
36
|
+
* Added `beginning_of_minute` support to core ext calculations for `Time` and `DateTime`.
|
26
37
|
|
27
|
-
*
|
38
|
+
*Gagan Awhad*
|
28
39
|
|
40
|
+
* Add `:nsec` date format.
|
29
41
|
|
30
|
-
|
42
|
+
*Jamie Gaskins*
|
31
43
|
|
32
|
-
*
|
44
|
+
* `ActiveSupport::Gzip.compress` allows two optional arguments for compression
|
45
|
+
level and strategy.
|
33
46
|
|
47
|
+
*Beyond*
|
34
48
|
|
35
|
-
|
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
|
-
*
|
54
|
+
*James Harton*
|
38
55
|
|
39
|
-
|
56
|
+
* Improve `String#squish` to handle Unicode whitespace. *Antoine Lyset*
|
40
57
|
|
41
|
-
*
|
42
|
-
|
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
|
-
*
|
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
|
-
|
66
|
+
gem 'rails-perftest'
|
48
67
|
|
49
|
-
*
|
68
|
+
*Yves Senn*
|
50
69
|
|
51
|
-
|
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
|
-
|
73
|
+
CVE-2013-0156
|
54
74
|
|
55
|
-
*
|
56
|
-
even when block is not provided.
|
75
|
+
*Jeremy Kemper*
|
57
76
|
|
58
|
-
|
77
|
+
* Deprecate `assert_present` and `assert_blank` in favor of
|
78
|
+
`assert object.blank?` and `assert object.present?`
|
59
79
|
|
60
|
-
*
|
80
|
+
*Yves Senn*
|
61
81
|
|
62
|
-
|
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
|
-
|
65
|
-
|
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
|
-
*
|
88
|
+
*Kelly Stannard*
|
70
89
|
|
71
|
-
*
|
72
|
-
|
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
|
-
|
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
|
-
|
105
|
+
*Akira Matsuda*
|
78
106
|
|
79
|
-
*
|
107
|
+
* Introduce `assert_not` to replace warty `assert !foo`. *Jeremy Kemper*
|
80
108
|
|
81
|
-
|
109
|
+
* Prevent `Callbacks#set_callback` from setting the same callback twice.
|
82
110
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
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
|
-
*
|
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
|
-
*
|
93
|
-
|
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
|
-
*
|
98
|
-
its chown and chmod calls. [Backport #8027]
|
188
|
+
* Deprecate `Hash#diff` in favor of minitest's #diff. *Steve Klabnik*
|
99
189
|
|
100
|
-
|
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
|
-
|
194
|
+
*Nikita Afanasenko*
|
104
195
|
|
105
|
-
*
|
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
|
-
|
201
|
+
*Alexey Gaziev*
|
109
202
|
|
110
|
-
*
|
111
|
-
Use Hash.from_trusted_xml to parse this XML.
|
203
|
+
* Implement `HashWithIndifferentAccess#replace` so `key?` works correctly. *David Graham*
|
112
204
|
|
113
|
-
|
205
|
+
* Handle the possible permission denied errors `atomic.rb` might trigger due to its `chown`
|
206
|
+
and `chmod` calls.
|
114
207
|
|
115
|
-
*
|
208
|
+
*Daniele Sluijters*
|
116
209
|
|
210
|
+
* `Hash#extract!` returns only those keys that present in the receiver.
|
117
211
|
|
118
|
-
|
212
|
+
{a: 1, b: 2}.extract!(:a, :x) # => {:a => 1}
|
119
213
|
|
120
|
-
*
|
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
|
-
|
219
|
+
*Mikhail Dieterle*
|
124
220
|
|
125
|
-
*
|
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
|
-
*
|
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
|
-
|
284
|
+
*Pranas Kiziela*
|
143
285
|
|
144
|
-
*
|
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
|
-
|
289
|
+
You can choose which instance of the deprecator will be used.
|
147
290
|
|
148
|
-
|
291
|
+
deprecate :method_name, deprecator: deprecator_instance
|
149
292
|
|
293
|
+
You can use `ActiveSupport::Deprecation` in your gem.
|
150
294
|
|
151
|
-
|
295
|
+
require 'active_support/deprecation'
|
296
|
+
require 'active_support/core_ext/module/deprecation'
|
152
297
|
|
153
|
-
|
298
|
+
class MyGem
|
299
|
+
def self.deprecator
|
300
|
+
ActiveSupport::Deprecation.new('2.0', 'MyGem')
|
301
|
+
end
|
154
302
|
|
155
|
-
|
303
|
+
def old_method
|
304
|
+
end
|
156
305
|
|
157
|
-
|
306
|
+
def new_method
|
307
|
+
end
|
158
308
|
|
159
|
-
|
309
|
+
deprecate old_method: :new_method, deprecator: deprecator
|
310
|
+
end
|
160
311
|
|
161
|
-
|
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
|
-
|
317
|
+
* `ERB::Util.html_escape` encodes single quote as `#39`. Decimal form has better support in old browsers. *Kalys Osmonov*
|
165
318
|
|
166
|
-
*
|
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
|
-
|
324
|
+
class MyFilter
|
325
|
+
def filter(controller)
|
326
|
+
end
|
327
|
+
end
|
170
328
|
|
171
|
-
|
172
|
-
|
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
|
-
|
334
|
+
class MyFilter
|
335
|
+
def before(controller)
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
339
|
+
*Bogdan Gusiev*
|
176
340
|
|
177
|
-
*
|
178
|
-
|
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
|
-
|
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
|
-
*
|
351
|
+
*Akira Matsuda*
|
184
352
|
|
353
|
+
* Replace deprecated `memcache-client` gem with `dalli` in `ActiveSupport::Cache::MemCacheStore`.
|
185
354
|
|
186
|
-
|
355
|
+
*Guillermo Iguaran*
|
187
356
|
|
188
|
-
*
|
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
|
-
|
362
|
+
* `ActiveSupport::JSON::Variable` is deprecated. Define your own `#as_json` and
|
363
|
+
`#encode_json` methods for custom JSON string literals.
|
192
364
|
|
193
|
-
*
|
365
|
+
*Erich Menge*
|
194
366
|
|
195
|
-
*
|
367
|
+
* Add `String#indent`. *fxn & Ace Suares*
|
196
368
|
|
197
|
-
*
|
198
|
-
|
369
|
+
* Inflections can now be defined per locale. `singularize` and `pluralize`
|
370
|
+
accept locale as an extra argument.
|
199
371
|
|
200
|
-
*
|
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
|
-
|
378
|
+
*DHH*
|
204
379
|
|
205
|
-
*
|
380
|
+
* `ERB::Util.html_escape` now escapes single quotes. *Santiago Pastorino*
|
206
381
|
|
207
|
-
*
|
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
|
-
*
|
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
|
-
*
|
386
|
+
* Add `Time#prev_quarter` and `Time#next_quarter` short-hands for `months_ago(3)` and `months_since(3)`. *SungHee Kang*
|
214
387
|
|
215
|
-
*
|
388
|
+
* Remove obsolete and unused `require_association` method from dependencies. *fxn*
|
216
389
|
|
217
|
-
*
|
218
|
-
|
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
|
-
|
221
|
-
|
397
|
+
User.new.allowed_access = true # => NoMethodError
|
398
|
+
User.new.allowed_access # => NoMethodError
|
222
399
|
|
223
|
-
*
|
400
|
+
*Francesco Rodriguez*
|
224
401
|
|
225
|
-
|
226
|
-
|
227
|
-
|
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
|
-
*
|
406
|
+
*Andrew Mutz*
|
231
407
|
|
232
|
-
*
|
408
|
+
* Add `Hash#transform_keys`, `Hash#transform_keys!`, `Hash#deep_transform_keys`, and `Hash#deep_transform_keys!`. *Mark McSpadden*
|
233
409
|
|
234
|
-
*
|
410
|
+
* Changed XML type `datetime` to `dateTime` (with upper case letter `T`). *Angelo Capilleri*
|
235
411
|
|
236
|
-
*
|
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
|
-
*
|
414
|
+
* `constantize` now looks in the ancestor chain. *Marc-Andre Lafortune & Andrew White*
|
240
415
|
|
241
|
-
*
|
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
|
-
*
|
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
|
-
*
|
420
|
+
* `Object#try` can't call private methods. *Vasiliy Ermolovich*
|
246
421
|
|
247
|
-
*
|
422
|
+
* `AS::Callbacks#run_callbacks` remove `key` argument. *Francesco Rodriguez*
|
248
423
|
|
249
|
-
*
|
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
|
-
*
|
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::
|
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
|
-
*
|
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::
|
263
|
-
|
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
|
-
|
266
|
-
f.sync = true
|
267
|
-
ActiveSupport::BufferedLogger.new f
|
456
|
+
* Unicode database updated to 6.1.0. *Norman Clarke*
|
268
457
|
|
269
|
-
|
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
|
-
*
|
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-
|
463
|
+
Please check [3-2-stable](https://github.com/rails/rails/blob/3-2-stable/activesupport/CHANGELOG.md) for previous changes.
|