Sha256: 6eb89e321d938d3dea8da9cb8c3a724e0cf88fd5293eaa30ca8ece58009df374

Contents?: true

Size: 570 Bytes

Versions: 4

Compression:

Stored size: 570 Bytes

Contents

module ManabuDesktop
  module Util
    class Cache
      @@cache_path_override = nil

      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

      def self.cache_path()
        @@cache_path_override || ENV['MANABU_DESKTOP_CACHE'] || "#{ENV['HOME']}/.manabu-desktop/"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
manabu-desktop-0.0.5 lib/util/cache.rb
manabu-desktop-0.0.4 lib/util/cache.rb
manabu-desktop-0.0.3 lib/util/cache.rb
manabu-desktop-0.0.2 lib/util/cache.rb