aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/utils
diff options
context:
space:
mode:
authorMarkus Reiter2017-05-22 04:15:11 +0200
committerMarkus Reiter2017-05-25 06:18:52 +0200
commitfd97e88b990b4804e9cfec90e3e5fe60fa54437a (patch)
treec32ba2c02e01d1b605021d5301e5e9c4c9e70527 /Library/Homebrew/cask/lib/hbc/utils
parent060af0a26ab7219e46b500fd1c7f420b6cc74cbb (diff)
downloadbrew-fd97e88b990b4804e9cfec90e3e5fe60fa54437a.tar.bz2
Use `LockFile` instead of `Hbc::Utils::file_locked?`.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/utils')
-rw-r--r--Library/Homebrew/cask/lib/hbc/utils/file.rb14
1 files changed, 0 insertions, 14 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/utils/file.rb b/Library/Homebrew/cask/lib/hbc/utils/file.rb
deleted file mode 100644
index 6b80f33ce..000000000
--- a/Library/Homebrew/cask/lib/hbc/utils/file.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-module Hbc
- module Utils
- module_function
-
- def file_locked?(file)
- unlocked = File.open(file).flock(File::LOCK_EX | File::LOCK_NB)
- # revert lock if file was unlocked before check
- File.open(file).flock(File::LOCK_UN) if unlocked
- !unlocked
- rescue
- true
- end
- end
-end