summaryrefslogtreecommitdiff
path: root/lib/chef/knife/deps.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-03 13:11:13 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-05 12:41:04 -0700
commit9802d7c075c8b7dae42dbcecd92d492f7fa128ac (patch)
tree0d13de92dc631081f9bcdaddedd6294051e3423b /lib/chef/knife/deps.rb
parent4978a9a8a402477f3b35f43404701d6a5cf26fa1 (diff)
downloadchef-9802d7c075c8b7dae42dbcecd92d492f7fa128ac.tar.gz
Style/NegatedIf
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/knife/deps.rb')
-rw-r--r--lib/chef/knife/deps.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/knife/deps.rb b/lib/chef/knife/deps.rb
index bc4b853879..021cf902d5 100644
--- a/lib/chef/knife/deps.rb
+++ b/lib/chef/knife/deps.rb
@@ -67,7 +67,7 @@ class Chef
end
def print_flattened_dependencies(entry, dependencies)
- if !dependencies[entry.path]
+ unless dependencies[entry.path]
dependencies[entry.path] = get_dependencies(entry)
dependencies[entry.path].each do |child|
child_entry = Chef::ChefFS::FileSystem.resolve_path(@root, child)
@@ -78,7 +78,7 @@ class Chef
end
def print_dependencies_tree(entry, dependencies, printed = {}, depth = 0)
- dependencies[entry.path] = get_dependencies(entry) if !dependencies[entry.path]
+ dependencies[entry.path] = get_dependencies(entry) unless dependencies[entry.path]
output "#{' ' * depth}#{format_path(entry)}"
if !printed[entry.path] && (config[:recurse] || depth == 0)
printed[entry.path] = true
@@ -109,13 +109,13 @@ class Chef
result = []
if role["run_list"]
dependencies_from_runlist(role["run_list"]).each do |dependency|
- result << dependency if !result.include?(dependency)
+ result << dependency unless result.include?(dependency)
end
end
if role["env_run_lists"]
role["env_run_lists"].each_pair do |env, run_list|
dependencies_from_runlist(run_list).each do |dependency|
- result << dependency if !result.include?(dependency)
+ result << dependency unless result.include?(dependency)
end
end
end