activesupport 6.0.2.1 → 6.0.3.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.

Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -0
  3. data/README.rdoc +1 -1
  4. data/lib/active_support/backtrace_cleaner.rb +0 -1
  5. data/lib/active_support/cache.rb +29 -28
  6. data/lib/active_support/cache/file_store.rb +7 -8
  7. data/lib/active_support/cache/mem_cache_store.rb +9 -19
  8. data/lib/active_support/cache/memory_store.rb +6 -7
  9. data/lib/active_support/cache/null_store.rb +3 -3
  10. data/lib/active_support/cache/redis_cache_store.rb +22 -17
  11. data/lib/active_support/cache/strategy/local_cache.rb +23 -23
  12. data/lib/active_support/callbacks.rb +0 -3
  13. data/lib/active_support/concurrency/load_interlock_aware_monitor.rb +18 -0
  14. data/lib/active_support/concurrency/share_lock.rb +0 -1
  15. data/lib/active_support/core_ext/array/conversions.rb +5 -5
  16. data/lib/active_support/core_ext/date_and_time/zones.rb +0 -1
  17. data/lib/active_support/core_ext/date_time/conversions.rb +0 -1
  18. data/lib/active_support/core_ext/hash/conversions.rb +1 -1
  19. data/lib/active_support/core_ext/module/delegation.rb +8 -1
  20. data/lib/active_support/core_ext/module/introspection.rb +1 -0
  21. data/lib/active_support/core_ext/object/try.rb +2 -0
  22. data/lib/active_support/core_ext/range/each.rb +0 -1
  23. data/lib/active_support/core_ext/string/output_safety.rb +0 -1
  24. data/lib/active_support/dependencies.rb +0 -2
  25. data/lib/active_support/dependencies/zeitwerk_integration.rb +0 -1
  26. data/lib/active_support/deprecation/method_wrappers.rb +12 -6
  27. data/lib/active_support/deprecation/proxy_wrappers.rb +5 -1
  28. data/lib/active_support/descendants_tracker.rb +0 -1
  29. data/lib/active_support/duration.rb +13 -11
  30. data/lib/active_support/duration/iso8601_parser.rb +0 -1
  31. data/lib/active_support/duration/iso8601_serializer.rb +0 -1
  32. data/lib/active_support/encrypted_file.rb +1 -1
  33. data/lib/active_support/evented_file_update_checker.rb +0 -1
  34. data/lib/active_support/file_update_checker.rb +0 -1
  35. data/lib/active_support/gem_version.rb +2 -2
  36. data/lib/active_support/inflector/inflections.rb +0 -1
  37. data/lib/active_support/inflector/methods.rb +1 -2
  38. data/lib/active_support/json/decoding.rb +0 -1
  39. data/lib/active_support/lazy_load_hooks.rb +0 -1
  40. data/lib/active_support/locale/en.rb +4 -2
  41. data/lib/active_support/log_subscriber.rb +0 -1
  42. data/lib/active_support/logger.rb +1 -1
  43. data/lib/active_support/message_encryptor.rb +1 -1
  44. data/lib/active_support/message_verifier.rb +2 -2
  45. data/lib/active_support/messages/metadata.rb +3 -2
  46. data/lib/active_support/messages/rotator.rb +4 -4
  47. data/lib/active_support/multibyte/chars.rb +1 -2
  48. data/lib/active_support/multibyte/unicode.rb +0 -1
  49. data/lib/active_support/notifications/instrumenter.rb +0 -1
  50. data/lib/active_support/number_helper.rb +4 -0
  51. data/lib/active_support/number_helper/number_converter.rb +4 -5
  52. data/lib/active_support/number_helper/number_to_currency_converter.rb +7 -8
  53. data/lib/active_support/number_helper/number_to_delimited_converter.rb +0 -1
  54. data/lib/active_support/number_helper/number_to_human_converter.rb +0 -1
  55. data/lib/active_support/number_helper/number_to_human_size_converter.rb +0 -1
  56. data/lib/active_support/number_helper/number_to_phone_converter.rb +0 -1
  57. data/lib/active_support/number_helper/number_to_rounded_converter.rb +0 -1
  58. data/lib/active_support/option_merger.rb +21 -3
  59. data/lib/active_support/ordered_options.rb +4 -0
  60. data/lib/active_support/parameter_filter.rb +1 -2
  61. data/lib/active_support/string_inquirer.rb +0 -1
  62. data/lib/active_support/testing/parallelization.rb +8 -2
  63. data/lib/active_support/testing/stream.rb +0 -1
  64. data/lib/active_support/testing/time_helpers.rb +0 -2
  65. data/lib/active_support/xml_mini.rb +0 -1
  66. data/lib/active_support/xml_mini/jdom.rb +0 -1
  67. metadata +16 -10
