activesupport 7.0.6 → 7.0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/lib/active_support/cache/strategy/local_cache.rb +1 -1
- data/lib/active_support/core_ext/date/deprecated_conversions.rb +12 -1
- data/lib/active_support/core_ext/date_time/deprecated_conversions.rb +12 -1
- data/lib/active_support/core_ext/enumerable.rb +17 -12
- data/lib/active_support/core_ext/range/deprecated_conversions.rb +8 -1
- data/lib/active_support/core_ext/time/deprecated_conversions.rb +12 -1
- data/lib/active_support/encrypted_file.rb +8 -9
- data/lib/active_support/evented_file_update_checker.rb +3 -1
- data/lib/active_support/gem_version.rb +2 -2
- data/lib/active_support/inflector/methods.rb +1 -1
- data/lib/active_support/time_with_zone.rb +8 -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: 04536a88c7cef8a70a74892d515e186b52035d5173af41840637b2ed9bad4d47
|
4
|
+
data.tar.gz: 68814229938ebce3a9500a6dac0d5db7ad70ba1b9ff75bf784c1006a72f66fb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6817bb1e03d8ff97bcfbc6dd933e622a1bb8c220de50c30d435e9e53f7f2dbb26f4bfa289fc3da8384d13d5bf7528539eff53299d28e0da83ce96500e2385e10
|
7
|
+
data.tar.gz: 90a083d63440b72339b96cbd0aeade50b73907fc41157666fccf1b4bd02b86865972d98388f591c749f371c2d4a353c7e8d489cbefdc2f548a4da3030ace8b4e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,39 @@
|
|
1
|
+
## Rails 7.0.7.2 (August 22, 2023) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 7.0.7.1 (August 22, 2023) ##
|
7
|
+
|
8
|
+
* Use a temporary file for storing unencrypted files while editing
|
9
|
+
|
10
|
+
[CVE-2023-38037]
|
11
|
+
|
12
|
+
|
13
|
+
## Rails 7.0.7 (August 09, 2023) ##
|
14
|
+
|
15
|
+
* Fix `Cache::NullStore` with local caching for repeated reads.
|
16
|
+
|
17
|
+
*fatkodima*
|
18
|
+
|
19
|
+
* Fix `to_s` with no arguments not respecting custom `:default` formats
|
20
|
+
|
21
|
+
*Hartley McGuire*
|
22
|
+
|
23
|
+
* Fix `ActiveSupport::Inflector.humanize(nil)` raising ``NoMethodError: undefined method `end_with?' for nil:NilClass``.
|
24
|
+
|
25
|
+
*James Robinson*
|
26
|
+
|
27
|
+
* Fix `Enumerable#sum` for `Enumerator#lazy`.
|
28
|
+
|
29
|
+
*fatkodima*, *Matthew Draper*, *Jonathan Hefner*
|
30
|
+
|
31
|
+
* Improve error message when EventedFileUpdateChecker is used without a
|
32
|
+
compatible version of the Listen gem
|
33
|
+
|
34
|
+
*Hartley McGuire*
|
35
|
+
|
36
|
+
|
1
37
|
## Rails 7.0.6 (June 29, 2023) ##
|
2
38
|
|
3
39
|
* Fix `EncryptedConfiguration` returning incorrect values for some `Hash`
|
@@ -124,7 +124,7 @@ module ActiveSupport
|
|
124
124
|
|
125
125
|
local_entries = local_cache.read_multi_entries(keys)
|
126
126
|
local_entries.transform_values! do |payload|
|
127
|
-
deserialize_entry(payload)
|
127
|
+
deserialize_entry(payload)&.value
|
128
128
|
end
|
129
129
|
missed_keys = keys - local_entries.keys
|
130
130
|
|
@@ -15,7 +15,18 @@ class Date
|
|
15
15
|
strftime(formatter)
|
16
16
|
end
|
17
17
|
elsif format == NOT_SET
|
18
|
-
|
18
|
+
if formatter = DATE_FORMATS[:default]
|
19
|
+
ActiveSupport::Deprecation.warn(
|
20
|
+
"Using a :default format for Date#to_s is deprecated. Please use Date#to_fs instead."
|
21
|
+
)
|
22
|
+
if formatter.respond_to?(:call)
|
23
|
+
formatter.call(self).to_s
|
24
|
+
else
|
25
|
+
strftime(formatter)
|
26
|
+
end
|
27
|
+
else
|
28
|
+
to_default_s
|
29
|
+
end
|
19
30
|
else
|
20
31
|
ActiveSupport::Deprecation.warn(
|
21
32
|
"Date#to_s(#{format.inspect}) is deprecated. Please use Date#to_fs(#{format.inspect}) instead."
|
@@ -11,7 +11,18 @@ class DateTime
|
|
11
11
|
)
|
12
12
|
formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)
|
13
13
|
elsif format == NOT_SET
|
14
|
-
|
14
|
+
if formatter = ::Time::DATE_FORMATS[:default]
|
15
|
+
ActiveSupport::Deprecation.warn(
|
16
|
+
"Using a :default format for DateTime#to_s is deprecated. Please use DateTime#to_fs instead."
|
17
|
+
)
|
18
|
+
if formatter.respond_to?(:call)
|
19
|
+
formatter.call(self).to_s
|
20
|
+
else
|
21
|
+
strftime(formatter)
|
22
|
+
end
|
23
|
+
else
|
24
|
+
to_default_s
|
25
|
+
end
|
15
26
|
else
|
16
27
|
ActiveSupport::Deprecation.warn(
|
17
28
|
"DateTime#to_s(#{format.inspect}) is deprecated. Please use DateTime#to_fs(#{format.inspect}) instead."
|
@@ -76,19 +76,24 @@ module Enumerable
|
|
76
76
|
_original_sum_with_required_identity(identity, &block)
|
77
77
|
elsif block_given?
|
78
78
|
map(&block).sum
|
79
|
-
# we check `first(1) == []` to check if we have an
|
80
|
-
# empty Enumerable; checking `empty?` would return
|
81
|
-
# true for `[nil]`, which we want to deprecate to
|
82
|
-
# keep consistent with Ruby
|
83
|
-
elsif first.is_a?(Numeric) || first(1) == [] || first.respond_to?(:coerce)
|
84
|
-
identity ||= 0
|
85
|
-
_original_sum_with_required_identity(identity, &block)
|
86
79
|
else
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
80
|
+
first = true
|
81
|
+
|
82
|
+
reduce(nil) do |sum, value|
|
83
|
+
if first
|
84
|
+
first = false
|
85
|
+
|
86
|
+
unless value.is_a?(Numeric) || value.respond_to?(:coerce)
|
87
|
+
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
88
|
+
Rails 7.0 has deprecated Enumerable.sum in favor of Ruby's native implementation available since 2.4.
|
89
|
+
Sum of non-numeric elements requires an initial argument.
|
90
|
+
MSG
|
91
|
+
end
|
92
|
+
value
|
93
|
+
else
|
94
|
+
sum + value
|
95
|
+
end
|
96
|
+
end || 0
|
92
97
|
end
|
93
98
|
end
|
94
99
|
|
@@ -10,7 +10,14 @@ module ActiveSupport
|
|
10
10
|
)
|
11
11
|
formatter.call(first, last)
|
12
12
|
elsif format == NOT_SET
|
13
|
-
|
13
|
+
if formatter = RangeWithFormat::RANGE_FORMATS[:default]
|
14
|
+
ActiveSupport::Deprecation.warn(
|
15
|
+
"Using a :default format for Range#to_s is deprecated. Please use Range#to_fs instead."
|
16
|
+
)
|
17
|
+
formatter.call(first, last)
|
18
|
+
else
|
19
|
+
super()
|
20
|
+
end
|
14
21
|
else
|
15
22
|
ActiveSupport::Deprecation.warn(
|
16
23
|
"Range#to_s(#{format.inspect}) is deprecated. Please use Range#to_fs(#{format.inspect}) instead."
|
@@ -11,7 +11,18 @@ class Time
|
|
11
11
|
)
|
12
12
|
formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)
|
13
13
|
elsif format == NOT_SET
|
14
|
-
|
14
|
+
if formatter = ::Time::DATE_FORMATS[:default]
|
15
|
+
ActiveSupport::Deprecation.warn(
|
16
|
+
"Using a :default format for Time#to_s is deprecated. Please use Time#to_fs instead."
|
17
|
+
)
|
18
|
+
if formatter.respond_to?(:call)
|
19
|
+
formatter.call(self).to_s
|
20
|
+
else
|
21
|
+
strftime(formatter)
|
22
|
+
end
|
23
|
+
else
|
24
|
+
to_default_s
|
25
|
+
end
|
15
26
|
else
|
16
27
|
ActiveSupport::Deprecation.warn(
|
17
28
|
"Time#to_s(#{format.inspect}) is deprecated. Please use Time#to_fs(#{format.inspect}) instead."
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "pathname"
|
4
|
-
require "
|
4
|
+
require "tempfile"
|
5
5
|
require "active_support/message_encryptor"
|
6
6
|
|
7
7
|
module ActiveSupport
|
@@ -81,17 +81,16 @@ module ActiveSupport
|
|
81
81
|
|
82
82
|
private
|
83
83
|
def writing(contents)
|
84
|
-
|
85
|
-
|
86
|
-
|
84
|
+
Tempfile.create(["", "-" + content_path.basename.to_s.chomp(".enc")]) do |tmp_file|
|
85
|
+
tmp_path = Pathname.new(tmp_file)
|
86
|
+
tmp_path.binwrite contents
|
87
87
|
|
88
|
-
|
88
|
+
yield tmp_path
|
89
89
|
|
90
|
-
|
90
|
+
updated_contents = tmp_path.binread
|
91
91
|
|
92
|
-
|
93
|
-
|
94
|
-
FileUtils.rm(tmp_path) if tmp_path&.exist?
|
92
|
+
write(updated_contents) if updated_contents != contents
|
93
|
+
end
|
95
94
|
end
|
96
95
|
|
97
96
|
|
@@ -136,7 +136,7 @@ module ActiveSupport
|
|
136
136
|
|
137
137
|
result.tr!("_", " ")
|
138
138
|
result.lstrip!
|
139
|
-
if !keep_id_suffix && lower_case_and_underscored_word
|
139
|
+
if !keep_id_suffix && lower_case_and_underscored_word&.end_with?("_id")
|
140
140
|
result.delete_suffix!(" id")
|
141
141
|
end
|
142
142
|
|
@@ -221,7 +221,14 @@ module ActiveSupport
|
|
221
221
|
)
|
222
222
|
formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)
|
223
223
|
elsif format == NOT_SET
|
224
|
-
|
224
|
+
if formatter = ::Time::DATE_FORMATS[:default]
|
225
|
+
ActiveSupport::Deprecation.warn(
|
226
|
+
"Using a :default format for TimeWithZone#to_s is deprecated. Please use TimeWithZone#to_fs instead."
|
227
|
+
)
|
228
|
+
formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)
|
229
|
+
else
|
230
|
+
"#{time.strftime("%Y-%m-%d %H:%M:%S")} #{formatted_offset(false, 'UTC')}" # mimicking Ruby Time#to_s format
|
231
|
+
end
|
225
232
|
else
|
226
233
|
ActiveSupport::Deprecation.warn(
|
227
234
|
"TimeWithZone#to_s(#{format.inspect}) is deprecated. Please use TimeWithZone#to_fs(#{format.inspect}) instead."
|
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: 7.0.
|
4
|
+
version: 7.0.7.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: 2023-
|
11
|
+
date: 2023-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -359,12 +359,12 @@ licenses:
|
|
359
359
|
- MIT
|
360
360
|
metadata:
|
361
361
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
362
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.0.
|
363
|
-
documentation_uri: https://api.rubyonrails.org/v7.0.
|
362
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.7.2/activesupport/CHANGELOG.md
|
363
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.7.2/
|
364
364
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
365
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.0.
|
365
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.7.2/activesupport
|
366
366
|
rubygems_mfa_required: 'true'
|
367
|
-
post_install_message:
|
367
|
+
post_install_message:
|
368
368
|
rdoc_options:
|
369
369
|
- "--encoding"
|
370
370
|
- UTF-8
|
@@ -381,8 +381,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
381
381
|
- !ruby/object:Gem::Version
|
382
382
|
version: '0'
|
383
383
|
requirements: []
|
384
|
-
rubygems_version: 3.
|
385
|
-
signing_key:
|
384
|
+
rubygems_version: 3.3.3
|
385
|
+
signing_key:
|
386
386
|
specification_version: 4
|
387
387
|
summary: A toolkit of support libraries and Ruby core extensions extracted from the
|
388
388
|
Rails framework.
|