Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ GEM
ruby2_keywords (0.0.5)
ruby_parser (3.8.3)
sexp_processor (~> 4.1)
rubyzip (2.4.1)
rubyzip (3.0.0)
securerandom (0.4.1)
sequel (5.94.0)
bigdecimal
Expand Down
4 changes: 2 additions & 2 deletions lib/cloud_controller/app_packager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def fix_subdir_permissions(root_path, app_contents_path)

def size
Zip::File.open(@path) do |in_zip|
in_zip.reduce(0) { |memo, entry| memo + entry.size }
in_zip.entries.sum(&:size)
end
rescue Zip::Error
invalid_zip!
Expand All @@ -59,7 +59,7 @@ def size

def get_dirs_from_zip(zip_path)
Zip::File.open(zip_path) do |in_zip|
in_zip.select(&:directory?)
in_zip.entries.select(&:directory?).map(&:name)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/cloud_controller/benchmark/blobstore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def generate_resources

def zip_resources(resource_dir, output_dir)
zip_file = File.join(output_dir, 'zipped_package')
Zip::File.open(zip_file, Zip::File::CREATE) do |zipfile|
Zip::File.open(zip_file, create: true) do |zipfile|
Find.find(resource_dir).
select { |f| File.file?(f) }.
each do |file|
Expand Down
2 changes: 1 addition & 1 deletion spec/support/test_zip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module TestZip
def self.create(zip_name, file_count, file_size=1024, &blk)
Zip::File.open(zip_name, Zip::File::CREATE) do |zipfile|
Zip::File.open(zip_name, create: true) do |zipfile|
file_count.times do |i|
zipfile.get_output_stream("ziptest_#{i}") do |f|
f.write('A' * file_size)
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/lib/app_packager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
app_packager.fix_subdir_permissions(@tmpdir, "#{@tmpdir}/application_contents")

has_dirs = Zip::File.open(input_zip) do |in_zip|
in_zip.any?(&:directory?)
in_zip.entries.any?(&:directory?)
end

expect(has_dirs).to be_falsey
Expand Down