diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-04 13:53:59 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-04 13:53:59 +0000 |
commit | b8f3ef613613b5d9b275f84fa774b03ef493ac21 (patch) | |
tree | 72664332c97afc3297bb98c50ea503a81b573476 /lib | |
parent | 250d10b21f7f4482ab33da91a699c4b542c92b33 (diff) |
* lib/tempfile.rb: don't use lock directory. [ruby-dev:39197]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tempfile.rb | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb index 57fb228c13..a8f22c8eb6 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -140,10 +140,8 @@ class Tempfile < DelegateClass(File) else opts = perm end - self.class.locking(tmpname) do - @data[1] = @tmpfile = File.open(tmpname, mode, opts) - @data[0] = @tmpname = tmpname - end + @data[1] = @tmpfile = File.open(tmpname, mode, opts) + @data[0] = @tmpname = tmpname @mode = mode & ~(File::CREAT|File::EXCL) perm or opts.freeze @opts = opts @@ -320,26 +318,6 @@ class Tempfile < DelegateClass(File) tempfile end end - - # :stopdoc: - - # yields with locking for +tmpname+ and returns the result of the - # block. - def locking(tmpname) - lock = tmpname + '.lock' - mkdir(lock) - yield - ensure - rmdir(lock) if lock - end - - def mkdir(*args) - Dir.mkdir(*args) - end - - def rmdir(*args) - Dir.rmdir(*args) - end end end |