Daniel Leidert <dleid...@debian.org> writes: > Package: src:ruby-puppet-syntax > Followup-For: Bug #952022 > > The formentioned issue can probably be closed by applying this patch: > > --- a/lib/rspec-puppet/support.rb > +++ b/lib/rspec-puppet/support.rb > @@ -440,7 +440,7 @@ > end > > def escape_special_chars(string) > - string.gsub!(/\$/, "\\$") > + string.gsub(/\$/, "\\$") > string > end > > But then there are new errors (see below). I'll stop here and leave > this to someone more experienced. So if anyone wants to go on, please > feel free to do so. > > Regards, Daniel
I think that change turns the subroutine into a noop. string.gsub(pattern,replacement) returns the changed string, and does not change the original object. The output in this instance is discarded. string.gsub!(pattern,replacement) modifies the object. The subroutine then returns the original or changed string. See https://ruby-doc.org/core-2.7.0/String.html -- Stig Sandbeck Mathisen Debian Developer
signature.asc
Description: PGP signature