X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/6a935d078f20d2b1b0d60f0a30c41a642d40758a..5e74f498cd2f8d765e309ca52a45a7c2db0a1a6f:/vendor/plugins/attachment_fu/init.rb diff --git a/vendor/plugins/attachment_fu/init.rb b/vendor/plugins/attachment_fu/init.rb new file mode 100644 index 0000000..0239e56 --- /dev/null +++ b/vendor/plugins/attachment_fu/init.rb @@ -0,0 +1,14 @@ +require 'tempfile' + +Tempfile.class_eval do + # overwrite so tempfiles use the extension of the basename. important for rmagick and image science + def make_tmpname(basename, n) + ext = nil + sprintf("%s%d-%d%s", basename.to_s.gsub(/\.\w+$/) { |s| ext = s; '' }, $$, n, ext) + end +end + +require 'geometry' +ActiveRecord::Base.send(:extend, Technoweenie::AttachmentFu::ActMethods) +Technoweenie::AttachmentFu.tempfile_path = ATTACHMENT_FU_TEMPFILE_PATH if Object.const_defined?(:ATTACHMENT_FU_TEMPFILE_PATH) +FileUtils.mkdir_p Technoweenie::AttachmentFu.tempfile_path \ No newline at end of file