[DRE-maint] Bug#952022: ruby-puppet-syntax: FTBFS: ERROR: Test "ruby2.7" failed: LoadError:

Stig Sandbeck Mathisen ssm at debian.org
Mon Mar 23 17:13:36 GMT 2020


Daniel Leidert <dleidert at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-ruby-extras-maintainers/attachments/20200323/5a7f1436/attachment.sig>


More information about the Pkg-ruby-extras-maintainers mailing list