Sha256: 209daecc6bfe51e9516ff0d1de8c09af295fd3c81e239db8034762673775f8be
Contents?: true
Size: 702 Bytes
Versions: 22
Compression:
Stored size: 702 Bytes
Contents
require 'tempfile' module Bulldog if RUBY_VERSION >= '1.8.7' Tempfile = ::Tempfile else # # Backport Ruby 1.8.7's Tempfile feature which allows specifying the # extension by passing in the path as a 2-element array. Useful for # things like ImageMagick, which often rely on the file extension. # class Tempfile < ::Tempfile private def make_tmpname(basename, n) case basename when Array prefix, suffix = *basename else prefix, suffix = basename, '' end t = Time.now.strftime("%Y%m%d") path = "#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}-#{n}#{suffix}" end end end end
Version data entries
22 entries across 22 versions & 1 rubygems