aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-05-23 18:08:07 +0800
committerXu Cheng2015-06-02 16:45:43 +0800
commitffd92a87c5e0503c1ca63c52d54332c2c93618c2 (patch)
tree4af073edb19046a132c2bcea80a3e1f370f0cf1c /Library
parent296ca615103a9b4b59519e4f0e3b75a6bc6f9b03 (diff)
downloadbrew-ffd92a87c5e0503c1ca63c52d54332c2c93618c2.tar.bz2
tab: allow load from file content
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/tab.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index efc746628..85252ab60 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -31,7 +31,11 @@ class Tab < OpenStruct
end
def self.from_file path
- attributes = Utils::JSON.load(File.read(path))
+ from_file_content(File.read(path), path)
+ end
+
+ def self.from_file_content content, path
+ attributes = Utils::JSON.load(content)
attributes["tabfile"] = path
attributes["source"] ||= {}