diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-02-18 16:27:07 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-02-18 16:27:07 -0800 |
commit | 91c87f8249b4ebc136de64ae453e371d678c884e (patch) | |
tree | e52241a1809f1ce258d5aa10b1bb12b879336936 /lib/chef/cookbook_site_streaming_uploader.rb | |
parent | e24bf812769efe4a4f52b212631af0071d9de3b8 (diff) | |
download | chef-91c87f8249b4ebc136de64ae453e371d678c884e.tar.gz |
whitespaces fixes
addresses Lint/DefEndAlignment and probably more
Diffstat (limited to 'lib/chef/cookbook_site_streaming_uploader.rb')
-rw-r--r-- | lib/chef/cookbook_site_streaming_uploader.rb | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/chef/cookbook_site_streaming_uploader.rb b/lib/chef/cookbook_site_streaming_uploader.rb index 879a578e15..9e7a55c772 100644 --- a/lib/chef/cookbook_site_streaming_uploader.rb +++ b/lib/chef/cookbook_site_streaming_uploader.rb @@ -35,22 +35,22 @@ class Chef class << self - def create_build_dir(cookbook) - tmp_cookbook_path = Tempfile.new("chef-#{cookbook.name}-build") - tmp_cookbook_path.close - tmp_cookbook_dir = tmp_cookbook_path.path - File.unlink(tmp_cookbook_dir) - FileUtils.mkdir_p(tmp_cookbook_dir) - Chef::Log.debug("Staging at #{tmp_cookbook_dir}") - checksums_to_on_disk_paths = cookbook.checksums - Chef::CookbookVersion::COOKBOOK_SEGMENTS.each do |segment| - cookbook.manifest[segment].each do |manifest_record| - path_in_cookbook = manifest_record[:path] - on_disk_path = checksums_to_on_disk_paths[manifest_record[:checksum]] - dest = File.join(tmp_cookbook_dir, cookbook.name.to_s, path_in_cookbook) - FileUtils.mkdir_p(File.dirname(dest)) - Chef::Log.debug("Staging #{on_disk_path} to #{dest}") - FileUtils.cp(on_disk_path, dest) + def create_build_dir(cookbook) + tmp_cookbook_path = Tempfile.new("chef-#{cookbook.name}-build") + tmp_cookbook_path.close + tmp_cookbook_dir = tmp_cookbook_path.path + File.unlink(tmp_cookbook_dir) + FileUtils.mkdir_p(tmp_cookbook_dir) + Chef::Log.debug("Staging at #{tmp_cookbook_dir}") + checksums_to_on_disk_paths = cookbook.checksums + Chef::CookbookVersion::COOKBOOK_SEGMENTS.each do |segment| + cookbook.manifest[segment].each do |manifest_record| + path_in_cookbook = manifest_record[:path] + on_disk_path = checksums_to_on_disk_paths[manifest_record[:checksum]] + dest = File.join(tmp_cookbook_dir, cookbook.name.to_s, path_in_cookbook) + FileUtils.mkdir_p(File.dirname(dest)) + Chef::Log.debug("Staging #{on_disk_path} to #{dest}") + FileUtils.cp(on_disk_path, dest) end end @@ -87,13 +87,13 @@ class Chef filepath = value.path filename = File.basename(filepath) parts << StringPart.new( "--" + boundary + "\r\n" + - "Content-Disposition: form-data; name=\"" + key.to_s + "\"; filename=\"" + filename + "\"\r\n" + - "Content-Type: application/octet-stream\r\n\r\n") + "Content-Disposition: form-data; name=\"" + key.to_s + "\"; filename=\"" + filename + "\"\r\n" + + "Content-Type: application/octet-stream\r\n\r\n") parts << StreamPart.new(value, File.size(filepath)) parts << StringPart.new("\r\n") else parts << StringPart.new( "--" + boundary + "\r\n" + - "Content-Disposition: form-data; name=\"" + key.to_s + "\"\r\n\r\n") + "Content-Disposition: form-data; name=\"" + key.to_s + "\"\r\n\r\n") parts << StringPart.new(value.to_s + "\r\n") end end @@ -244,10 +244,10 @@ class Chef @part_offset = 0 next_part = read(how_much_next_part) result = current_part + if next_part - next_part - else - '' - end + next_part + else + '' + end else @part_offset += how_much_current_part result = current_part |