Sha256: c2f5c335c47435ea025fcc836962a4532a8646031b792b0c244d2d184017f40e

Contents?: true

Size: 332 Bytes

Versions: 6

Compression:

Stored size: 332 Bytes

Contents

require 'tempfile'

class WickedPdfTempfile < Tempfile
  # ensures the Tempfile's filename always keeps its extension
  def initialize(filename, temp_dir = nil)
    temp_dir ||= Dir.tmpdir
    extension = File.extname(filename)
    basename  = File.basename(filename, extension)
    super([basename, extension], temp_dir)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wicked_pdf-1.0.6 lib/wicked_pdf/tempfile.rb
wicked_pdf-1.0.5 lib/wicked_pdf/tempfile.rb
wicked_pdf-1.0.4 lib/wicked_pdf/tempfile.rb
wicked_pdf-1.0.3 lib/wicked_pdf/tempfile.rb
wicked_pdf-1.0.2 lib/wicked_pdf/tempfile.rb
wicked_pdf-1.0.1 lib/wicked_pdf/tempfile.rb