aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAlyssa Ross2016-09-05 14:21:00 +0100
committerAlyssa Ross2016-09-05 14:26:17 +0100
commitb90eba8ffd9549879bf4c911377d8d4cf9aa7b39 (patch)
tree7c6ac159977aaf5b5d74b60807fa57c91ec9ab6f /Library
parent65ee5408c3d000393c1b73bfe8fb731a651ee281 (diff)
downloadbrew-b90eba8ffd9549879bf4c911377d8d4cf9aa7b39.tar.bz2
Update Tap for alias_path
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/tab.rb6
-rw-r--r--Library/Homebrew/test/fixtures/receipt.json2
-rw-r--r--Library/Homebrew/test/test_tab.rb3
3 files changed, 8 insertions, 3 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index ec8cbe235..d84c64329 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -56,6 +56,10 @@ class Tab < OpenStruct
attributes["source_modified_time"] ||= 0
attributes["source"] ||= {}
+ if alias_path = attributes["alias_path"]
+ attributes["alias_path"] = Pathname.new(alias_path)
+ end
+
tapped_from = attributes["tapped_from"]
unless tapped_from.nil? || tapped_from == "path or URL"
attributes["source"]["tap"] = attributes.delete("tapped_from")
@@ -294,7 +298,7 @@ class Tab < OpenStruct
"time" => time,
"source_modified_time" => source_modified_time.to_i,
"HEAD" => self.HEAD,
- "alias_path" => alias_path,
+ "alias_path" => alias_path && alias_path.to_s,
"stdlib" => (stdlib.to_s if stdlib),
"compiler" => (compiler.to_s if compiler),
"source" => source
diff --git a/Library/Homebrew/test/fixtures/receipt.json b/Library/Homebrew/test/fixtures/receipt.json
index 39dcaea07..585a4e27d 100644
--- a/Library/Homebrew/test/fixtures/receipt.json
+++ b/Library/Homebrew/test/fixtures/receipt.json
@@ -11,7 +11,7 @@
"poured_from_bottle": true,
"time": 1403827774,
"HEAD": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
- "alias_path": "test-formula",
+ "alias_path": "/usr/local/Library/Taps/homebrew/homebrew-core/Aliases/test-formula",
"stdlib": "libcxx",
"compiler": "clang",
"source": {
diff --git a/Library/Homebrew/test/test_tab.rb b/Library/Homebrew/test/test_tab.rb
index 85fcf4d16..be528390a 100644
--- a/Library/Homebrew/test/test_tab.rb
+++ b/Library/Homebrew/test/test_tab.rb
@@ -100,6 +100,7 @@ class TabTests < Homebrew::TestCase
def test_from_file
path = Pathname.new(TEST_DIRECTORY).join("fixtures", "receipt.json")
tab = Tab.from_file(path)
+ alias_path = Pathname.new("/usr/local/Library/Taps/homebrew/homebrew-core/Aliases/test-formula")
assert_equal @used.sort, tab.used_options.sort
assert_equal @unused.sort, tab.unused_options.sort
@@ -117,7 +118,7 @@ class TabTests < Homebrew::TestCase
assert_equal "2.14", tab.stable_version.to_s
assert_equal "2.15", tab.devel_version.to_s
assert_equal "HEAD-0000000", tab.head_version.to_s
- assert_equal "test-formula", tab.alias_path
+ assert_equal alias_path, tab.alias_path
end
def test_to_json