summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook_loader.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-03-14 11:53:05 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-03-14 11:53:05 -0700
commitc031a6182bef7f689b2d80f418ae1b80669168a3 (patch)
tree627f24bc48fd352dd82a1588a514349c5924d9eb /lib/chef/cookbook_loader.rb
parent365064280c93d519fdacbf032c0c21057e5549c9 (diff)
downloadchef-c031a6182bef7f689b2d80f418ae1b80669168a3.tar.gz
fix some UselessAssignment caseslcg/useless-assignment
Diffstat (limited to 'lib/chef/cookbook_loader.rb')
-rw-r--r--lib/chef/cookbook_loader.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/cookbook_loader.rb b/lib/chef/cookbook_loader.rb
index 72c878618e..bff77fa13b 100644
--- a/lib/chef/cookbook_loader.rb
+++ b/lib/chef/cookbook_loader.rb
@@ -47,7 +47,7 @@ class Chef
@cookbooks_paths = Hash.new { |h, k| h[k] = [] } # for deprecation warnings
@chefignores = {}
@repo_paths = repo_paths.map do |repo_path|
- repo_path = File.expand_path(repo_path)
+ File.expand_path(repo_path)
end
@preloaded_cookbooks = false
@@ -121,7 +121,7 @@ class Chef
end
def [](cookbook)
- if @cookbooks_by_name.has_key?(cookbook.to_sym) or load_cookbook(cookbook.to_sym)
+ if @cookbooks_by_name.has_key?(cookbook.to_sym) || load_cookbook(cookbook.to_sym)
@cookbooks_by_name[cookbook.to_sym]
else
raise Exceptions::CookbookNotFoundInRepo, "Cannot find a cookbook named #{cookbook}; did you forget to add metadata to a cookbook? (https://docs.chef.io/config_rb_metadata.html)"
@@ -179,7 +179,7 @@ class Chef
@all_files_in_repo_paths ||=
begin
@repo_paths.inject([]) do |all_children, repo_path|
- all_children += Dir[File.join(Chef::Util::PathHelper.escape_glob_dir(repo_path), "*")]
+ all_children + Dir[File.join(Chef::Util::PathHelper.escape_glob_dir(repo_path), "*")]
end
end
end