activesupport 5.2.4.6 → 5.2.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98486e8fde8841862573d7435ab499973599e14e866122a53dd98882152f2cdd
4
- data.tar.gz: 07ce3c2233403235020f13d65a8f2aede6a6f29c40f53e9e1b8fcdde454c1da4
3
+ metadata.gz: 7064b7c29850882af63657ca21981ff9b328f05205035d5708003f7afe68d3cc
4
+ data.tar.gz: cd0c59a687910eb495507cdad5b6ee9b6a3742b75567bc07c44586ce523dfad0
5
5
  SHA512:
6
- metadata.gz: 3bbb207fce9c30534c716bb59e9f637744832dce74e662d65fc99c8459ac2a78f9aacfa586d2877d37cbe3d001e20f5b4e635da4c5337719b26ee67627d4d6f8
7
- data.tar.gz: f433ba6bd38c54f96b375fe7cfa9af265954f76292d95bf57f1300982273e4829cd4db2f6393036dd2ad7e3461fd2ec0ace3b12e50651a7a0e5ad72ef75d8909
6
+ metadata.gz: ad8749d13d3707110dff8cd9efed02b92199deb890f28c8c085b29dcb6e44b594096c2a48f60eb3496f9e8a1ceda24b5eb539f2d3c649d6871f5b1111cdc02ee
7
+ data.tar.gz: b1a7cc698f146647647e0c936eb523bff63c0c8283efbde4926e2aaceb811cb98d83d83fddb30727714956f5a4a2fcca4b6c0ce033485eaf6d17301c0f26c614
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## Rails 5.2.6.2 (February 11, 2022) ##
2
+
3
+ * Fix Reloader method signature to work with the new Executor signature
4
+
5
+
6
+ ## Rails 5.2.6.1 (February 11, 2022) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 5.2.6 (May 05, 2021) ##
12
+
13
+ * No changes.
14
+
15
+
16
+ ## Rails 5.2.5 (March 26, 2021) ##
17
+
18
+ * No changes.
19
+
20
+
1
21
  ## Rails 5.2.4.6 (May 05, 2021) ##
2
22
 
3
23
  * No changes.
@@ -19,6 +39,11 @@
19
39
 
20
40
  * [CVE-2020-8165] Avoid Marshal.load on raw cache value in MemCacheStore
21
41
 
42
+ ## Rails 5.2.4.2 (March 19, 2020) ##
43
+
44
+ * No changes.
45
+
46
+
22
47
  ## Rails 5.2.4.1 (December 18, 2019) ##
23
48
 
24
49
  * No changes.
@@ -7,6 +7,7 @@ rescue LoadError => e
7
7
  raise e
8
8
  end
9
9
 
10
+ require "active_support/core_ext/marshal"
10
11
  require "active_support/core_ext/array/extract_options"
11
12
 
12
13
  module ActiveSupport
@@ -320,7 +320,7 @@ module ActiveSupport
320
320
  # Read an entry from the cache.
321
321
  def read_entry(key, options = nil)
322
322
  failsafe :read_entry do
323
- raw = options&.fetch(:raw, false)
323
+ raw = options && options.fetch(:raw, false)
324
324
  deserialize_entry(redis.with { |c| c.get(key) }, raw: raw)
325
325
  end
326
326
  end
@@ -336,7 +336,7 @@ module ActiveSupport
336
336
  def read_multi_mget(*names)
337
337
  options = names.extract_options!
338
338
  options = merged_options(options)
339
- raw = options&.fetch(:raw, false)
339
+ raw = options && options.fetch(:raw, false)
340
340
 
341
341
  keys = names.map { |name| normalize_key(name, options) }
342
342
 
@@ -183,15 +183,15 @@ module ActiveSupport
183
183
  #
184
184
  def build(value)
185
185
  parts = {}
186
- remainder = value.to_f
186
+ remainder = value.round(9)
187
187
 
188
188
  PARTS.each do |part|
189
189
  unless part == :seconds
190
190
  part_in_seconds = PARTS_IN_SECONDS[part]
191
191
  parts[part] = remainder.div(part_in_seconds)
192
- remainder = (remainder % part_in_seconds).round(9)
192
+ remainder %= part_in_seconds
193
193
  end
194
- end
194
+ end unless value == 0
195
195
 
196
196
  parts[:seconds] = remainder
197
197
 
@@ -210,7 +210,7 @@ module ActiveSupport
210
210
  def initialize(value, parts) #:nodoc:
