...
 
Commits (2)
......@@ -6,8 +6,6 @@ require 'tmpdir'
require 'time'
require 'archive/zip'
require 'epub'
require 'epub/constants'
require 'epub/book'
require 'epub/parser'
require "epub/maker/version"
require 'epub/maker/ocf'
......@@ -71,10 +69,11 @@ module EPUB
# @todo Accept compression method option
# @todo Accept compression level option
def archive(source_dir, epub_file = nil)
source_dir = source_dir[0..-2] if source_dir.end_with? "/"
epub_file ||= source_dir + ".epub"
source_dir = Pathname(source_dir)
raise "source directory #{source_dir} not exist" unless source_dir.exist?
epub_file ||= source_dir.sub_ext(".epub")
epub_file = Pathname(epub_file)
temp_dest = Pathname(Tempfile.create(epub_file.basename.to_path, epub_file.dirname.to_path))
Pathname.mktmpdir "epub-maker" do |dir|
......