tab: allow load from file content
This commit is contained in:
parent
296ca61510
commit
ffd92a87c5
@ -31,7 +31,11 @@ class Tab < OpenStruct
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.from_file path
|
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["tabfile"] = path
|
||||||
attributes["source"] ||= {}
|
attributes["source"] ||= {}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user