Merge pull request #9079 from jonchang/inreplace-typecheck

inreplace: fix typecheck error
This commit is contained in:
Jonathan Chang 2020-11-09 00:07:00 +11:00 committed by GitHub
commit fd47fd8fb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,7 @@ class StringInreplaceExtension
# value with "new_value", or removes the definition entirely.
#
# @api public
sig { params(flag: String, new_value: String).void }
sig { params(flag: String, new_value: T.any(String, Pathname)).void }
def change_make_var!(flag, new_value)
return if gsub!(/^#{Regexp.escape(flag)}[ \t]*[\\?+:!]?=[ \t]*((?:.*\\\n)*.*)$/, "#{flag}=#{new_value}", false)