summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-03 16:17:11 -0700
committerTim Smith <tsmith84@gmail.com>2020-08-03 16:17:11 -0700
commit351ac5bc8157cb5cf2d953b9dc118bb7db57fb72 (patch)
tree54885953a62a25700c70c780532b245446e8932d
parentc202ce4e318a6bc842158970aeb6b3d13fa6a0df (diff)
downloadchef-351ac5bc8157cb5cf2d953b9dc118bb7db57fb72.tar.gz
Use tr not gsub for string replacement
This is faster when you don't need a regex Signed-off-by: Tim Smith <tsmith@chef.io>
-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,