211
211
  @value, @parts = value, parts.to_h
212
212
  @parts.default = 0
213
- @parts.reject! { |k, v| v.zero? }
213
+ @parts.reject! { |k, v| v.zero? } unless value == 0
214
214
  end
215
215
 
216
216
  def coerce(other) #:nodoc:
@@ -400,8 +400,14 @@ module ActiveSupport
400
400
  private
401
401
 
402
402
  def sum(sign, time = ::Time.current)
403
- parts.inject(time) do |t, (type, number)|
404
- if t.acts_like?(:time) || t.acts_like?(:date)
403
+ unless time.acts_like?(:time) || time.acts_like?(:date)
404
+ raise ::ArgumentError, "expected a time or date, got #{time.inspect}"
405
+ end
406
+
407
+ if parts.empty?
408
+ time.since(sign * value)
409
+ else
410
+ parts.inject(time) do |t, (type, number)|
405
411
  if type == :seconds
406
412
  t.since(sign * number)
407
413
  elsif type == :minutes
@@ -411,8 +417,6 @@ module ActiveSupport
411
417
  else
412
418
  t.advance(type => sign * number)
413
419
  end
414
- else
415
- raise ::ArgumentError, "expected a time or date, got #{time.inspect}"
416
420
  end
417
421
  end
418
422
  end
@@ -62,18 +62,21 @@ module ActiveSupport
62
62
  # after the work has been performed.
63
63
  #
64
64
  # Where possible, prefer +wrap+.
65
- def self.run!
66
- if active?
67
- Null
65
+ def self.run!(reset: false)
66
+ if reset
67
+ lost_instance = active.delete(Thread.current)
68
+ lost_instance&.complete!
68
69
  else
69
- new.tap do |instance|
70
- success = nil
71
- begin
72
- instance.run!
73
- success = true
74
- ensure
75
- instance.complete! unless success
76
- end
70
+ return Null if active?
71
+ end
72
+
73
+ new.tap do |instance|
74
+ success = nil
75
+ begin
76
+ instance.run!
77
+ success = true
78
+ ensure
79
+ instance.complete! unless success
77
80
  end
78
81
  end
79
82
  end
@@ -102,11 +105,11 @@ module ActiveSupport
102
105
  self.active = Concurrent::Hash.new
103
106
 
104
107
  def self.active? # :nodoc:
105
- @active[Thread.current]
108
+ @active.key?(Thread.current)
106
109
  end
107
110
 
108
111
  def run! # :nodoc:
109
- self.class.active[Thread.current] = true
112
+ self.class.active[Thread.current] = self
110
113
  run_callbacks(:run)
111
114
  end
112
115
 
@@ -9,8 +9,8 @@ module ActiveSupport
9
9
  module VERSION
10
10
  MAJOR = 5
11
11
  MINOR = 2
12
- TINY = 4
13
- PRE = "6"
12
+ TINY = 6
13
+ PRE = "2"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -59,7 +59,7 @@ module ActiveSupport
59
59
  prepare!
60
60
  end
61
61
 
62
- def self.run! # :nodoc:
62
+ def self.run!(reset: false) # :nodoc:
63
63
  if check!
64
64
  super
65
65
  else
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: 5.2.4.6
4
+ version: 5.2.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-05 00:00:00.000000000 Z
11
+ date: 2022-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -333,8 +333,8 @@ homepage: http://rubyonrails.org
333
333
  licenses:
334
334
  - MIT
335
335
  metadata:
336
- source_code_uri: https://github.com/rails/rails/tree/v5.2.4.6/activesupport
337
- changelog_uri: https://github.com/rails/rails/blob/v5.2.4.6/activesupport/CHANGELOG.md
336
+ source_code_uri: https://github.com/rails/rails/tree/v5.2.6.2/activesupport
337
+ changelog_uri: https://github.com/rails/rails/blob/v5.2.6.2/activesupport/CHANGELOG.md
338
338
  post_install_message:
339
339
  rdoc_options:
340
340
  - "--encoding"
@@ -352,7 +352,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
352
352
  - !ruby/object:Gem::Version
353
353
  version: '0'
354
354
  requirements: []
355
- rubygems_version: 3.1.2
355
+ rubygems_version: 3.1.6
356
356
  signing_key:
357
357
  specification_version: 4
358
358
  summary: A toolkit of support libraries and Ruby core extensions extracted from the