activesupport 7.1.1 → 7.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +104 -0
  3. data/lib/active_support/broadcast_logger.rb +8 -0
  4. data/lib/active_support/cache/entry.rb +7 -1
  5. data/lib/active_support/cache/file_store.rb +1 -1
  6. data/lib/active_support/cache/mem_cache_store.rb +16 -8
  7. data/lib/active_support/cache/memory_store.rb +4 -4
  8. data/lib/active_support/cache/redis_cache_store.rb +21 -14
  9. data/lib/active_support/cache/strategy/local_cache.rb +9 -6
  10. data/lib/active_support/cache.rb +34 -7
  11. data/lib/active_support/core_ext/date/conversions.rb +1 -1
  12. data/lib/active_support/core_ext/module/concerning.rb +6 -6
  13. data/lib/active_support/core_ext/object/with_options.rb +1 -1
  14. data/lib/active_support/core_ext/string/indent.rb +1 -1
  15. data/lib/active_support/deprecation/behaviors.rb +18 -16
  16. data/lib/active_support/deprecation/reporting.rb +7 -4
  17. data/lib/active_support/gem_version.rb +1 -1
  18. data/lib/active_support/inflector/methods.rb +2 -2
  19. data/lib/active_support/json/encoding.rb +1 -1
  20. data/lib/active_support/log_subscriber.rb +8 -2
  21. data/lib/active_support/messages/metadata.rb +1 -1
  22. data/lib/active_support/notifications/fanout.rb +25 -19
  23. data/lib/active_support/number_helper/number_to_human_size_converter.rb +2 -2
  24. data/lib/active_support/number_helper.rb +379 -318
  25. data/lib/active_support/ordered_options.rb +2 -2
  26. data/lib/active_support/syntax_error_proxy.rb +22 -1
  27. data/lib/active_support/testing/assertions.rb +1 -1
  28. data/lib/active_support/testing/strict_warnings.rb +1 -0
  29. data/lib/active_support/testing/time_helpers.rb +5 -1
  30. metadata +5 -5
@@ -42,8 +42,8 @@ module ActiveSupport
42
42
  super(key.to_sym)
43
43
  end
44
44
 
45
- def dig(*keys)
46
- super(*keys.flatten.map(&:to_sym))
45
+ def dig(key, *identifiers)
46
+ super(key.to_sym, *identifiers)
47
47
  end
48
48
 
49
49
  def method_missing(name, *args)
@@ -32,6 +32,8 @@ module ActiveSupport
32
32
  end
33
33
 
34
34
  def backtrace_locations
35
+ return nil if super.nil?
36
+
35
37
  parse_message_for_trace.map { |trace|
36
38
  file, line = trace.match(/^(.+?):(\d+).*$/, &:captures) || trace
37
39
  BacktraceLocation.new(file, line.to_i, trace)
@@ -43,7 +45,26 @@ module ActiveSupport
43
45
 
44
46
  private
45
47
  def parse_message_for_trace
46
- __getobj__.to_s.split("\n")
48
+ if source_location_eval?
49
+ # If the exception is coming from a call to eval, we need to keep
50
+ # the path of the file in which eval was called to ensure we can
51
+ # return the right source fragment to show the location of the
52
+ # error
53
+ location = __getobj__.backtrace_locations[0]
54
+ ["#{location.path}:#{location.lineno}: #{__getobj__}"]
55
+ else
56
+ __getobj__.to_s.split("\n")
57
+ end
58
+ end
59
+
60
+ if SyntaxError.method_defined?(:path) # Ruby 3.3+
61
+ def source_location_eval?
62
+ __getobj__.path.start_with?("(eval")
63
+ end
64
+ else # 3.2 and older versions of Ruby
65
+ def source_location_eval?
66
+ __getobj__.to_s.start_with?("(eval")
67
+ end
47
68
  end
48
69
  end
49
70
  end
@@ -223,7 +223,7 @@ module ActiveSupport
223
223
  # post :create, params: { status: { ok: true } }
224
224
  # end
225
225
  #
226
- # Provide the optional keyword argument :from to specify the expected
226
+ # Provide the optional keyword argument +:from+ to specify the expected
227
227
  # initial value.
228
228
  #
229
229
  # assert_no_changes -> { Status.all_good? }, from: true do
@@ -17,6 +17,7 @@ module ActiveSupport
17
17
  SUPPRESSED_WARNINGS = Regexp.union(
18
18
  # TODO: remove if https://github.com/mikel/mail/pull/1557 or similar fix
19
19
  %r{/lib/mail/parsers/.*statement not reached},
20
+ %r{/lib/mail/parsers/.*assigned but unused variable - disp_type_s},
20
21
  %r{/lib/mail/parsers/.*assigned but unused variable - testEof}
21
22
  )
22
23
 
@@ -25,7 +25,7 @@ module ActiveSupport
25
25
  unstub_object(stub)
26
26
  end
27
27
 
28
- new_name = "__simple_stub__#{method_name}"
28
+ new_name = "__simple_stub__#{method_name}__#{object_id}"
29
29
 
30
30
  @stubs[object.object_id][method_name] = Stub.new(object, method_name, new_name)
31
31
 
@@ -169,6 +169,10 @@ module ActiveSupport
169
169
  now = date_or_time.to_time.change(usec: 0)
170
170
  end
171
171
 
172
+ # +now+ must be in local system timezone, because +Time.at(now)+
173
+ # and +now.to_date+ (see stubs below) will use +now+'s timezone too!
174
+ now = now.getlocal
175
+
172
176
  stubs = simple_stubs
173
177
  stubbed_time = Time.now if stubs.stubbing(Time, :now)
174
178
  stubs.stub_object(Time, :now) { at(now) }
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: 7.1.1
4
+ version: 7.1.3
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: 2023-10-11 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -446,10 +446,10 @@ licenses:
446
446
  - MIT
447
447
  metadata:
448
448
  bug_tracker_uri: https://github.com/rails/rails/issues
449
- changelog_uri: https://github.com/rails/rails/blob/v7.1.1/activesupport/CHANGELOG.md
450
- documentation_uri: https://api.rubyonrails.org/v7.1.1/
449
+ changelog_uri: https://github.com/rails/rails/blob/v7.1.3/activesupport/CHANGELOG.md
450
+ documentation_uri: https://api.rubyonrails.org/v7.1.3/
451
451
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
452
- source_code_uri: https://github.com/rails/rails/tree/v7.1.1/activesupport
452
+ source_code_uri: https://github.com/rails/rails/tree/v7.1.3/activesupport
453
453
  rubygems_mfa_required: 'true'
454
454
  post_install_message:
455
455
  rdoc_options: