diff options
author | Noah Kantrowitz <noah@coderanger.net> | 2017-04-05 00:19:38 -0700 |
---|---|---|
committer | Noah Kantrowitz <noah@coderanger.net> | 2017-04-05 00:19:38 -0700 |
commit | 59510e9af8e80981aa9082349b43d798fc7312fb (patch) | |
tree | f57539bd5e9f824eb92ee62f13df32bec88fae8e /lib/chef/run_context/cookbook_compiler.rb | |
parent | a34a893c8dede944a70bc59d1bb500c3e54d69bf (diff) | |
download | chef-59510e9af8e80981aa9082349b43d798fc7312fb.tar.gz |
Feed the rubocop.
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
Diffstat (limited to 'lib/chef/run_context/cookbook_compiler.rb')
-rw-r--r-- | lib/chef/run_context/cookbook_compiler.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/run_context/cookbook_compiler.rb b/lib/chef/run_context/cookbook_compiler.rb index ed0a1ad9fe..ea5931ac75 100644 --- a/lib/chef/run_context/cookbook_compiler.rb +++ b/lib/chef/run_context/cookbook_compiler.rb @@ -166,7 +166,7 @@ class Chef def load_attributes_from_cookbook(cookbook_name) list_of_attr_files = files_in_cookbook_by_segment(cookbook_name, :attributes).dup - root_alias = cookbook_collection[cookbook_name].files_for(:root_files).find {|record| record[:name] == "attributes.rb" } + root_alias = cookbook_collection[cookbook_name].files_for(:root_files).find { |record| record[:name] == "attributes.rb" } default_file = list_of_attr_files.find { |path| File.basename(path) == "default.rb" } if root_alias if default_file @@ -268,9 +268,9 @@ class Chef ordered_cookbooks << cookbook end - def count_files_by_segment(segment, root_alias=nil) + def count_files_by_segment(segment, root_alias = nil) cookbook_collection.inject(0) do |count, cookbook_by_name| - count + cookbook_by_name[1].segment_filenames(segment).size + (root_alias ? cookbook_by_name[1].files_for(:root_files).select {|record| record[:name] == root_alias }.size : 0) + count + cookbook_by_name[1].segment_filenames(segment).size + (root_alias ? cookbook_by_name[1].files_for(:root_files).select { |record| record[:name] == root_alias }.size : 0) end end |