summaryrefslogtreecommitdiff
path: root/lib
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 /lib
parentd6ffd5b44a04ff32e9049ed8c04bf4dad38e5b7e (diff)
downloadchef-no_regex_in_split.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>
Diffstat (limited to 'lib')
-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
3 files changed, 3 insertions, 3 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