...
 
Commits (2)
......@@ -59,7 +59,7 @@ module EPUB
end
# Substance of +epub-archive+ command
# @param source_file [Pathname, String]
# @param source_dir [Pathname, String]
# @param epub_file [Pathname, String, nil]
# @return [Pathname] Path to generated EPUB file
# @raise [RuntimeError] if directory +source_dir+ doesn't exist
......@@ -69,7 +69,8 @@ module EPUB
# @todo Accept compression method option
# @todo Accept compression level option
def archive(source_dir, epub_file = nil)
source_dir = Pathname(source_dir.to_path[0..-2]) if source_dir.to_path.end_with? "/"
source_dir = source_dir.to_s
source_dir = source_dir.to_s[0..-2] if source_dir.to_s.end_with? "/"
epub_file ||= source_dir + ".epub"
source_dir = Pathname(source_dir)
raise "source directory #{source_dir} not exist" unless source_dir.exist?
......