Skip to content

Commit

Permalink
[DOC] require inside each method on Dir
Browse files Browse the repository at this point in the history
(#31)
  • Loading branch information
adam12 committed Feb 25, 2024
1 parent f505e3f commit a1ec977
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/tmpdir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand All @@ -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.
#
Expand Down

0 comments on commit a1ec977

Please sign in to comment.