class ManabuDesktop::Util::Cache

Public Class Methods

cache_path() click to toggle source
# File lib/util/cache.rb, line 18
def self.cache_path()
  @@cache_path_override || ENV['MANABU_DESKTOP_CACHE'] || "#{ENV['HOME']}/.manabu-desktop/"
end
load(file) click to toggle source
# File lib/util/cache.rb, line 6
def self.load(file)
  if File.exist?("#{cache_path()}/login_cache.msgpack")
    file = File.open("#{cache_path()}/login_cache.msgpack", 'rb')
    content = file.read()
    begin
      return MessagePack.unpack(content)
    rescue
    end          
  end
  {}
end