lib/brief/document/attachments.rb in brief-1.9.9 vs lib/brief/document/attachments.rb in brief-1.9.11

- old
+ new

@@ -7,13 +7,22 @@ def attachments Array(data.attachments) end + def attachment_paths + attachments.reduce({}.to_mash) do |memo, name| + if asset = briefcase.find_asset(name) + memo[name] = asset.realpath.to_s + memo + end + end + end + def render_attachments attachments.reduce({}.to_mash) do |memo, name| if asset = briefcase.find_asset(name) - memo[name] = IO.read(asset) + memo[name] = IO.read(asset) if asset.to_s.match(/\.svg/i) memo end end end end