diff options
| author | Xu Cheng | 2015-12-06 22:33:41 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-12-09 16:56:59 +0800 |
| commit | 72f4323ea56e1715fa54a39faf39cf8dbd53c2ba (patch) | |
| tree | 02d226f5909803b2533315040981707f20dc010b /Library/Homebrew | |
| parent | 5debd5b132690bced97171b9ad31575c6a74dfe0 (diff) | |
| download | brew-72f4323ea56e1715fa54a39faf39cf8dbd53c2ba.tar.bz2 | |
Tab#tap: returns tap object
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/tab.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index c594843f6..984b587ff 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -28,7 +28,7 @@ class Tab < OpenStruct "stdlib" => stdlib, "source" => { "path" => formula.path.to_s, - "tap" => formula.tap, + "tap" => formula.tap ? formula.tap.name : nil, "spec" => formula.active_spec_sym.to_s } } @@ -116,7 +116,11 @@ class Tab < OpenStruct else tab = empty tab.unused_options = f.options.as_flags - tab.source = { "path" => f.path.to_s, "tap" => f.tap, "spec" => f.active_spec_sym.to_s } + tab.source = { + "path" => f.path.to_s, + "tap" => f.tap ? f.tap.name : f.tap, + "spec" => f.active_spec_sym.to_s, + } end tab @@ -194,11 +198,13 @@ class Tab < OpenStruct end def tap - source["tap"] + tap_name = source["tap"] + Tap.fetch(tap_name) if tap_name end def tap=(tap) - source["tap"] = tap + tap_name = tap.respond_to?(:name) ? tap.name : tap + source["tap"] = tap_name end def spec |
