Skip to content

Commit a1ec977

Browse files
authored
[DOC] require inside each method on Dir
(#31)
1 parent f505e3f commit a1ec977

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/tmpdir.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class Dir
2222

2323
##
2424
# Returns the operating system's temporary file path.
25+
#
26+
# require 'tmpdir'
27+
# Dir.tmpdir # => "/tmp"
2528

2629
def self.tmpdir
2730
['TMPDIR', 'TMP', 'TEMP', ['system temporary path', SYSTMPDIR], ['/tmp']*2, ['.']*2].find do |name, dir|
@@ -45,6 +48,11 @@ def self.tmpdir
4548

4649
# Dir.mktmpdir creates a temporary directory.
4750
#
51+
# require 'tmpdir'
52+
# Dir.mktmpdir {|dir|
53+
# # use the directory
54+
# }
55+
#
4856
# The directory is created with 0700 permission.
4957
# Application should not change the permission to make the temporary directory accessible from other users.
5058
#

0 commit comments

Comments
 (0)