Class: SimpleCaptcha::ImageHelpers::Tempfile

Inherits:
Tempfile
  • Object
show all
Defined in:
lib/simple_captcha/image.rb

Instance Method Summary collapse

Instance Method Details

#make_tmpname(basename, n = 0) ⇒ Object

Replaces Tempfile’s make_tmpname with one that honors file extensions.



51
52
53
54
# File 'lib/simple_captcha/image.rb', line 51

def make_tmpname(basename, n = 0)
  extension = File.extname(basename)
  sprintf("%s,%d,%d%s", File.basename(basename, extension), $$, n, extension)
end