activesupport 6.1.4.7 → 6.1.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: 00d1ffb5327d8d92613eaeca552453b2a69570ab5c0ee13c9120ea36e644aa2b
4
- data.tar.gz: 8fd8459bab73cb896daaf55836752bb1ca1470692e946a7aca27b8a546725c92
3
+ metadata.gz: 4b3babd75cfe9eba9446aa952df30fa9e7a6b8ace1d63022314a7cd9be07eeb6
4
+ data.tar.gz: 16ad9c941a3643fdb30602b5ffea85aedc9306babaaf5caccee7041726df0a89
5
5
  SHA512:
6
- metadata.gz: 717067e7bc66727dccde373d9be15b57a73c1168a668e1e684ffd919c6d6ac6add32bd620110a3a7fc9e621e0bea13fc4dcfbaacb54b4a57b30e4eec55ede433
7
- data.tar.gz: 1365f5d7aa1a4d5dc15d63d77b5dceb198d222d515de5959cbe88c63e0f112a82766c6a391a64dc06013ae2e8dd433d24ee7fcaa7bcc128e6ecde695f5c7ce54
6
+ metadata.gz: c362a52ce66fc84e04216656f8919cc39e22280fe7a5f2e0daf1f228ee503be30caf7b942bb7c8ca9445f0aed6604cf6cc8d048c9a9cc9154a91f284e17518db
7
+ data.tar.gz: bc8e7c37926b6c30b80ae39d22f0c57fb756e1fd8faebdd5047196afe7508b0ff86691c970f0db3c100e741445b76cb1366bda1dda6ecfc9b5a6ea574415e097
data/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ ## Rails 6.1.5 (March 09, 2022) ##
2
+
3
+ * Fix `ActiveSupport::Duration.build` to support negative values.
4
+
5
+ The algorithm to collect the `parts` of the `ActiveSupport::Duration`
6
+ ignored the sign of the `value` and accumulated incorrect part values. This
7
+ impacted `ActiveSupport::Duration#sum` (which is dependent on `parts`) but
8
+ not `ActiveSupport::Duration#eql?` (which is dependent on `value`).
9
+
10
+ *Caleb Buxton*, *Braden Staudacher*
11
+
12
+ * `Time#change` and methods that call it (eg. `Time#advance`) will now
13
+ return a `Time` with the timezone argument provided, if the caller was
14
+ initialized with a timezone argument.
15
+
16
+ Fixes [#42467](https://github.com/rails/rails/issues/42467).
17
+
18
+ *Alex Ghiculescu*
19
+
20
+ * Clone to keep extended Logger methods for tagged logger.
21
+
22
+ *Orhan Toy*
23
+
24
+ * `assert_changes` works on including `ActiveSupport::Assertions` module.
25
+
26
+ *Pedro Medeiros*
27
+
28
+
1
29
  ## Rails 6.1.4.7 (March 08, 2022) ##
2
30
 
3
31
  * No changes.
@@ -308,7 +336,7 @@
308
336
 
309
337
  *Max Gurewitz*
310
338
 
311
- * `URI.parser` is deprecated and will be removed in Rails 6.2. Use
339
+ * `URI.parser` is deprecated and will be removed in Rails 7.0. Use
312
340
  `URI::DEFAULT_PARSER` instead.
313
341
 
314
342
  *Jean Boussier*
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2005-2020 David Heinemeier Hansson
1
+ Copyright (c) 2005-2022 David Heinemeier Hansson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "securerandom"
4
+ require "digest"
4
5
 
5
6
  module Digest
6
7
  module UUID
@@ -160,6 +160,8 @@ class Time
160
160
  ::Time.new(new_year, new_month, new_day, new_hour, new_min, new_sec, new_offset)
161
161
  elsif utc?
162
162
  ::Time.utc(new_year, new_month, new_day, new_hour, new_min, new_sec)
163
+ elsif zone&.respond_to?(:utc_to_local)
164
+ ::Time.new(new_year, new_month, new_day, new_hour, new_min, new_sec, zone)
163
165
  elsif zone
164
166
  ::Time.local(new_year, new_month, new_day, new_hour, new_min, new_sec)
165
167
  else
@@ -20,7 +20,7 @@ module URI
20
20
  class << self
21
21
  def parser
22
22
  ActiveSupport::Deprecation.warn(<<-MSG.squish)
23
- URI.parser is deprecated and will be removed in Rails 6.2.
23
+ URI.parser is deprecated and will be removed in Rails 7.0.
24
24
  Use `URI::DEFAULT_PARSER` instead.
25
25
  MSG
26
26
  URI::DEFAULT_PARSER
@@ -89,7 +89,10 @@ module ActiveSupport
89
89
  end
90
90
 
91
91
  Rails.autoloaders.main.enable_reloading if enable_reloading
92
- Rails.autoloaders.each(&:setup)
92
+
93
+ # Order matters.
94
+ Rails.autoloaders.once.setup
95
+ Rails.autoloaders.main.setup
93
96
  end
94
97
 
95
98
  def autoload_once?(autoload_path)
@@ -38,7 +38,7 @@ module ActiveSupport
38
38
  # and the second is a library name.
39
39
  #
40
40
  # ActiveSupport::Deprecation.new('2.0', 'MyLibrary')
41
- def initialize(deprecation_horizon = "6.2", gem_name = "Rails")
41
+ def initialize(deprecation_horizon = "7.0", gem_name = "Rails")
42
42
  self.gem_name = gem_name
43
43
  self.deprecation_horizon = deprecation_horizon
44
44
  # By default, warnings are not silenced and debugging is off.
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "digest"
4
+
3
5
  module ActiveSupport
4
6
  class Digest #:nodoc:
5
7
  class <<self
@@ -186,17 +186,18 @@ module ActiveSupport
186
186
  end
187
187
 
188
188
  parts = {}
189
- remainder = value.round(9)
189
+ remainder_sign = value <=> 0
190
+ remainder = value.round(9).abs
190
191
 
191
192
  PARTS.each do |part|
192
193
  unless part == :seconds
193
194
  part_in_seconds = PARTS_IN_SECONDS[part]
194
- parts[part] = remainder.div(part_in_seconds)
195
+ parts[part] = remainder.div(part_in_seconds) * remainder_sign
195
196
  remainder %= part_in_seconds
196
197
  end
197
198
  end unless value == 0
198
199
 
199
- parts[:seconds] = remainder
200
+ parts[:seconds] = remainder * remainder_sign
200
201
 
201
202
  new(value, parts)
202
203
  end
@@ -9,8 +9,8 @@ module ActiveSupport
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
- TINY = 4
13
- PRE = "7"
12
+ TINY = 5
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -10,13 +10,13 @@ module ActiveSupport
10
10
 
11
11
  def default_normalization_form
12
12
  ActiveSupport::Deprecation.warn(
13
- "ActiveSupport::Multibyte::Unicode.default_normalization_form is deprecated and will be removed in Rails 6.2."
13
+ "ActiveSupport::Multibyte::Unicode.default_normalization_form is deprecated and will be removed in Rails 7.0."
14
14
  )
15
15
  end
16
16
 
17
17
  def default_normalization_form=(_)
18
18
  ActiveSupport::Deprecation.warn(
19
- "ActiveSupport::Multibyte::Unicode.default_normalization_form= is deprecated and will be removed in Rails 6.2."
19
+ "ActiveSupport::Multibyte::Unicode.default_normalization_form= is deprecated and will be removed in Rails 7.0."
20
20
  )
21
21
  end
22
22
 
@@ -56,5 +56,6 @@ module ActiveSupport
56
56
 
57
57
  send(name, *args, &block)
58
58
  end
59
+ ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
59
60
  end
60
61
  end
@@ -87,7 +87,7 @@ module ActiveSupport
87
87
  if app.config.active_support.use_sha1_digests
88
88
  ActiveSupport::Deprecation.warn(<<-MSG.squish)
89
89
  config.active_support.use_sha1_digests is deprecated and will
90
- be removed from Rails 6.2. Use
90
+ be removed from Rails 7.0. Use
91
91
  config.active_support.hash_digest_class = ::Digest::SHA1 instead.
92
92
  MSG
93
93
  ActiveSupport::Digest.hash_digest_class = ::Digest::SHA1
@@ -79,7 +79,7 @@ module ActiveSupport
79
79
  end
80
80
 
81
81
  def self.new(logger)
82
- logger = logger.dup
82
+ logger = logger.clone
83
83
 
84
84
  if logger.formatter
85
85
  logger.formatter = logger.formatter.dup
@@ -189,7 +189,7 @@ module ActiveSupport
189
189
  error = "#{expression.inspect} didn't change"
190
190
  error = "#{error}. It was already #{to}" if before == to
191
191
  error = "#{message}.\n#{error}" if message
192
- assert_not_equal before, after, error
192
+ refute_equal before, after, error
193
193
 
194
194
  unless to == UNTRACKED
195
195
  error = "Expected change to #{to}\n"
@@ -381,6 +381,8 @@ module ActiveSupport
381
381
  # If the string is invalid then an +ArgumentError+ will be raised unlike +parse+
382
382
  # which usually returns +nil+ when given an invalid date string.
383
383
  def iso8601(str)
384
+ raise ArgumentError, "invalid date" if str.nil?
385
+
384
386
  parts = Date._iso8601(str)
385
387
 
386
388
  raise ArgumentError, "invalid date" if parts.empty?
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # Copyright (c) 2005-2020 David Heinemeier Hansson
4
+ # Copyright (c) 2005-2022 David Heinemeier Hansson
5
5
  #
6
6
  # Permission is hereby granted, free of charge, to any person obtaining
7
7
  # a copy of this software and associated documentation files (the
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.7
4
+ version: 6.1.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: 2022-03-08 00:00:00.000000000 Z
11
+ date: 2022-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -357,11 +357,12 @@ 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.4.7/activesupport/CHANGELOG.md
361
- documentation_uri: https://api.rubyonrails.org/v6.1.4.7/
360
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.5/activesupport/CHANGELOG.md
361
+ documentation_uri: https://api.rubyonrails.org/v6.1.5/
362
362
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
363
- source_code_uri: https://github.com/rails/rails/tree/v6.1.4.7/activesupport
364
- post_install_message:
363
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.5/activesupport
364
+ rubygems_mfa_required: 'true'
365
+ post_install_message:
365
366
  rdoc_options:
366
367
  - "--encoding"
367
368
  - UTF-8
@@ -378,8 +379,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
378
379
  - !ruby/object:Gem::Version
379
380
  version: '0'
380
381
  requirements: []
381
- rubygems_version: 3.1.6
382
- signing_key:
382
+ rubygems_version: 3.3.7
383
+ signing_key:
383
384
  specification_version: 4
384
385
  summary: A toolkit of support libraries and Ruby core extensions extracted from the
385
386
  Rails framework.