Fix inreplace sig
Implicit Pathname strings strike again
This commit is contained in:
parent
5226cd4344
commit
11a9086b89
@ -2472,6 +2472,14 @@ class Formula
|
|||||||
#
|
#
|
||||||
# @see Utils::Inreplace.inreplace
|
# @see Utils::Inreplace.inreplace
|
||||||
# @api public
|
# @api public
|
||||||
|
sig {
|
||||||
|
params(
|
||||||
|
paths: T.any(T::Array[T.untyped], String, Pathname),
|
||||||
|
before: T.nilable(T.any(Regexp, String)),
|
||||||
|
after: T.nilable(T.any(Pathname, String, Symbol)),
|
||||||
|
audit_result: T::Boolean,
|
||||||
|
).void
|
||||||
|
}
|
||||||
def inreplace(paths, before = nil, after = nil, audit_result = true) # rubocop:disable Style/OptionalBooleanParameter
|
def inreplace(paths, before = nil, after = nil, audit_result = true) # rubocop:disable Style/OptionalBooleanParameter
|
||||||
super(paths, before, after, audit_result)
|
super(paths, before, after, audit_result)
|
||||||
rescue Utils::Inreplace::Error => e
|
rescue Utils::Inreplace::Error => e
|
||||||
|
@ -41,12 +41,12 @@ module Utils
|
|||||||
params(
|
params(
|
||||||
paths: T.any(T::Array[T.untyped], String, Pathname),
|
paths: T.any(T::Array[T.untyped], String, Pathname),
|
||||||
before: T.nilable(T.any(Regexp, String)),
|
before: T.nilable(T.any(Regexp, String)),
|
||||||
after: T.nilable(T.any(String, Symbol)),
|
after: T.nilable(T.any(Pathname, String, Symbol)),
|
||||||
audit_result: T::Boolean,
|
audit_result: T::Boolean,
|
||||||
).void
|
).void
|
||||||
}
|
}
|
||||||
def inreplace(paths, before = nil, after = nil, audit_result = true) # rubocop:disable Style/OptionalBooleanParameter
|
def inreplace(paths, before = nil, after = nil, audit_result = true) # rubocop:disable Style/OptionalBooleanParameter
|
||||||
after = after.to_s if after.is_a? Symbol
|
after &&= after.to_s
|
||||||
|
|
||||||
errors = {}
|
errors = {}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user