X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=doc%2Fclasses%2FDir.html;fp=doc%2Fclasses%2FDir.html;h=0000000000000000000000000000000000000000;hb=7c9314f502cde8daad23b61d10b24a542e04154a;hp=eed0ecf64e613a0d87eb3f588d94f88f3852101f;hpb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;p=packages%2Fprecise%2Fmcollective.git diff --git a/doc/classes/Dir.html b/doc/classes/Dir.html deleted file mode 100644 index eed0ecf..0000000 --- a/doc/classes/Dir.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - -
-Class | -Dir | -
In: | -
-
- lib/mcollective/monkey_patches.rb
-
- - |
-
Parent: | -- Object - | -
- # File lib/mcollective/monkey_patches.rb, line 72 - 72: def self.mktmpdir(prefix_suffix=nil, tmpdir=nil) - 73: case prefix_suffix - 74: when nil - 75: prefix = "d" - 76: suffix = "" - 77: when String - 78: prefix = prefix_suffix - 79: suffix = "" - 80: when Array - 81: prefix = prefix_suffix[0] - 82: suffix = prefix_suffix[1] - 83: else - 84: raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}" - 85: end - 86: tmpdir ||= Dir.tmpdir - 87: t = Time.now.strftime("%Y%m%d") - 88: n = nil - 89: begin - 90: path = "#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}" - 91: path << "-#{n}" if n - 92: path << suffix - 93: Dir.mkdir(path, 0700) - 94: rescue Errno::EEXIST - 95: n ||= 0 - 96: n += 1 - 97: retry - 98: end - 99: -100: if block_given? -101: begin -102: yield path -103: ensure -104: FileUtils.remove_entry_secure path -105: end -106: else -107: path -108: end -109: end --
- # File lib/mcollective/monkey_patches.rb, line 111 -111: def self.tmpdir -112: tmp = '.' -113: for dir in [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], '/tmp'] -114: if dir and stat = File.stat(dir) and stat.directory? and stat.writable? -115: tmp = dir -116: break -117: end rescue nil -118: end -119: File.expand_path(tmp) -120: end --