@@ -38,7 +38,6 @@ module ActiveSupport
38
38
  end
39
39
 
40
40
  private
41
-
42
41
  def strip_insignificant_zeros
43
42
  options[:strip_insignificant_zeros]
44
43
  end
@@ -5,7 +5,7 @@ require "active_support/core_ext/hash/deep_merge"
5
5
  module ActiveSupport
6
6
  class OptionMerger #:nodoc:
7
7
  instance_methods.each do |method|
8
- undef_method(method) if method !~ /^(__|instance_eval|class|object_id)/
8
+ undef_method(method) if !/^(__|instance_eval|class|object_id)/.match?(method)
9
9
  end
10
10
 
11
11
  def initialize(context, options)
@@ -14,14 +14,32 @@ module ActiveSupport
14
14
 
15
15
  private
16
16
  def method_missing(method, *arguments, &block)
17
+ options = nil
17
18
  if arguments.first.is_a?(Proc)
18
19
  proc = arguments.pop
19
20
  arguments << lambda { |*args| @options.deep_merge(proc.call(*args)) }
21
+ elsif arguments.last.respond_to?(:to_hash)
22
+ options = @options.deep_merge(arguments.pop)
20
23
  else
21
- arguments << (arguments.last.respond_to?(:to_hash) ? @options.deep_merge(arguments.pop) : @options.dup)
24
+ options = @options
22
25
  end
23
26
 
24
- @context.__send__(method, *arguments, &block)
27
+ invoke_method(method, arguments, options, &block)
28
+ end
29
+
30
+ if RUBY_VERSION >= "2.7"
31
+ def invoke_method(method, arguments, options, &block)
32
+ if options
33
+ @context.__send__(method, *arguments, **options, &block)
34
+ else
35
+ @context.__send__(method, *arguments, &block)
36
+ end
37
+ end
38
+ else
39
+ def invoke_method(method, arguments, options, &block)
40
+ arguments << options if options
41
+ @context.__send__(method, *arguments, &block)
42
+ end
25
43
  end
26
44
  end
27
45
  end
@@ -56,6 +56,10 @@ module ActiveSupport
56
56
  def respond_to_missing?(name, include_private)
57
57
  true
58
58
  end
59
+
60
+ def extractable_options?
61
+ true
62
+ end
59
63
  end
60
64
 
61
65
  # +InheritableOptions+ provides a constructor to build an +OrderedOptions+
@@ -51,7 +51,6 @@ module ActiveSupport
51
51
  end
52
52
 
53
53
  private
54
-
55
54
  def compiled_filter
56
55
  @compiled_filter ||= CompiledFilter.compile(@filters, mask: @mask)
57
56
  end
@@ -103,7 +102,7 @@ module ActiveSupport
103
102
 
104
103
  def value_for_key(key, value, parents = [], original_params = nil)
105
104
  parents.push(key) if deep_regexps
106
- if regexps.any? { |r| r.match?(key) }
105
+ if regexps.any? { |r| r.match?(key.to_s) }
107
106
  value = @mask
108
107
  elsif deep_regexps && (joined = parents.join(".")) && deep_regexps.any? { |r| r.match?(joined) }
109
108
  value = @mask
@@ -18,7 +18,6 @@ module ActiveSupport
18
18
  # vehicle.bike? # => false
19
19
  class StringInquirer < String
20
20
  private
21
-
22
21
  def respond_to_missing?(method_name, include_private = false)
23
22
  (method_name[-1] == "?") || super
24
23
  end
