activesupport 5.2.4.6 → 5.2.5

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: 7e0fa29c7295e4a4402a7e6c2db46a0179f35b3b68125888a6cc191b186af251
4
+ data.tar.gz: b1683c3540effb16dd44128bb9f0986388f21ff777e0b3a44eae779160aaf45f
5
5
  SHA512:
6
- metadata.gz: 3bbb207fce9c30534c716bb59e9f637744832dce74e662d65fc99c8459ac2a78f9aacfa586d2877d37cbe3d001e20f5b4e635da4c5337719b26ee67627d4d6f8
7
- data.tar.gz: f433ba6bd38c54f96b375fe7cfa9af265954f76292d95bf57f1300982273e4829cd4db2f6393036dd2ad7e3461fd2ec0ace3b12e50651a7a0e5ad72ef75d8909
6
+ metadata.gz: 6b323c40a81203c83c422534df283d010d1f544787277cf914008353a8c5437dfba3b688176512a197af31df312c5a0e56f06b7fa19578ba4ff78189fd05041b
7
+ data.tar.gz: 3ad31799a6a8f24dabac77889a5d0b5e2c6f4fe818426abe4aa98a26a307159cf79ff03eb44af5bf3ea84efd7c6604fbe2240366c98cc3f0575fc7fe628132f4
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ## Rails 5.2.4.6 (May 05, 2021) ##
1
+ ## Rails 5.2.5 (March 26, 2021) ##
2
2
 
3
3
  * No changes.
4
4
 
@@ -19,6 +19,11 @@
19
19
 
20
20
  * [CVE-2020-8165] Avoid Marshal.load on raw cache value in MemCacheStore
21
21
 
22
+ ## Rails 5.2.4.2 (March 19, 2020) ##
23
+
24
+ * No changes.
25
+
26
+
22
27
  ## Rails 5.2.4.1 (December 18, 2019) ##
23
28
 
24
29
  * 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
@@ -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 = 5
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  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: 5.2.4.6
4
+ version: 5.2.5
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-05-05 00:00:00.000000000 Z
11
+ date: 2021-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -333,9 +333,9 @@ 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
338
- post_install_message:
336
+ source_code_uri: https://github.com/rails/rails/tree/v5.2.5/activesupport
337
+ changelog_uri: https://github.com/rails/rails/blob/v5.2.5/activesupport/CHANGELOG.md
338
+ post_install_message:
339
339
  rdoc_options:
340
340
  - "--encoding"
341
341
  - UTF-8
@@ -353,7 +353,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
353
353
  version: '0'
354
354
  requirements: []
355
355
  rubygems_version: 3.1.2
356
- signing_key:
356
+ signing_key:
357
357
  specification_version: 4
358
358
  summary: A toolkit of support libraries and Ruby core extensions extracted from the
359
359
  Rails framework.