From a34ebb8c6188c86caec674624b759ed07d1cb7c5 Mon Sep 17 00:00:00 2001 From: Dmitri Goutnik Date: Sat, 18 Jul 2009 13:08:10 +0400 Subject: [PATCH] fixed incorrect path for added external files in OPF (Christian Steinert); minor exception handling fixes --- History.txt | 8 +++++++- lib/repub/app.rb | 4 +++- lib/repub/app/builder.rb | 2 +- lib/repub/app/logger.rb | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/History.txt b/History.txt index 5a3135c..d267460 100644 --- a/History.txt +++ b/History.txt @@ -1,9 +1,15 @@ +== 0.3.5 / 2009-07-18 + +* Bug fixes + + * Fixed incorrect path for added external files in OPF (Christian Steinert) + == 0.3.4 / 2009-07-17 * Bug fixes * Pre- and post processing filters moved to separate modules. - * Non-conformant element IDs are now fixed automaticly + * Non-conformant element IDs are now fixed automatically * Regardless of the source settings, doctype now is always set to XHTML 1.0 Transitional * -F (disable fixups) option removed, fixups are always on * Documentation updates diff --git a/lib/repub/app.rb b/lib/repub/app.rb index 9f4c471..2cb54cd 100644 --- a/lib/repub/app.rb +++ b/lib/repub/app.rb @@ -39,7 +39,9 @@ def run(args) Launchy::Browser.run(builder.document_path) if options[:browser] - rescue RuntimeError => ex + # rescue RuntimeError => ex + # log.fatal "** ERROR: #{ex.to_s}" + rescue Exception => ex log.fatal "** ERROR: #{ex.to_s}" end diff --git a/lib/repub/app/builder.rb b/lib/repub/app/builder.rb index 61a8c98..6e6e1ea 100644 --- a/lib/repub/app/builder.rb +++ b/lib/repub/app/builder.rb @@ -118,7 +118,7 @@ def copy_and_process_assets @options[:add].each do |file| log.debug "-- Copying external file #{file}" FileUtils.cp(file, '.') - @opf << file + @opf << File.basename(file) end if @options[:add] end diff --git a/lib/repub/app/logger.rb b/lib/repub/app/logger.rb index 9683cf7..de0186f 100644 --- a/lib/repub/app/logger.rb +++ b/lib/repub/app/logger.rb @@ -36,7 +36,7 @@ def error(msg) def fatal(msg) error(msg) - exit 1 + exit! 1 end private