aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tap.rb
diff options
context:
space:
mode:
authorXu Cheng2016-02-25 14:14:33 +0800
committerXu Cheng2016-02-25 17:22:28 +0800
commit87ecd621ebd3f3bfc170fc6e09eba84301b80027 (patch)
tree937f65705f90fff9969e994520ecf10ebf5cb1a8 /Library/Homebrew/tap.rb
parenta7869783ada72693b4c1cd1b3247e268a35f7348 (diff)
downloadbrew-87ecd621ebd3f3bfc170fc6e09eba84301b80027.tar.bz2
add Tap#tap_migrations
This enables tap migration feature in per tap case, which will ultimately help core/formula separation.
Diffstat (limited to 'Library/Homebrew/tap.rb')
-rw-r--r--Library/Homebrew/tap.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index 08e85688d..b1bc9ab0b 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -76,6 +76,7 @@ class Tap
@alias_reverse_table = nil
@command_files = nil
@formula_renames = nil
+ @tap_migrations = nil
end
# The remote path to this {Tap}.
@@ -370,6 +371,17 @@ class Tap
end
end
+ # Hash with tap migrations
+ def tap_migrations
+ require "utils/json"
+
+ @tap_migrations ||= if (migration_file = path/"tap_migrations.json").file?
+ Utils::JSON.load(migration_file.read)
+ else
+ {}
+ end
+ end
+
def ==(other)
other = Tap.fetch(other) if other.is_a?(String)
self.class == other.class && self.name == other.name