Module: ActiveSupport::RaiseWarnings
Do not use. This module is for internal use only.
Relationships & Source Files | |
Namespace Children | |
Exceptions:
| |
Defined in: | activesupport/lib/active_support/testing/strict_warnings.rb |
Constant Summary
-
ALLOWED_WARNINGS =
# File 'activesupport/lib/active_support/testing/strict_warnings.rb', line 11Regexp.union( /circular require considered harmful.*delayed_job/, # Bug in delayed job. # Expected non-verbose warning emitted by Rails. /Ignoring .*\.yml because it has expired/, /Failed to validate the schema cache because/, # Ref: https://bugs.ruby-lang.org/issues/15554 # This new Ruby 3.4 warning is still being fined tuned to reduce false positives /the block passed to/, )
-
PROJECT_ROOT =
# File 'activesupport/lib/active_support/testing/strict_warnings.rb', line 10File. ("../../../../", __dir__)
-
SUPPRESSED_WARNINGS =
# File 'activesupport/lib/active_support/testing/strict_warnings.rb', line 23Regexp.union( # TODO: remove if https://github.com/mikel/mail/pull/1557 or similar fix %r{/lib/mail/parsers/.*statement not reached}, %r{/lib/mail/parsers/.*assigned but unused variable - disp_type_s}, %r{/lib/mail/parsers/.*assigned but unused variable - testEof} )
Instance Method Summary
Instance Method Details
#warn(message)
# File 'activesupport/lib/active_support/testing/strict_warnings.rb', line 30
def warn(, ...) return if SUPPRESSED_WARNINGS.match?( ) super return unless .include?(PROJECT_ROOT) return if ALLOWED_WARNINGS.match?( ) return unless ENV["RAILS_STRICT_WARNINGS"] || ENV["BUILDKITE"] raise WarningError.new( ) end