Browse Source

CLDC-4513: update rubyzip and patch breaking changes (#3381)

pull/3378/head
Nat Dean-Lewis 3 days ago committed by GitHub
parent
commit
64c1bc8a6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      Gemfile.lock
  2. 2
      app/services/exports/xml_export_service.rb
  3. 4
      spec/services/storage/archive_service_spec.rb

9
Gemfile.lock

@ -433,9 +433,12 @@ GEM
actionpack (>= 7.0) actionpack (>= 7.0)
railties (>= 7.0) railties (>= 7.0)
rexml (3.4.4) rexml (3.4.4)
roo (2.10.1) roo (3.0.0)
base64 (~> 0.2)
csv (~> 3)
logger (~> 1)
nokogiri (~> 1) nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0) rubyzip (>= 3.0.0, < 4.0.0)
rotp (6.3.0) rotp (6.3.0)
rspec-core (3.13.0) rspec-core (3.13.0)
rspec-support (~> 3.13.0) rspec-support (~> 3.13.0)
@ -499,7 +502,7 @@ GEM
faraday-multipart (>= 1) faraday-multipart (>= 1)
ruby-progressbar (1.13.0) ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5) ruby2_keywords (0.0.5)
rubyzip (2.3.2) rubyzip (3.6.0)
securerandom (0.4.1) securerandom (0.4.1)
selenium-webdriver (4.43.0) selenium-webdriver (4.43.0)
base64 (~> 0.2) base64 (~> 0.2)

2
app/services/exports/xml_export_service.rb

@ -48,7 +48,7 @@ module Exports
@logger.info("Creating #{archive} - #{initial_count} resources") @logger.info("Creating #{archive} - #{initial_count} resources")
return {} if initial_count.zero? return {} if initial_count.zero?
zip_file = Zip::File.open_buffer(StringIO.new) zip_file = Zip::File.open_buffer(StringIO.new, create: true)
part_number = 1 part_number = 1
last_processed_marker = nil last_processed_marker = nil

4
spec/services/storage/archive_service_spec.rb

@ -13,7 +13,7 @@ RSpec.describe Storage::ArchiveService do
file file
end end
let(:archive_content) do let(:archive_content) do
zip_file = Zip::File.open_buffer(StringIO.new) zip_file = Zip::File.open_buffer(StringIO.new, create: true)
zip_file.mkdir(compressed_folder) zip_file.mkdir(compressed_folder)
zip_file.add(compressed_filepath, compressed_file) zip_file.add(compressed_filepath, compressed_file)
zip_file.write_buffer zip_file.write_buffer
@ -51,7 +51,7 @@ RSpec.describe Storage::ArchiveService do
it "raises an error if the file exists but is too large" do it "raises an error if the file exists but is too large" do
archive = archive_service.instance_variable_get(:@archive) archive = archive_service.instance_variable_get(:@archive)
allow(archive).to receive(:get_entry).and_return(Zip::Entry.new(nil, "", nil, nil, nil, nil, nil, 100_000_000, nil)) allow(archive).to receive(:get_entry).and_return(Zip::Entry.new(nil, "", size: 100_000_000))
expect { archive_service.get_file_io(compressed_filepath) } expect { archive_service.get_file_io(compressed_filepath) }
.to raise_error(RuntimeError, "File too large to be extracted") .to raise_error(RuntimeError, "File too large to be extracted")

Loading…
Cancel
Save