@@ -94,8 +94,14 @@ module ActiveSupport
94
94
  begin
95
95
  queue.record(reporter, result)
96
96
  rescue DRb::DRbConnError
97
- result.failures.each do |failure|
98
- failure.exception = DRb::DRbRemoteError.new(failure.exception)
97
+ result.failures.map! do |failure|
98
+ if failure.respond_to?(:error)
99
+ # minitest >5.14.0
100
+ error = DRb::DRbRemoteError.new(failure.error)
101
+ else
102
+ error = DRb::DRbRemoteError.new(failure.exception)
103
+ end
104
+ Minitest::UnexpectedError.new(error)
99
105
  end
100
106
  queue.record(reporter, result)
101
107
  end
@@ -4,7 +4,6 @@ module ActiveSupport
4
4
  module Testing
5
5
  module Stream #:nodoc:
6
6
  private
7
-
8
7
  def silence_stream(stream)
9
8
  old_stream = stream.dup
10
9
  stream.reopen(IO::NULL)
@@ -40,7 +40,6 @@ module ActiveSupport
40
40
  end
41
41
 
42
42
  private
43
-
44
43
  def unstub_object(stub)
45
44
  singleton_class = stub.object.singleton_class
46
45
  singleton_class.silence_redefinition_of_method stub.method_name
@@ -191,7 +190,6 @@ module ActiveSupport
191
190
  end
192
191
 
193
192
  private
194
-
195
193
  def simple_stubs
196
194
  @simple_stubs ||= SimpleStubs.new
197
195
  end
@@ -155,7 +155,6 @@ module ActiveSupport
155
155
  end
156
156
 
157
157
  private
158
-
159
158
  def _dasherize(key)
160
159
  # $2 must be a non-greedy regex for this to work
161
160
  left, middle, right = /\A(_*)(.*?)(_*)\Z/.match(key.strip)[1, 3]
@@ -53,7 +53,6 @@ module ActiveSupport
53
53
  end
54
54
 
55
55
  private
56
-
57
56
  # Convert an XML element and merge into the hash
58
57
  #
59
58
  # hash::
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.0.2.1
4
+ version: 6.0.3.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: 2019-12-18 00:00:00.000000000 Z
11
+ date: 2020-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -85,6 +85,9 @@ dependencies:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
87
  version: '2.2'
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 2.2.2
88
91
  type: :runtime
89
92
  prerelease: false
90
93
  version_requirements: !ruby/object:Gem::Requirement
@@ -92,6 +95,9 @@ dependencies:
92
95
  - - "~>"
93
96
  - !ruby/object:Gem::Version
94
97
  version: '2.2'
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 2.2.2
95
101
  description: A toolkit of support libraries and Ruby core extensions extracted from
96
102
  the Rails framework. Rich support for multibyte strings, internationalization, time
97
103
  zones, and testing.
@@ -353,11 +359,11 @@ licenses:
353
359
  - MIT
354
360
  metadata:
355
361
  bug_tracker_uri: https://github.com/rails/rails/issues
356
- changelog_uri: https://github.com/rails/rails/blob/v6.0.2.1/activesupport/CHANGELOG.md
357
- documentation_uri: https://api.rubyonrails.org/v6.0.2.1/
358
- mailing_list_uri: https://groups.google.com/forum/#!forum/rubyonrails-talk
359
- source_code_uri: https://github.com/rails/rails/tree/v6.0.2.1/activesupport
360
- post_install_message:
362
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.3.2/activesupport/CHANGELOG.md
363
+ documentation_uri: https://api.rubyonrails.org/v6.0.3.2/
364
+ mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
365
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.3.2/activesupport
366
+ post_install_message:
361
367
  rdoc_options:
362
368
  - "--encoding"
363
369
  - UTF-8
@@ -374,8 +380,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
374
380
  - !ruby/object:Gem::Version
375
381
  version: '0'
376
382
  requirements: []
377
- rubygems_version: 3.0.3
378
- signing_key:
383
+ rubygems_version: 3.1.2
384
+ signing_key:
379
385
  specification_version: 4
380
386
  summary: A toolkit of support libraries and Ruby core extensions extracted from the
381
387
  Rails framework.