зеркало из https://github.com/github/ruby.git
[ruby/tmpdir] [DOC] `require` inside each method on Dir
(https://github.com/ruby/tmpdir/pull/31) https://github.com/ruby/tmpdir/commit/a1ec977923
This commit is contained in:
Родитель
c0c56d1714
Коммит
c16b507563
|
@ -22,6 +22,9 @@ class Dir
|
||||||
|
|
||||||
##
|
##
|
||||||
# Returns the operating system's temporary file path.
|
# Returns the operating system's temporary file path.
|
||||||
|
#
|
||||||
|
# require 'tmpdir'
|
||||||
|
# Dir.tmpdir # => "/tmp"
|
||||||
|
|
||||||
def self.tmpdir
|
def self.tmpdir
|
||||||
['TMPDIR', 'TMP', 'TEMP', ['system temporary path', SYSTMPDIR], ['/tmp']*2, ['.']*2].find do |name, dir|
|
['TMPDIR', 'TMP', 'TEMP', ['system temporary path', SYSTMPDIR], ['/tmp']*2, ['.']*2].find do |name, dir|
|
||||||
|
@ -45,6 +48,11 @@ class Dir
|
||||||
|
|
||||||
# Dir.mktmpdir creates a temporary directory.
|
# Dir.mktmpdir creates a temporary directory.
|
||||||
#
|
#
|
||||||
|
# require 'tmpdir'
|
||||||
|
# Dir.mktmpdir {|dir|
|
||||||
|
# # use the directory
|
||||||
|
# }
|
||||||
|
#
|
||||||
# The directory is created with 0700 permission.
|
# The directory is created with 0700 permission.
|
||||||
# Application should not change the permission to make the temporary directory accessible from other users.
|
# Application should not change the permission to make the temporary directory accessible from other users.
|
||||||
#
|
#
|
||||||
|
|
Загрузка…
Ссылка в новой задаче