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/deprecation | |
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/deprecation')
-rw-r--r-- | lib/chef/deprecation/provider/cookbook_file.rb | 1 | ||||
-rw-r--r-- | lib/chef/deprecation/provider/file.rb | 12 | ||||
-rw-r--r-- | lib/chef/deprecation/provider/remote_directory.rb | 2 | ||||
-rw-r--r-- | lib/chef/deprecation/provider/remote_file.rb | 2 |
4 files changed, 8 insertions, 9 deletions
diff --git a/lib/chef/deprecation/provider/cookbook_file.rb b/lib/chef/deprecation/provider/cookbook_file.rb index 166368df5a..d6e8a7566e 100644 --- a/lib/chef/deprecation/provider/cookbook_file.rb +++ b/lib/chef/deprecation/provider/cookbook_file.rb @@ -16,7 +16,6 @@ # limitations under the License. # - class Chef module Deprecation module Provider diff --git a/lib/chef/deprecation/provider/file.rb b/lib/chef/deprecation/provider/file.rb index f788513b50..4db9101d8d 100644 --- a/lib/chef/deprecation/provider/file.rb +++ b/lib/chef/deprecation/provider/file.rb @@ -52,13 +52,13 @@ class Chef suppress_resource_reporting = false return [ "(diff output suppressed by config)" ] if Chef::Config[:diff_disabled] - return [ "(no temp file with new content, diff output suppressed)" ] unless ::File.exists?(temp_path) # should never happen? + return [ "(no temp file with new content, diff output suppressed)" ] unless ::File.exists?(temp_path) # should never happen? # solaris does not support diff -N, so create tempfile to diff against if we are creating a new file target_path = if ::File.exists?(@current_resource.path) @current_resource.path else - suppress_resource_reporting = true # suppress big diffs going to resource reporting service + suppress_resource_reporting = true # suppress big diffs going to resource reporting service tempfile = Tempfile.new("chef-tempfile") tempfile.path end @@ -119,13 +119,13 @@ class Chef description << diff_current_from_content(@new_resource.content) converge_by(description) do backup @new_resource.path if ::File.exists?(@new_resource.path) - ::File.open(@new_resource.path, "w") {|f| f.write @new_resource.content } + ::File.open(@new_resource.path, "w") { |f| f.write @new_resource.content } Chef::Log.info("#{@new_resource} contents updated") end end end - def update_new_file_state(path=@new_resource.path) + def update_new_file_state(path = @new_resource.path) if !::File.directory?(path) @new_resource.checksum(checksum(path)) end @@ -163,7 +163,7 @@ class Chef end end - def backup(file=nil) + def backup(file = nil) file ||= @new_resource.path if @new_resource.backup != false && @new_resource.backup > 0 && ::File.exist?(file) time = Time.now @@ -181,7 +181,7 @@ class Chef # Clean up after the number of backups slice_number = @new_resource.backup - backup_files = Dir[Chef::Util::PathHelper.escape_glob(prefix, ".#{@new_resource.path}") + ".chef-*"].sort { |a,b| b <=> a } + backup_files = Dir[Chef::Util::PathHelper.escape_glob(prefix, ".#{@new_resource.path}") + ".chef-*"].sort { |a, b| b <=> a } if backup_files.length >= @new_resource.backup remainder = backup_files.slice(slice_number..-1) remainder.each do |backup_to_delete| diff --git a/lib/chef/deprecation/provider/remote_directory.rb b/lib/chef/deprecation/provider/remote_directory.rb index f6242a4557..4e28fdc3fa 100644 --- a/lib/chef/deprecation/provider/remote_directory.rb +++ b/lib/chef/deprecation/provider/remote_directory.rb @@ -43,7 +43,7 @@ class Chef end # Clean all the paths... this is required because of the join - files.map {|f| Chef::Util::PathHelper.cleanpath(f)} + files.map { |f| Chef::Util::PathHelper.cleanpath(f) } end end diff --git a/lib/chef/deprecation/provider/remote_file.rb b/lib/chef/deprecation/provider/remote_file.rb index a73181e15c..9f115a2565 100644 --- a/lib/chef/deprecation/provider/remote_file.rb +++ b/lib/chef/deprecation/provider/remote_file.rb @@ -64,7 +64,7 @@ class Chef end def http_client_opts(source) - opts={} + opts = {} # CHEF-3140 # 1. If it's already compressed, trying to compress it more will # probably be counter-productive. |