Sha256: 055b899452f91c9b635e4b920b2ca5baa64862ce298d78941983625aee040518

Contents?: true

Size: 1.18 KB

Versions: 28

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true
module Sprockets
  class Cache
    # Public: A compatible cache store that doesn't store anything. Used by
    # default when no Environment#cache is configured.
    #
    # Assign the instance to the Environment#cache.
    #
    #     environment.cache = Sprockets::Cache::NullStore.new
    #
    # See Also
    #
    #   ActiveSupport::Cache::NullStore
    #
    class NullStore
      # Public: Simulate a cache miss.
      #
      # This API should not be used directly, but via the Cache wrapper API.
      #
      # key - String cache key.
      #
      # Returns nil.
      def get(key)
        nil
      end

      # Public: Simulate setting a value in the cache.
      #
      # This API should not be used directly, but via the Cache wrapper API.
      #
      # key   - String cache key.
      # value - Object value.
      #
      # Returns Object value.
      def set(key, value)
        value
      end

      # Public: Pretty inspect
      #
      # Returns String.
      def inspect
        "#<#{self.class}>"
      end

      # Public: Simulate clearing the cache
      #
      # Returns true
      def clear(options=nil)
        true
      end
    end
  end
end

Version data entries

28 entries across 27 versions & 10 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/sprockets-4.2.1/lib/sprockets/cache/null_store.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/sprockets-4.2.1/lib/sprockets/cache/null_store.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/sprockets-4.2.1/lib/sprockets/cache/null_store.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/sprockets-4.2.1/lib/sprockets/cache/null_store.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/sprockets-4.1.1/lib/sprockets/cache/null_store.rb
sprockets-4.2.1 lib/sprockets/cache/null_store.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/sprockets-4.1.1/lib/sprockets/cache/null_store.rb
sprockets-4.2.0 lib/sprockets/cache/null_store.rb
sprockets-4.1.1 lib/sprockets/cache/null_store.rb
sprockets-4.1.0 lib/sprockets/cache/null_store.rb
sprockets-4.0.3 lib/sprockets/cache/null_store.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.2/lib/sprockets/cache/null_store.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.2/lib/sprockets/cache/null_store.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/cache/null_store.rb
sprockets-4.0.2 lib/sprockets/cache/null_store.rb
sprockets-4.0.1 lib/sprockets/cache/null_store.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/sprockets-4.0.0/lib/sprockets/cache/null_store.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/sprockets-4.0.0/lib/sprockets/cache/null_store.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/null_store.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/null_store.rb