class CbrToEpub::Output::EpubCompressor

Attributes

file_manager[R]

Public Class Methods

new(file_manager) click to toggle source
# File lib/cbr_to_epub/output/epub_compressor.rb, line 6
def initialize(file_manager)
  @file_manager = file_manager
end

Public Instance Methods

compress() click to toggle source
# File lib/cbr_to_epub/output/epub_compressor.rb, line 10
def compress
  # mimetype needs to be the first file in epub archive
  system("cd \"#{file_manager.epub_directory}\" && zip -0 -rX \"#{zip_path}\" mimetype")
  system("cd \"#{file_manager.epub_directory}\" && zip -0 -rX \"#{zip_path}\" * -x mimetype")
end
copy(path) click to toggle source
# File lib/cbr_to_epub/output/epub_compressor.rb, line 16
def copy(path)
  FileUtils.copy(zip_path, path)
end
zip_path() click to toggle source
# File lib/cbr_to_epub/output/epub_compressor.rb, line 20
def zip_path
  File.join(file_manager.directory, 'output.epub')
end