lib = File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
$LOAD_PATH.unshift(lib) if File.exist?(lib)
+require 'fileutils'
require 'optparse'
require 'tmpdir'
db_files.each {|docbook_file|
dir = File.expand_path(File.join(Dir.tmpdir, ".epubtmp#{Time.now.to_f.to_s}"))
+ FileUtils.mkdir_p(dir)
e = DocBook::Epub.new(docbook_file, dir, css_file, customization_layer, otf_files)
if output_file
# were XIncluded or added by ENTITY
# http://sourceforge.net/tracker/?func=detail&aid=2750442&group_id=21935&atid=373747
def collapse_docbook
- collapsed_file = File.join(File.dirname(@docbook_file),
- '.collapsed.' + File.basename(@docbook_file))
+ collapsed_file = File.join(File.expand_path(File.dirname(@docbook_file)),
+ '.collapsed.' + File.basename(@docbook_file))
entity_collapse_command = "xmllint --loaddtd --noent -o '#{collapsed_file}' '#{@docbook_file}'"
entity_success = system(entity_collapse_command)
raise "Could not collapse named entites in #{@docbook_file}" unless entity_success