aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/odf.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-06-03 14:28:19 -0400
committerRalph Amissah <ralph@amissah.com>2012-06-03 14:28:19 -0400
commit33417c59a25d9c68698d319d298da1fecaec1673 (patch)
tree4569559a60a292dcfafd4aee82425655ea4afb22 /lib/sisu/v3/odf.rb
parentv3: error & warning messages touched, revisit (diff)
v3: warn when files to be copied not found, add
Diffstat (limited to 'lib/sisu/v3/odf.rb')
-rw-r--r--lib/sisu/v3/odf.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb
index c7b60bb5..57994a28 100644
--- a/lib/sisu/v3/odf.rb
+++ b/lib/sisu/v3/odf.rb
@@ -215,7 +215,10 @@ module SiSU_ODF
image_source=image_src(i)
pwd=Dir.pwd
if image_source
- FileUtils::cp("#{image_source}/#{i}","#{@env.processing_path.odt}/Pictures/#{i}")
+ if FileTest.file?("#{image_source}/#{i}")
+ FileUtils::cp("#{image_source}/#{i}","#{@env.processing_path.odt}/Pictures/#{i}")
+ else STDERR.puts %{\t*WARN* did not find image - "#{image_source}/#{i}" [#{__FILE__}:#{__LINE__}]}
+ end
end
img=if i.to_s =~/jpg|png|gif/ \
and h.to_s =~/\d/ \
@@ -522,7 +525,10 @@ module SiSU_ODF
fix=[]
bullet=image_src('bullet_09.png')
if bullet
- FileUtils::cp("#{bullet}/bullet_09.png","#{@env.processing_path.odt}/Pictures/.")
+ if FileTest.file?("#{bullet}/bullet_09.png")
+ FileUtils::cp("#{bullet}/bullet_09.png","#{@env.processing_path.odt}/Pictures/.")
+ else STDERR.puts %{\t*WARN* did not find image - "#{bullet}/bullet_09.png" [#{__FILE__}:#{__LINE__}]}
+ end
end
odf_metadata
data.each do |dob|