tap: add formula_renames

- Tap#formula_renames is a method used for getting information
about renames in tap formulae.
This commit is contained in:
Vlad Shablinsky 2015-08-09 14:39:46 +03:00 committed by Mike McQuaid
parent 77ee9bd446
commit d88750652a

View File

@ -1,3 +1,5 @@
require "utils/json"
# a {Tap} is used to extend the formulae provided by Homebrew core. # 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 # 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 # a Github repository with the name of `user/homebrew-repo`. In such
@ -137,6 +139,15 @@ class Tap
} }
end 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 def self.each
return unless TAP_DIRECTORY.directory? return unless TAP_DIRECTORY.directory?