Tab: ensure file is closed after reading

This commit is contained in:
Jack Nagel 2013-10-23 23:22:28 -05:00
parent 3716dae0ce
commit a8fe03f72b

View File

@ -29,7 +29,7 @@ class Tab < OpenStruct
end
def self.from_file path
tab = Tab.new Utils::JSON.load(open(path).read)
tab = Tab.new Utils::JSON.load(File.read(path))
tab.tabfile = path
tab
end