diff options
| author | Markus Reiter | 2017-05-22 03:23:50 +0200 |
|---|---|---|
| committer | Markus Reiter | 2017-05-25 06:18:52 +0200 |
| commit | 060af0a26ab7219e46b500fd1c7f420b6cc74cbb (patch) | |
| tree | 649593bf35ab82c344d7f7ca9456f26d118f6f45 /Library/Homebrew | |
| parent | e931fee732d9d8d34eb9d689782bafb3822302f7 (diff) | |
| download | brew-060af0a26ab7219e46b500fd1c7f420b6cc74cbb.tar.bz2 | |
Rename `FormulaLock` to `LockFile`.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/formula.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/keg.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/lock_file.rb (renamed from Library/Homebrew/formula_lock.rb) | 16 | ||||
| -rw-r--r-- | Library/Homebrew/migrator.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/lock_file_spec.rb (renamed from Library/Homebrew/test/formula_lock_spec.rb) | 6 |
5 files changed, 20 insertions, 8 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 0b3e87bb1..d42332c64 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1,5 +1,5 @@ require "formula_support" -require "formula_lock" +require "lock_file" require "formula_pin" require "hardware" require "utils/bottles" diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 8733def27..07d4dd9cd 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -1,6 +1,6 @@ require "extend/pathname" require "keg_relocate" -require "formula_lock" +require "lock_file" require "ostruct" class Keg diff --git a/Library/Homebrew/formula_lock.rb b/Library/Homebrew/lock_file.rb index bf747fea2..83743b744 100644 --- a/Library/Homebrew/formula_lock.rb +++ b/Library/Homebrew/lock_file.rb @@ -1,9 +1,9 @@ require "fcntl" -class FormulaLock +class LockFile def initialize(name) @name = name - @path = HOMEBREW_LOCK_DIR/"#{@name}.brewing" + @path = HOMEBREW_LOCK_DIR/"#{@name}.lock" @lockfile = nil end @@ -35,3 +35,15 @@ class FormulaLock @lockfile.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) end end + +class FormulaLock < LockFile + def initialize(name) + super("#{name}.formula") + end +end + +class CaskLock < LockFile + def initialize(name) + super("#{name}.cask") + end +end diff --git a/Library/Homebrew/migrator.rb b/Library/Homebrew/migrator.rb index 3cb6c5178..f975962cf 100644 --- a/Library/Homebrew/migrator.rb +++ b/Library/Homebrew/migrator.rb @@ -1,5 +1,5 @@ require "formula" -require "formula_lock" +require "lock_file" require "keg" require "tab" diff --git a/Library/Homebrew/test/formula_lock_spec.rb b/Library/Homebrew/test/lock_file_spec.rb index 9b5ece813..82c47a70a 100644 --- a/Library/Homebrew/test/formula_lock_spec.rb +++ b/Library/Homebrew/test/lock_file_spec.rb @@ -1,6 +1,6 @@ -require "formula_lock" +require "lock_file" -describe FormulaLock do +describe LockFile do subject { described_class.new("foo") } describe "#lock" do @@ -24,7 +24,7 @@ describe FormulaLock do expect { subject.unlock }.not_to raise_error end - it "unlocks a locked Formula" do + it "unlocks when locked" do subject.lock subject.unlock |
