Sha256: f91aa0bc5216651629d3e4fd854bc1e4f3a5afa092dbca6e28a1d7f31aa192b8
Contents?: true
Size: 1.07 KB
Versions: 27
Compression:
Stored size: 1.07 KB
Contents
class Card class Cache # pre-populate cache for testing purposes module Prepopulate def restore reset_soft prepopulate end private def prepopulate? Cardio.config.prepopulate_cache end def prepopulate return unless prepopulate? prepopulate_rule_caches # prepopulate_lexicon_caches end def prepopulate_cache variable @prepopulated ||= {} value = @prepopulated[variable] ||= yield Card.cache.soft.write variable, value.clone end # def prepopulate_lexicon_caches # end def prepopulate_rule_caches prepopulate_cache("RULES") { Card::Rule.rule_cache } prepopulate_cache("READRULES") { Card::Rule.read_rule_cache } prepopulate_cache("PREFERENCES") { Card::Rule.preference_cache } end # def prepopulate_card_cache # prepopulate_cache "ALL_CARDS" do # Card.find_each do |card| # Card.write_to_cache card # end # true # end # end end end end
Version data entries
27 entries across 27 versions & 1 rubygems