Class: Fastlane::Helper::ZipFileGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/repack_ios/helper/repack_ios_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(input_dir, output_file) ⇒ ZipFileGenerator

Initialize with the directory to zip and the location of the output archive.



11
12
13
14
# File 'lib/fastlane/plugin/repack_ios/helper/repack_ios_helper.rb', line 11

def initialize(input_dir, output_file)
  @input_dir = input_dir
  @output_file = output_file
end

Instance Method Details

#writeObject

Zip the input directory.



17
18
19
20
21
22
23
# File 'lib/fastlane/plugin/repack_ios/helper/repack_ios_helper.rb', line 17

def write
  entries = Dir.entries(@input_dir) - %w[. ..]

  ::Zip::File.open(@output_file, ::Zip::File::CREATE) do |zipfile|
    write_entries(entries, '', zipfile)
  end
end