Update comment re #nil? vs #blank?

This commit is contained in:
Carlo Cabrera 2024-09-02 16:02:35 +08:00
parent 654a58237e
commit c73d08c75b
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0
2 changed files with 2 additions and 2 deletions

View File

@ -2872,7 +2872,7 @@ class Formula
).void
}
def inreplace(paths, before = nil, after = nil, old_audit_result = nil, audit_result: true, &block)
# NOTE: must check for `#nil?` and not `#blank?`.
# NOTE: must check for `#nil?` and not `#blank?`, or else `old_audit_result = false` will not call `odeprecated`.
unless old_audit_result.nil?
# odeprecated "inreplace(paths, before, after, #{old_audit_result})",
# "inreplace(paths, before, after, audit_result: #{old_audit_result})"

View File

@ -37,7 +37,7 @@ class StringInreplaceExtension
).returns(T.nilable(String))
}
def gsub!(before, after, old_audit_result = nil, audit_result: true)
# NOTE: must check for `#nil?` and not `#blank?`.
# NOTE: must check for `#nil?` and not `#blank?`, or else `old_audit_result = false` will not call `odeprecated`.
unless old_audit_result.nil?
# odeprecated "gsub!(before, after, #{old_audit_result})",
# "gsub!(before, after, audit_result: #{old_audit_result})"