Skip to content
Snippets Groups Projects
Commit 9a90dbd2 authored by Xu Cheng's avatar Xu Cheng
Browse files

Formula: add full_name variable

parent 26d16830
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,11 @@ class Formula
# e.g. `this-formula`
attr_reader :name
# The fully-qualified name of this {Formula}.
# For core formula it's the same as {#name}.
# e.g. `homebrew/tap-name/this-formula`
attr_reader :full_name
# The full path to this {Formula}.
# e.g. `/usr/local/Library/Formula/this-formula.rb`
attr_reader :path
......@@ -88,6 +93,12 @@ class Formula
@path = path
@revision = self.class.revision || 0
if path.to_s =~ HOMEBREW_TAP_PATH_REGEX
@full_name = "#{$1}/#{$2.gsub(/^homebrew-/, "")}/#{name}"
else
@full_name = name
end
set_spec :stable
set_spec :devel
set_spec :head
......@@ -714,6 +725,7 @@ class Formula
def to_hash
hsh = {
"name" => name,
"full_name" => full_name,
"desc" => desc,
"homepage" => homepage,
"versions" => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment