Sha256: b7f30aee8f31396080c254715cb46a6c65b2f5395074ed190efc872f577a7938
Contents?: true
Size: 593 Bytes
Versions: 19
Compression:
Stored size: 593 Bytes
Contents
# frozen_string_literal: true require "lightly" module Mihari class Cache DEFAULT_CACHE_DIR = "/tmp/mihari" def initialize @data = Lightly.new(life: "7d", dir: DEFAULT_CACHE_DIR) end def cached?(key) return false unless @data.enabled? begin @data.cached? key rescue Errno::ENOENT => _e false end end def save(*keys) return unless @data.enabled? begin keys.flatten.each do |key| @data.save key, true end rescue Errno::ENOENT => _e nil end end end end
Version data entries
19 entries across 19 versions & 1 rubygems