Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Pathname.mktmpdir
mktmpdir() { |dir| ... }
ext/pathname/lib/pathname.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/ext/pathname/lib/pathname.rb, line 610
def self.mktmpdir
require 'tmpdir' unless defined?(Dir.mktmpdir)
if block_given?
Dir.mktmpdir do |dir|
dir = self.new(dir)
yield dir
end
else
self.new(Dir.mktmpdir)
end
end
Creates a tmp directory and wraps the returned path in a Pathname object.
See Dir.mktmpdir