Sha256: 9574ab01717a08cbe9c251498bffb57fdcb56ff02f691110a1f1b7089e563657

Contents?: true

Size: 668 Bytes

Versions: 19

Compression:

Stored size: 668 Bytes

Contents

class Card
  class Cache
    # pre-populate cache for testing purposes
    module Prepopulate
      def restore
        reset_soft
        prepopulate
      end

      private

      def prepopulate
        return unless @prepopulating
        soft = Card.cache.soft
        @rule_cache ||= Card.rule_cache
        @user_ids_cache ||= Card.user_ids_cache
        @read_rule_cache ||= Card.read_rule_cache
        @rule_keys_cache ||= Card.rule_keys_cache
        soft.write "RULES", @rule_cache
        soft.write "READRULES", @read_rule_cache
        soft.write "USER_IDS", @user_ids_cache
        soft.write "RULE_KEYS", @rule_keys_cache
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
card-1.93.1 lib/card/cache/prepopulate.rb
card-1.93.0 lib/card/cache/prepopulate.rb
card-1.92.2 lib/card/cache/prepopulate.rb
card-1.92.1 lib/card/cache/prepopulate.rb
card-1.92 lib/card/cache/prepopulate.rb
card-1.91 lib/card/cache/prepopulate.rb
card-1.21.0 lib/card/cache/prepopulate.rb
card-1.20.4 lib/card/cache/prepopulate.rb
card-1.20.3 lib/card/cache/prepopulate.rb
card-1.20.2 lib/card/cache/prepopulate.rb
card-1.20.1 lib/card/cache/prepopulate.rb
card-1.20.0 lib/card/cache/prepopulate.rb
card-1.19.6 lib/card/cache/prepopulate.rb
card-1.19.5 lib/card/cache/prepopulate.rb
card-1.19.4 lib/card/cache/prepopulate.rb
card-1.19.3 lib/card/cache/prepopulate.rb
card-1.19.2 lib/card/cache/prepopulate.rb
card-1.19.1 lib/card/cache/prepopulate.rb
card-1.19.0 lib/card/cache/prepopulate.rb