lib/jirasync/local_repository.rb in jirasync-0.4.3 vs lib/jirasync/local_repository.rb in jirasync-0.4.4
- old
+ new
@@ -38,7 +38,13 @@
"please run an initial fetch first")
end
s = IO.read(file_path)
JSON.parse(s)
end
+
+ def save_attachment(issue, attachment, data)
+ FileUtils::mkdir_p("#{@path}/attachments")
+ file_path = "#{@path}/attachments/#{issue['key']}-#{attachment['id']}-#{attachment['filename'].gsub(" ", "_")}"
+ File.write(file_path, data, {:mode => 'wb'})
+ end
end
-end
+end
\ No newline at end of file