activesupport 6.1.3.2 → 6.1.4.7

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: 79de516b16a70e3ae9100d8f6a35deca4f3dec0f3c080ea4c44debdfdddb11d0
4
- data.tar.gz: 187bd3a2e457d13669cd200ad633508bc8601225cadee1688ef17847d49da6ae
3
+ metadata.gz: 00d1ffb5327d8d92613eaeca552453b2a69570ab5c0ee13c9120ea36e644aa2b
4
+ data.tar.gz: 8fd8459bab73cb896daaf55836752bb1ca1470692e946a7aca27b8a546725c92
5
5
  SHA512:
6
- metadata.gz: 0b7a231bd4b8c8d8feb1d84150c1217afa22c221150e562689ea70e761f5a2c67e1db8dfda5daa3832d3a61d864769cb922f3b5e0b6f797a101be34fdcea2b43
7
- data.tar.gz: 5964297423a93328267eafbe48ed68828d38d0c8040b0765ecfa2da24bb0edbcab537caf00993c6e5d9859be37d5d3ea79f557981f212a6f76f7454177110e18
6
+ metadata.gz: 717067e7bc66727dccde373d9be15b57a73c1168a668e1e684ffd919c6d6ac6add32bd620110a3a7fc9e621e0bea13fc4dcfbaacb54b4a57b30e4eec55ede433
7
+ data.tar.gz: 1365f5d7aa1a4d5dc15d63d77b5dceb198d222d515de5959cbe88c63e0f112a82766c6a391a64dc06013ae2e8dd433d24ee7fcaa7bcc128e6ecde695f5c7ce54
data/CHANGELOG.md CHANGED
@@ -1,3 +1,69 @@
1
+ ## Rails 6.1.4.7 (March 08, 2022) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 6.1.4.6 (February 11, 2022) ##
7
+
8
+ * Fix Reloader method signature to work with the new Executor signature
9
+
10
+
11
+ ## Rails 6.1.4.5 (February 11, 2022) ##
12
+
13
+ * No changes.
14
+
15
+
16
+ ## Rails 6.1.4.4 (December 15, 2021) ##
17
+
18
+ * No changes.
19
+
20
+
21
+ ## Rails 6.1.4.3 (December 14, 2021) ##
22
+
23
+ * No changes.
24
+
25
+
26
+ ## Rails 6.1.4.2 (December 14, 2021) ##
27
+
28
+ * No changes.
29
+
30
+
31
+ ## Rails 6.1.4.1 (August 19, 2021) ##
32
+
33
+ * No changes.
34
+
35
+
36
+ ## Rails 6.1.4 (June 24, 2021) ##
37
+
38
+ * MemCacheStore: convert any underlying value (including `false`) to an `Entry`.
39
+
40
+ See [#42559](https://github.com/rails/rails/pull/42559).
41
+
42
+ *Alex Ghiculescu*
43
+
44
+ * Fix bug in `number_with_precision` when using large `BigDecimal` values.
45
+
46
+ Fixes #42302.
47
+
48
+ *Federico Aldunate*, *Zachary Scott*
49
+
50
+ * Check byte size instead of length on `secure_compare`.
51
+
52
+ *Tietew*
53
+
54
+ * Fix `Time.at` to not lose `:in` option.
55
+
56
+ *Ryuta Kamizono*
57
+
58
+ * Require a path for `config.cache_store = :file_store`.
59
+
60
+ *Alex Ghiculescu*
61
+
62
+ * Avoid having to store complex object in the default translation file.
63
+
64
+ *Rafael Mendonça França*
65
+
66
+
1
67
  ## Rails 6.1.3.2 (May 05, 2021) ##
2
68
 
3
69
  * 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 = nil)
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) if entry && !entry.is_a?(Entry)
201
+ entry = Entry.new(entry, compress: false) unless entry.nil? || entry.is_a?(Entry)
202
202
  entry
203
203
  end
204
204
 
@@ -58,7 +58,13 @@ module ActiveSupport
58
58
  case store
59
59
  when Symbol
60
60
  options = parameters.extract_options!
61
- retrieve_store_class(store).new(*parameters, **options)
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
- YAML.load(render(context), **options) || {}
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, **kwargs)
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
@@ -63,18 +63,21 @@ module ActiveSupport
63
63
  # after the work has been performed.
64
64
  #
65
65
  # Where possible, prefer +wrap+.
66
- def self.run!
67
- if active?
68
- Null
66
+ def self.run!(reset: false)
67
+ if reset
68
+ lost_instance = active.delete(Thread.current)
69
+ lost_instance&.complete!
69
70
  else
70
- new.tap do |instance|
71
- success = nil
72
- begin
73
- instance.run!
74
- success = true
75
- ensure
76
- instance.complete! unless success
77
- end
71
+ return Null if active?
72
+ end
73
+
74
+ new.tap do |instance|
75
+ success = nil
76
+ begin
77
+ instance.run!
78
+ success = true
79
+ ensure
80
+ instance.complete! unless success
78
81
  end
79
82
  end
80
83
  end
@@ -103,11 +106,11 @@ module ActiveSupport
103
106
  self.active = Concurrent::Hash.new
104
107
 
105
108
  def self.active? # :nodoc:
106
- @active[Thread.current]
109
+ @active.key?(Thread.current)
107
110
  end
108
111
 
109
112
  def run! # :nodoc:
110
- self.class.active[Thread.current] = true
113
+ self.class.active[Thread.current] = self
111
114
  run_callbacks(:run)
112
115
  end
113
116
 
@@ -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
@@ -9,8 +9,8 @@ module ActiveSupport
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
- TINY = 3
13
- PRE = "2"
12
+ TINY = 4
13
+ PRE = "7"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -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: !ruby/sym default
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.nan? || rounded_number.infinite? || rounded_number == rounded_number.to_i
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
- a << "."
30
- a << b[0, precision]
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
 
@@ -58,7 +58,7 @@ module ActiveSupport
58
58
  prepare!
59
59
  end
60
60
 
61
- def self.run! # :nodoc:
61
+ def self.run!(reset: false) # :nodoc:
62
62
  if check!
63
63
  super
64
64
  else
@@ -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.length == b.length && fixed_length_secure_compare(a, b)
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.3.2
4
+ version: 6.1.4.7
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-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -357,10 +357,10 @@ 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.3.2/activesupport/CHANGELOG.md
361
- documentation_uri: https://api.rubyonrails.org/v6.1.3.2/
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/
362
362
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
363
- source_code_uri: https://github.com/rails/rails/tree/v6.1.3.2/activesupport
363
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.4.7/activesupport
364
364
  post_install_message:
365
365
  rdoc_options:
366
366
  - "--encoding"
@@ -378,7 +378,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
378
378
  - !ruby/object:Gem::Version
379
379
  version: '0'
380
380
  requirements: []
381
- rubygems_version: 3.1.2
381
+ rubygems_version: 3.1.6
382
382
  signing_key:
383
383
  specification_version: 4
384
384
  summary: A toolkit of support libraries and Ruby core extensions extracted from the