Sha256: 1e973127ac1cf1d029fa85d23d2b8864bf021a52c156d7246ae862fdc3fc0717

Contents?: true

Size: 276 Bytes

Versions: 19

Compression:

Stored size: 276 Bytes

Contents

require 'tempfile'

class Tempfile
  def self.open_with_block(name = nil, dir = nil)
    name ||= (0..8).map{rand(36).to_s(36)}.join
    args = dir ? [name, dir] : [name]
    tmp = Tempfile.open *args
    begin
      yield tmp
    ensure
      tmp.close true
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
kanamei-kanamei-keystone-0.0.12 lib/keystone/core_ext/tempfile.rb
kanamei-kanamei-keystone-0.0.13 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.11 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.12 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.14 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.15 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.16 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.17 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.18 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.19 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.20 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.21 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.22 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.23 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.24 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.25 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.26 lib/keystone/core_ext/tempfile.rb
kanamei-keystone-0.0.27 lib/keystone/core_ext/tempfile.rb
keystone-0.0.29 lib/keystone/core_ext/tempfile.rb