From 40bd57a46b593bf11a29205047e4ce0d99c66890 Mon Sep 17 00:00:00 2001 From: Michael Hashizume Date: Wed, 28 Jun 2023 09:48:17 -0700 Subject: [PATCH] (maint) Fix RedundantRegexpAgrument cop This commit addresses issues identified by the RuboCop Style/RedundantRegexpArgument cop and changes two instances of String.sub to use 'C:' instead of /C:/. --- configs/components/puppet-runtime.rb | 2 +- configs/components/pxp-agent.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/components/puppet-runtime.rb b/configs/components/puppet-runtime.rb index 36fff127c2..1d544d86a9 100644 --- a/configs/components/puppet-runtime.rb +++ b/configs/components/puppet-runtime.rb @@ -49,7 +49,7 @@ # so cmd.exe was not working as expected. install_command = [ "gunzip -c #{tarball_name} | tar -k -C /cygdrive/c/ -xf -", - "chmod 755 #{settings[:bindir].sub(/C:/, '/cygdrive/c')}/*" + "chmod 755 #{settings[:bindir].sub('C:', '/cygdrive/c')}/*" ] elsif platform.is_macos? # We can't untar into '/' because of SIP on macOS; Just copy the contents diff --git a/configs/components/pxp-agent.rb b/configs/components/pxp-agent.rb index 6a77b9cdb6..5494ccc41a 100644 --- a/configs/components/pxp-agent.rb +++ b/configs/components/pxp-agent.rb @@ -18,7 +18,7 @@ # so cmd.exe was not working as expected. install_command = [ "gunzip -c #{tarball_name} | tar --skip-old-files -C /cygdrive/c/ -xf -", - "chmod 755 #{settings[:bindir].sub(/C:/, '/cygdrive/c')}/*" + "chmod 755 #{settings[:bindir].sub('C:', '/cygdrive/c')}/*" ] elsif platform.is_macos? # We can't untar into '/' because of SIP on macOS; Just copy the contents