activesupport 6.1.2 → 6.1.4
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 +51 -0
- data/lib/active_support/cache.rb +7 -1
- data/lib/active_support/cache/file_store.rb +1 -1
- data/lib/active_support/cache/mem_cache_store.rb +1 -1
- data/lib/active_support/configuration_file.rb +6 -1
- data/lib/active_support/core_ext/time/calculations.rb +3 -8
- data/lib/active_support/current_attributes.rb +1 -0
- data/lib/active_support/fork_tracker.rb +2 -0
- data/lib/active_support/gem_version.rb +1 -1
- data/lib/active_support/hash_with_indifferent_access.rb +6 -1
- data/lib/active_support/locale/en.yml +1 -1
- data/lib/active_support/notifications.rb +1 -1
- data/lib/active_support/number_helper/number_to_rounded_converter.rb +10 -6
- data/lib/active_support/number_helper/rounding_helper.rb +1 -1
- data/lib/active_support/parameter_filter.rb +1 -1
- data/lib/active_support/security_utils.rb +1 -1
- data/lib/active_support/time_with_zone.rb +1 -1
- data/lib/active_support/values/time_zone.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da0f0bd22c59fddaba8fe79a42f798bddb4d656d8a4f8995a306a6b5f50f4af9
|
4
|
+
data.tar.gz: 5da2fbc27b148858fa687cb18014f4d3207c2c67d46baaaba37fd84a5e6af7cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3340ccef27050ca727f293fcf4ff0f32f5e5157959c7ee098aab016089a959c54eb83be8d944c46e2131b9f4ea19957dd9169b7bf7ec41eab8952f73602a4aea
|
7
|
+
data.tar.gz: 78546d89d1f742d9faf4714aa18ba45796eef8a84149e137aa4357e1ec6dffd5e5b0c3c20c1c67d50d0898cd27fce00d715fdf172e3ca20fcbdeffeab30c5a0d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,54 @@
|
|
1
|
+
## Rails 6.1.4 (June 24, 2021) ##
|
2
|
+
|
3
|
+
* MemCacheStore: convert any underlying value (including `false`) to an `Entry`.
|
4
|
+
|
5
|
+
See [#42559](https://github.com/rails/rails/pull/42559).
|
6
|
+
|
7
|
+
*Alex Ghiculescu*
|
8
|
+
|
9
|
+
* Fix bug in `number_with_precision` when using large `BigDecimal` values.
|
10
|
+
|
11
|
+
Fixes #42302.
|
12
|
+
|
13
|
+
*Federico Aldunate*, *Zachary Scott*
|
14
|
+
|
15
|
+
* Check byte size instead of length on `secure_compare`.
|
16
|
+
|
17
|
+
*Tietew*
|
18
|
+
|
19
|
+
* Fix `Time.at` to not lose `:in` option.
|
20
|
+
|
21
|
+
*Ryuta Kamizono*
|
22
|
+
|
23
|
+
* Require a path for `config.cache_store = :file_store`.
|
24
|
+
|
25
|
+
*Alex Ghiculescu*
|
26
|
+
|
27
|
+
* Avoid having to store complex object in the default translation file.
|
28
|
+
|
29
|
+
*Rafael Mendonça França*
|
30
|
+
|
31
|
+
|
32
|
+
## Rails 6.1.3.2 (May 05, 2021) ##
|
33
|
+
|
34
|
+
* No changes.
|
35
|
+
|
36
|
+
|
37
|
+
## Rails 6.1.3.1 (March 26, 2021) ##
|
38
|
+
|
39
|
+
* No changes.
|
40
|
+
|
41
|
+
|
42
|
+
## Rails 6.1.3 (February 17, 2021) ##
|
43
|
+
|
44
|
+
* No changes.
|
45
|
+
|
46
|
+
|
47
|
+
## Rails 6.1.2.1 (February 10, 2021) ##
|
48
|
+
|
49
|
+
* No changes.
|
50
|
+
|
51
|
+
|
1
52
|
## Rails 6.1.2 (February 09, 2021) ##
|
2
53
|
|
3
54
|
* `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
|
data/lib/active_support/cache.rb
CHANGED
@@ -58,7 +58,13 @@ module ActiveSupport
|
|
58
58
|
case store
|
59
59
|
when Symbol
|
60
60
|
options = parameters.extract_options!
|
61
|
-
|
61
|
+
# clean this up once Ruby 2.7 support is dropped
|
62
|
+
# see https://github.com/rails/rails/pull/41522#discussion_r581186602
|
63
|
+
if options.empty?
|
64
|
+
retrieve_store_class(store).new(*parameters)
|
65
|
+
else
|
66
|
+
retrieve_store_class(store).new(*parameters, **options)
|
67
|
+
end
|
62
68
|
when Array
|
63
69
|
lookup_store(*store)
|
64
70
|
when nil
|
@@ -20,7 +20,7 @@ module ActiveSupport
|
|
20
20
|
FILEPATH_MAX_SIZE = 900 # max is 1024, plus some room
|
21
21
|
GITKEEP_FILES = [".gitkeep", ".keep"].freeze
|
22
22
|
|
23
|
-
def initialize(cache_path, options
|
23
|
+
def initialize(cache_path, **options)
|
24
24
|
super(options)
|
25
25
|
@cache_path = cache_path.to_s
|
26
26
|
end
|
@@ -198,7 +198,7 @@ module ActiveSupport
|
|
198
198
|
|
199
199
|
def deserialize_entry(payload)
|
200
200
|
entry = super
|
201
|
-
entry = Entry.new(entry, compress: false)
|
201
|
+
entry = Entry.new(entry, compress: false) unless entry.nil? || entry.is_a?(Entry)
|
202
202
|
entry
|
203
203
|
end
|
204
204
|
|
@@ -19,7 +19,12 @@ module ActiveSupport
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def parse(context: nil, **options)
|
22
|
-
|
22
|
+
source = render(context)
|
23
|
+
if YAML.respond_to?(:unsafe_load)
|
24
|
+
YAML.unsafe_load(source, **options) || {}
|
25
|
+
else
|
26
|
+
YAML.load(source, **options) || {}
|
27
|
+
end
|
23
28
|
rescue Psych::SyntaxError => error
|
24
29
|
raise "YAML syntax error occurred while parsing #{@content_path}. " \
|
25
30
|
"Please note that YAML must be consistently indented using spaces. Tabs are not allowed. " \
|
@@ -42,14 +42,8 @@ class Time
|
|
42
42
|
|
43
43
|
# Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime
|
44
44
|
# instances can be used when called with a single argument
|
45
|
-
def at_with_coercion(*args
|
46
|
-
if args.size != 1
|
47
|
-
if kwargs.empty?
|
48
|
-
return at_without_coercion(*args)
|
49
|
-
else
|
50
|
-
return at_without_coercion(*args, **kwargs)
|
51
|
-
end
|
52
|
-
end
|
45
|
+
def at_with_coercion(*args)
|
46
|
+
return at_without_coercion(*args) if args.size != 1
|
53
47
|
|
54
48
|
# Time.at can be called with a time or numerical value
|
55
49
|
time_or_number = args.first
|
@@ -62,6 +56,7 @@ class Time
|
|
62
56
|
at_without_coercion(time_or_number)
|
63
57
|
end
|
64
58
|
end
|
59
|
+
ruby2_keywords(:at_with_coercion) if respond_to?(:ruby2_keywords, true)
|
65
60
|
alias_method :at_without_coercion, :at
|
66
61
|
alias_method :at, :at_with_coercion
|
67
62
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require "active_support/callbacks"
|
4
4
|
require "active_support/core_ext/enumerable"
|
5
|
+
require "active_support/core_ext/module/delegation"
|
5
6
|
|
6
7
|
module ActiveSupport
|
7
8
|
# Abstract super class that provides a thread-isolated attributes singleton, which resets automatically
|
@@ -16,6 +16,7 @@ module ActiveSupport
|
|
16
16
|
pid
|
17
17
|
end
|
18
18
|
end
|
19
|
+
ruby2_keywords(:fork) if respond_to?(:ruby2_keywords, true)
|
19
20
|
end
|
20
21
|
|
21
22
|
module CoreExtPrivate
|
@@ -25,6 +26,7 @@ module ActiveSupport
|
|
25
26
|
def fork(*)
|
26
27
|
super
|
27
28
|
end
|
29
|
+
ruby2_keywords(:fork) if respond_to?(:ruby2_keywords, true)
|
28
30
|
end
|
29
31
|
|
30
32
|
@pid = Process.pid
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require "active_support/core_ext/hash/keys"
|
4
4
|
require "active_support/core_ext/hash/reverse_merge"
|
5
5
|
require "active_support/core_ext/hash/except"
|
6
|
+
require "active_support/core_ext/hash/slice"
|
6
7
|
|
7
8
|
module ActiveSupport
|
8
9
|
# Implements a hash where keys <tt>:foo</tt> and <tt>"foo"</tt> are considered
|
@@ -113,7 +114,7 @@ module ActiveSupport
|
|
113
114
|
# <tt>ActiveSupport::HashWithIndifferentAccess</tt> or a regular +Hash+.
|
114
115
|
# In either case the merge respects the semantics of indifferent access.
|
115
116
|
#
|
116
|
-
# If the argument is a regular hash with keys +:key+ and
|
117
|
+
# If the argument is a regular hash with keys +:key+ and <tt>"key"</tt> only one
|
117
118
|
# of the values end up in the receiver, but which one is unspecified.
|
118
119
|
#
|
119
120
|
# When given a block, the value for duplicated keys will be determined
|
@@ -293,6 +294,10 @@ module ActiveSupport
|
|
293
294
|
super(convert_key(key))
|
294
295
|
end
|
295
296
|
|
297
|
+
# Returns a hash with indifferent access that includes everything except given keys.
|
298
|
+
# hash = { a: "x", b: "y", c: 10 }.with_indifferent_access
|
299
|
+
# hash.except(:a, "b") # => {c: 10}.with_indifferent_access
|
300
|
+
# hash # => { a: "x", b: "y", c: 10 }.with_indifferent_access
|
296
301
|
def except(*keys)
|
297
302
|
slice(*self.keys - keys.map { |key| convert_key(key) })
|
298
303
|
end
|
@@ -45,7 +45,7 @@ en:
|
|
45
45
|
# Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
|
46
46
|
precision: 3
|
47
47
|
# Determine how rounding is performed (see BigDecimal::mode)
|
48
|
-
round_mode:
|
48
|
+
round_mode: default
|
49
49
|
# If set to true, precision will mean the number of significant digits instead
|
50
50
|
# of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2)
|
51
51
|
significant: false
|
@@ -178,7 +178,7 @@ module ActiveSupport
|
|
178
178
|
#
|
179
179
|
# Subscribers using a regexp or other pattern-matching object will remain subscribed
|
180
180
|
# to all events that match their original pattern, unless those events match a string
|
181
|
-
# passed to
|
181
|
+
# passed to +unsubscribe+:
|
182
182
|
#
|
183
183
|
# subscriber = ActiveSupport::Notifications.subscribe(/render/) { }
|
184
184
|
# ActiveSupport::Notifications.unsubscribe('render_template.action_view')
|
@@ -20,14 +20,18 @@ module ActiveSupport
|
|
20
20
|
end
|
21
21
|
|
22
22
|
formatted_string =
|
23
|
-
if rounded_number.
|
24
|
-
"%00.#{precision}f" % rounded_number
|
25
|
-
else
|
23
|
+
if rounded_number.finite?
|
26
24
|
s = rounded_number.to_s("F")
|
27
|
-
s << "0" * precision
|
28
25
|
a, b = s.split(".", 2)
|
29
|
-
|
30
|
-
|
26
|
+
if precision != 0
|
27
|
+
b << "0" * precision
|
28
|
+
a << "."
|
29
|
+
a << b[0, precision]
|
30
|
+
end
|
31
|
+
a
|
32
|
+
else
|
33
|
+
# Infinity/NaN
|
34
|
+
"%f" % rounded_number
|
31
35
|
end
|
32
36
|
else
|
33
37
|
formatted_string = rounded_number
|
@@ -13,7 +13,7 @@ module ActiveSupport
|
|
13
13
|
precision = absolute_precision(number)
|
14
14
|
return number unless precision
|
15
15
|
|
16
|
-
rounded_number = convert_to_decimal(number).round(precision, options.fetch(:round_mode, :default))
|
16
|
+
rounded_number = convert_to_decimal(number).round(precision, options.fetch(:round_mode, :default).to_sym)
|
17
17
|
rounded_number.zero? ? rounded_number.abs : rounded_number # prevent showing negative zeros
|
18
18
|
end
|
19
19
|
|
@@ -33,7 +33,7 @@ module ActiveSupport
|
|
33
33
|
#
|
34
34
|
# ==== Options
|
35
35
|
#
|
36
|
-
# * <tt>:mask</tt> - A replaced object when filtered. Defaults to
|
36
|
+
# * <tt>:mask</tt> - A replaced object when filtered. Defaults to <tt>"[FILTERED]"</tt>.
|
37
37
|
def initialize(filters = [], mask: FILTERED)
|
38
38
|
@filters = filters
|
39
39
|
@mask = mask
|
@@ -31,7 +31,7 @@ module ActiveSupport
|
|
31
31
|
# the secret length. This should be considered when using secure_compare
|
32
32
|
# to compare weak, short secrets to user input.
|
33
33
|
def secure_compare(a, b)
|
34
|
-
a.
|
34
|
+
a.bytesize == b.bytesize && fixed_length_secure_compare(a, b)
|
35
35
|
end
|
36
36
|
module_function :secure_compare
|
37
37
|
end
|
@@ -301,7 +301,7 @@ module ActiveSupport
|
|
301
301
|
alias_method :in, :+
|
302
302
|
|
303
303
|
# Subtracts an interval of time and returns a new TimeWithZone object unless
|
304
|
-
# the other value
|
304
|
+
# the other value +acts_like?+ time. Then it will return a Float of the difference
|
305
305
|
# between the two times that represents the difference between the current
|
306
306
|
# object's time and the +other+ time.
|
307
307
|
#
|
@@ -508,7 +508,7 @@ module ActiveSupport
|
|
508
508
|
# Time#in_time_zone() instead.
|
509
509
|
#
|
510
510
|
# As of tzinfo 2, utc_to_local returns a Time with a non-zero utc_offset.
|
511
|
-
# See the
|
511
|
+
# See the +utc_to_local_returns_utc_offset_times+ config for more info.
|
512
512
|
def utc_to_local(time)
|
513
513
|
tzinfo.utc_to_local(time).yield_self do |t|
|
514
514
|
ActiveSupport.utc_to_local_returns_utc_offset_times ?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activesupport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -357,11 +357,11 @@ licenses:
|
|
357
357
|
- MIT
|
358
358
|
metadata:
|
359
359
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
360
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.1.
|
361
|
-
documentation_uri: https://api.rubyonrails.org/v6.1.
|
360
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.1.4/activesupport/CHANGELOG.md
|
361
|
+
documentation_uri: https://api.rubyonrails.org/v6.1.4/
|
362
362
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
363
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.1.
|
364
|
-
post_install_message:
|
363
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.1.4/activesupport
|
364
|
+
post_install_message:
|
365
365
|
rdoc_options:
|
366
366
|
- "--encoding"
|
367
367
|
- UTF-8
|
@@ -378,8 +378,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
378
378
|
- !ruby/object:Gem::Version
|
379
379
|
version: '0'
|
380
380
|
requirements: []
|
381
|
-
rubygems_version: 3.2
|
382
|
-
signing_key:
|
381
|
+
rubygems_version: 3.1.2
|
382
|
+
signing_key:
|
383
383
|
specification_version: 4
|
384
384
|
summary: A toolkit of support libraries and Ruby core extensions extracted from the
|
385
385
|
Rails framework.
|