Sha256: 1032eede71c898a48a528c22573045f3512251c31d48cb18c7b110e53f629bd7

Contents?: true

Size: 464 Bytes

Versions: 24

Compression:

Stored size: 464 Bytes

Contents

require 'tempfile'

class Puppet::FileSystem::Tempfile

  # Variation of Tempfile.open which ensures that the tempfile is closed and
  # unlinked before returning
  #
  # @param identifier [String] additional part of generated pathname
  # @yieldparam file [File] the temporary file object
  # @return result of the passed block
  # @api private
  def self.open(identifier)
    file = ::Tempfile.new(identifier)

    yield file

  ensure
    file.close!
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
puppet-3.6.2 lib/puppet/file_system/tempfile.rb
puppet-3.6.2-x86-mingw32 lib/puppet/file_system/tempfile.rb
puppet-3.6.1 lib/puppet/file_system/tempfile.rb
puppet-3.6.1-x86-mingw32 lib/puppet/file_system/tempfile.rb
puppet-3.6.0 lib/puppet/file_system/tempfile.rb
puppet-3.6.0-x86-mingw32 lib/puppet/file_system/tempfile.rb
puppet-3.6.0.rc1 lib/puppet/file_system/tempfile.rb
puppet-3.6.0.rc1-x86-mingw32 lib/puppet/file_system/tempfile.rb
puppet-3.5.1 lib/puppet/file_system/tempfile.rb
puppet-3.5.1-x86-mingw32 lib/puppet/file_system/tempfile.rb
puppet-3.5.1.rc1 lib/puppet/file_system/tempfile.rb
puppet-3.5.1.rc1-x86-mingw32 lib/puppet/file_system/tempfile.rb
puppet-3.5.0.rc3 lib/puppet/file_system/tempfile.rb
puppet-3.5.0.rc3-x86-mingw32 lib/puppet/file_system/tempfile.rb
puppet-3.5.0.rc2 lib/puppet/file_system/tempfile.rb
puppet-3.5.0.rc2-x86-mingw32 lib/puppet/file_system/tempfile.rb
puppet-3.5.0.rc1 lib/puppet/file_system/tempfile.rb
puppet-3.5.0.rc1-x86-mingw32 lib/puppet/file_system/tempfile.rb
puppet-3.4.3 lib/puppet/file_system/tempfile.rb
puppet-3.4.2 lib/puppet/file_system/tempfile.rb