From a1ec977923a67abf49afaa3711dd4a2e94856269 Mon Sep 17 00:00:00 2001 From: Adam Daniels Date: Sun, 25 Feb 2024 03:36:37 -0500 Subject: [PATCH] [DOC] `require` inside each method on Dir (#31) --- lib/tmpdir.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb index 70bd010..65c86e9 100644 --- a/lib/tmpdir.rb +++ b/lib/tmpdir.rb @@ -22,6 +22,9 @@ class Dir ## # Returns the operating system's temporary file path. + # + # require 'tmpdir' + # Dir.tmpdir # => "/tmp" def self.tmpdir ['TMPDIR', 'TMP', 'TEMP', ['system temporary path', SYSTMPDIR], ['/tmp']*2, ['.']*2].find do |name, dir| @@ -45,6 +48,11 @@ def self.tmpdir # Dir.mktmpdir creates a temporary directory. # + # require 'tmpdir' + # Dir.mktmpdir {|dir| + # # use the directory + # } + # # The directory is created with 0700 permission. # Application should not change the permission to make the temporary directory accessible from other users. #