summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-11-08 17:32:34 -0800
committerTim Smith <tsmith84@gmail.com>2020-11-08 17:41:45 -0800
commit2d5aeee1c2eae4c46f7053b38560efc8d0b4a7b6 (patch)
tree113ab23df58a52925a8cd1db74f2f9b3cc6768ad
parentd6ffd5b44a04ff32e9049ed8c04bf4dad38e5b7e (diff)
downloadchef-2d5aeee1c2eae4c46f7053b38560efc8d0b4a7b6.tar.gz
Don't uses regexes in splits when we don't need tono_regex_in_split
We can do this with strings alone Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/knife/bootstrap.rb2
-rw-r--r--lib/chef/knife/config_show.rb2
-rw-r--r--lib/chef/provider/package/freebsd/pkgng.rb2
-rw-r--r--spec/unit/provider/mount/solaris_spec.rb2
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index efd969210b..8b598429d3 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -330,7 +330,7 @@ class Chef
long: "--bootstrap-vault-item VAULT_ITEM",
description: 'A single vault and item to update as "vault:item".',
proc: Proc.new { |i, accumulator|
- (vault, item) = i.split(/:/)
+ (vault, item) = i.split(":")
accumulator ||= {}
accumulator[vault] ||= []
accumulator[vault].push(item)
diff --git a/lib/chef/knife/config_show.rb b/lib/chef/knife/config_show.rb
index b8b55e11f6..7f28891885 100644
--- a/lib/chef/knife/config_show.rb
+++ b/lib/chef/knife/config_show.rb
@@ -79,7 +79,7 @@ class Chef
end
else
# It's a dotted path string.
- filter_parts = filter.split(/\./)
+ filter_parts = filter.split(".")
extract = lambda do |memo, filter_part|
memo.is_a?(Hash) ? memo[filter_part.to_sym] : nil
end
diff --git a/lib/chef/provider/package/freebsd/pkgng.rb b/lib/chef/provider/package/freebsd/pkgng.rb
index 48fc7a0dd5..87acb3a830 100644
--- a/lib/chef/provider/package/freebsd/pkgng.rb
+++ b/lib/chef/provider/package/freebsd/pkgng.rb
@@ -62,7 +62,7 @@ class Chef
end
pkg_query = shell_out!("pkg", "rquery", options, "%v", new_resource.package_name, env: nil)
- pkg_query.exitstatus == 0 ? pkg_query.stdout.strip.split(/\n/).last : nil
+ pkg_query.exitstatus == 0 ? pkg_query.stdout.strip.split('\n').last : nil
end
def repo_regex
diff --git a/spec/unit/provider/mount/solaris_spec.rb b/spec/unit/provider/mount/solaris_spec.rb
index cbe5f13e48..4ca22b4b78 100644
--- a/spec/unit/provider/mount/solaris_spec.rb
+++ b/spec/unit/provider/mount/solaris_spec.rb
@@ -544,7 +544,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
it "should mount the filesystem with options if options were passed" do
options = "logging,noatime,largefiles,nosuid,rw,quota"
- new_resource.options(options.split(/,/))
+ new_resource.options(options.split(","))
expect(provider).to receive(:shell_out_compacted!).with("mount", "-F", fstype, "-o", options, device, mountpoint)
provider.mount_fs
end