activesupport 6.1.3.1 → 6.1.4.2
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 +46 -0
- 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/cache.rb +7 -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 +2 -2
- data/lib/active_support/hash_with_indifferent_access.rb +5 -0
- data/lib/active_support/locale/en.yml +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/security_utils.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: bf7e19ba2e1d0a24549ec6ec697496e079be3da50264a2f4edae0da4eb35ad62
|
4
|
+
data.tar.gz: ddb87eb893cdb889f4ee529393bc39a047801132aab5c0b485aa15c5065d03e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ff285f6dae07cfeb1bce11657578fc386b35358137314aa9445653343167822f93e30e91ad78e5a69caa3e19ebc9a2f5493574e85bf645e04423c7a8c53920d
|
7
|
+
data.tar.gz: b34d549dc38753838653d4455f66f3fcf61528c7ab24d4b5b2f525f2943f6616049488f411de691b702a3f25f4c471caf9d982e0d7d21eaf4c64d8c05cdd2088
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,49 @@
|
|
1
|
+
## Rails 6.1.4.2 (December 14, 2021) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 6.1.4.1 (August 19, 2021) ##
|
7
|
+
|
8
|
+
* No changes.
|
9
|
+
|
10
|
+
|
11
|
+
## Rails 6.1.4 (June 24, 2021) ##
|
12
|
+
|
13
|
+
* MemCacheStore: convert any underlying value (including `false`) to an `Entry`.
|
14
|
+
|
15
|
+
See [#42559](https://github.com/rails/rails/pull/42559).
|
16
|
+
|
17
|
+
*Alex Ghiculescu*
|
18
|
+
|
19
|
+
* Fix bug in `number_with_precision` when using large `BigDecimal` values.
|
20
|
+
|
21
|
+
Fixes #42302.
|
22
|
+
|
23
|
+
*Federico Aldunate*, *Zachary Scott*
|
24
|
+
|
25
|
+
* Check byte size instead of length on `secure_compare`.
|
26
|
+
|
27
|
+
*Tietew*
|
28
|
+
|
29
|
+
* Fix `Time.at` to not lose `:in` option.
|
30
|
+
|
31
|
+
*Ryuta Kamizono*
|
32
|
+
|
33
|
+
* Require a path for `config.cache_store = :file_store`.
|
34
|
+
|
35
|
+
*Alex Ghiculescu*
|
36
|
+
|
37
|
+
* Avoid having to store complex object in the default translation file.
|
38
|
+
|
39
|
+
*Rafael Mendonça França*
|
40
|
+
|
41
|
+
|
42
|
+
## Rails 6.1.3.2 (May 05, 2021) ##
|
43
|
+
|
44
|
+
* No changes.
|
45
|
+
|
46
|
+
|
1
47
|
## Rails 6.1.3.1 (March 26, 2021) ##
|
2
48
|
|
3
49
|
* No changes.
|
@@ -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
|
|
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
|
@@ -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
|
@@ -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
|
@@ -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
|
|
@@ -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
|
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.2
|
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-12-14 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.2/activesupport/CHANGELOG.md
|
361
|
+
documentation_uri: https://api.rubyonrails.org/v6.1.4.2/
|
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.2/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.
|
382
|
-
signing_key:
|
381
|
+
rubygems_version: 3.2.15
|
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.
|