Sha256: 4f3808a11e61c0fb8782618d25c752a5b299aeef406aa0d5174d14c424395801

Contents?: true

Size: 490 Bytes

Versions: 1

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true

module Ftpd

  # Create temporary directories that will be removed when the program
  # exits.

  module TempDir

    # Create a temporary directory, returning its path.  When the
    # program exists, the directory (and its contents) are removed.

    def make
      Dir.mktmpdir.tap do |path|
        at_exit do
          FileUtils.rm_rf path
          Dir.rmdir(path) if File.exist?(path)
        end
      end
    end
    module_function :make

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ftpd-2.1.0 lib/ftpd/temp_dir.rb