aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorVlad Shablinsky2015-08-09 14:39:46 +0300
committerMike McQuaid2015-08-10 13:57:58 +0100
commitd88750652a6a6a04aa44c4ededda720701c31db7 (patch)
treedc718c4a2ba4c290a1954a6da537c156da6efc0f /Library
parent77ee9bd4465c6b334f3cc547ecdfb6680abb3f83 (diff)
downloadbrew-d88750652a6a6a04aa44c4ededda720701c31db7.tar.bz2
tap: add formula_renames
- Tap#formula_renames is a method used for getting information about renames in tap formulae.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/tap.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index 2e12e4844..24b496ebe 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -1,3 +1,5 @@
+require "utils/json"
+
# a {Tap} is used to extend the formulae provided by Homebrew core.
# Usually, it's synced with a remote git repository. And it's likely
# a Github repository with the name of `user/homebrew-repo`. In such
@@ -137,6 +139,15 @@ class Tap
}
end
+ # Hash with tap formula renames
+ def formula_renames
+ @formula_renames ||= if (rename_file = path/"formula_renames.json").file?
+ Utils::JSON.load(rename_file.read)
+ else
+ {}
+ end
+ end
+
def self.each
return unless TAP_DIRECTORY.directory?