summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-08-03 17:01:25 -0700
committerGitHub <noreply@github.com>2020-08-03 17:01:25 -0700
commit9e4d46d23742ad3f1a74bc451fe2608acb150c82 (patch)
tree12a159d19918a0415de0e1d740ca16603ee6b9d7
parent8ec9c8707a3c45654e660c93aa713e6254e43492 (diff)
parent351ac5bc8157cb5cf2d953b9dc118bb7db57fb72 (diff)
downloadchef-9e4d46d23742ad3f1a74bc451fe2608acb150c82.tar.gz
Merge pull request #10251 from chef/rubocop_Performance_StringReplacement
Use tr not gsub for string replacement
-rw-r--r--lib/chef/resource/windows_share.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource/windows_share.rb b/lib/chef/resource/windows_share.rb
index 10533382f9..390d97a6c2 100644
--- a/lib/chef/resource/windows_share.rb
+++ b/lib/chef/resource/windows_share.rb
@@ -59,7 +59,7 @@ class Chef
# Specifies the path of the location of the folder to share. The path must be fully qualified. Relative paths or paths that contain wildcard characters are not permitted.
property :path, String,
description: "The path of the folder to share. Required when creating. If the share already exists on a different path then it is deleted and re-created.",
- coerce: proc { |p| p.gsub(%r{/}, "\\") || p }
+ coerce: proc { |p| p.tr('/', "\\") || p }
# Specifies an optional description of the SMB share. A description of the share is displayed by running the Get-SmbShare cmdlet. The description may not contain more than 256 characters.
property :description, String,