Drop old jruby support (modern have tempfile similar to mri)

This commit is contained in:
Vasily Fedoseyev
2024-04-10 18:01:56 +03:00
parent f2b6da2a69
commit 99cb5b39fe
2 changed files with 0 additions and 21 deletions

View File

@@ -32,7 +32,6 @@ require 'paperclip/upfile'
require 'paperclip/iostream'
require 'paperclip/geometry'
require 'paperclip/processor'
require 'paperclip/tempfile'
require 'paperclip/thumbnail'
require 'paperclip/recursive_thumbnail'
require 'paperclip/storage'

View File

@@ -1,20 +0,0 @@
# frozen_string_literal: true
require 'English'
module Paperclip
# Due to how ImageMagick handles its image format conversion and how Tempfile
# handles its naming scheme, it is necessary to override how Tempfile makes
# its names so as to allow for file extensions. Idea taken from the comments
# on this blog post:
# http://marsorange.com/archives/of-mogrify-ruby-tempfile-dynamic-class-definitions
class Tempfile < ::Tempfile
# это похоже актуально только для java (не проверял, в mri 3.2 точно не вызывается)
# Replaces Tempfile's +make_tmpname+ with one that honors file extensions.
def make_tmpname(basename, n)
extension = File.extname(basename)
sprintf("%s,%d,%d%s", File.basename(basename, extension), $PROCESS_ID, n.to_i, extension)
end
end
end