Skip to content

Commit

Permalink
Merge pull request ManageIQ#10 from bdunne/remove_zip-zip
Browse files Browse the repository at this point in the history
Remove zip-zip
  • Loading branch information
mkanoor authored May 5, 2017
2 parents 7eb0cb4 + 87875c0 commit 854ca51
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/models/miq_ae_yaml_export_zipfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def write_data(base_path, export_hash)
end

def export
require 'zip/zipfilesystem'
require 'zip/filesystem'

Zip::ZipFile.open(@temp_file_name, Zip::ZipFile::CREATE) do |zf|
Zip::File.open(@temp_file_name, Zip::File::CREATE) do |zf|
@zip_file = zf
write_model
@zip_file.close unless @zip_file.nil?
Expand Down
4 changes: 2 additions & 2 deletions app/models/miq_ae_yaml_import_zipfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ def initialize(domain, options)
end

def load_zip
require 'zip/zipfilesystem'
require 'zip/filesystem'

raise MiqAeException::FileNotFound, "import file: #{@options['zip_file']} not found" \
unless File.exist?(@options['zip_file'])
@zip = Zip::ZipFile.open(@options['zip_file'])
@zip = Zip::File.open(@options['zip_file'])
@sorted_entries = @zip.entries.sort
end

Expand Down
4 changes: 2 additions & 2 deletions spec/models/miq_ae_yaml_import_export_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,8 @@ def check_class_component_counts(counts)
end

def create_bogus_zip_file
require 'zip/zipfilesystem'
Zip::ZipFile.open(@zip_file, Zip::ZipFile::CREATE) do |zh|
require 'zip/filesystem'
Zip::File.open(@zip_file, Zip::File::CREATE) do |zh|
zh.file.open("first.txt", "w") { |f| f.puts "Hello world" }
zh.dir.mkdir("mydir")
zh.file.open("mydir/second.txt", "w") { |f| f.puts "Hello again" }
Expand Down

0 comments on commit 854ca51

Please sign in to comment.