diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-05 15:00:00 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-05 15:00:00 -0800 |
commit | 686113531d23f30e9973d659c456ae33eb9cff1f (patch) | |
tree | f225de7251a8b49b8d183dd168bab0a0addbe23f /lib/chef/run_list/run_list_expansion.rb | |
parent | d1cf34b059a16a81e0fc48de52ba29863bb41fe6 (diff) | |
download | chef-686113531d23f30e9973d659c456ae33eb9cff1f.tar.gz |
autofixing whitespace cops
4174 Style/SpaceInsideHashLiteralBraces
1860 Style/SpaceAroundOperators
1336 Style/SpaceInsideBlockBraces
1292 Style/AlignHash
997 Style/SpaceAfterComma
860 Style/SpaceAroundEqualsInParameterDefault
310 Style/EmptyLines
294 Style/IndentationConsistency
267 Style/TrailingWhitespace
238 Style/ExtraSpacing
212 Style/SpaceBeforeBlockBraces
166 Style/MultilineOperationIndentation
144 Style/TrailingBlankLines
120 Style/EmptyLineBetweenDefs
101 Style/IndentationWidth
82 Style/SpaceAroundBlockParameters
40 Style/EmptyLinesAroundMethodBody
29 Style/EmptyLinesAroundAccessModifier
1 Style/RescueEnsureAlignment
Diffstat (limited to 'lib/chef/run_list/run_list_expansion.rb')
-rw-r--r-- | lib/chef/run_list/run_list_expansion.rb | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/lib/chef/run_list/run_list_expansion.rb b/lib/chef/run_list/run_list_expansion.rb index bac748096d..b895b53523 100644 --- a/lib/chef/run_list/run_list_expansion.rb +++ b/lib/chef/run_list/run_list_expansion.rb @@ -62,7 +62,7 @@ class Chef attr_reader :all_missing_roles attr_reader :role_errors - def initialize(environment, run_list_items, source=nil) + def initialize(environment, run_list_items, source = nil) @environment = environment @missing_roles_with_including_role = Array.new @@ -75,8 +75,8 @@ class Chef @recipes = Chef::RunList::VersionedRecipeList.new @applied_roles = {} - @run_list_trace = Hash.new {|h, key| h[key] = [] } - @better_run_list_trace = Hash.new {|h, key| h[key] = [] } + @run_list_trace = Hash.new { |h, key| h[key] = [] } + @better_run_list_trace = Hash.new { |h, key| h[key] = [] } @all_missing_roles = {} @role_errors = {} end @@ -140,7 +140,7 @@ class Chef end def errors - @missing_roles_with_including_role.map {|item| item.first } + @missing_roles_with_including_role.map { |item| item.first } end def to_json(*a) @@ -148,8 +148,8 @@ class Chef end def to_hash - seen_items = {:recipe => {}, :role => {}} - {:id => @environment, :run_list => convert_run_list_trace("top level", seen_items)} + seen_items = { :recipe => {}, :role => {} } + { :id => @environment, :run_list => convert_run_list_trace("top level", seen_items) } end private @@ -160,11 +160,10 @@ class Chef @applied_roles[role_name] = true end - def expand_run_list_items(items, included_by="top level") - + def expand_run_list_items(items, included_by = "top level") if entry = items.shift @run_list_trace[included_by.to_s] << entry.to_s - @better_run_list_trace[included_by.to_s] << entry + @better_run_list_trace[included_by.to_s] << entry case entry.type when :recipe @@ -186,19 +185,18 @@ class Chef seen_items[item.type][item.name] = true case item.type when :recipe - {:type => "recipe", :name => item.name, :version => item.version, :skipped => !!skipped} + { :type => "recipe", :name => item.name, :version => item.version, :skipped => !!skipped } when :role error = @role_errors[item.name] missing = @all_missing_roles[item.name] - {:type => :role, :name => item.name, :children => (missing || error || skipped) ? [] : convert_run_list_trace(item.to_s, seen_items), - :missing => missing, :error => error, :skipped => skipped} + { :type => :role, :name => item.name, :children => (missing || error || skipped) ? [] : convert_run_list_trace(item.to_s, seen_items), + :missing => missing, :error => error, :skipped => skipped } end end end end - # Expand a run list from disk. Suitable for chef-solo class RunListExpansionFromDisk < RunListExpansion @@ -234,5 +232,3 @@ class Chef end end - - |