Sha256: 37ab061072b4eb98f8785174f78a3071d6825771aff4a08630b784b45e88f1b2

Contents?: true

Size: 919 Bytes

Versions: 37

Compression:

Stored size: 919 Bytes

Contents

module Sass
  module CacheStores
    # A cache store that wraps an ActiveSupport cache store.
    # This is useful for integrating with an app that uses ActiveSupport,
    # or for taking advantage of the wide variety of ActiveSupport cache backends.
    #
    # This is automatically used within Rails.
    class ActiveSupport < Base
      # @param store [::ActiveSupport::Cache::Store] The cache store to wrap.
      def initialize(store)
        @store = store
      end

      # @see Base#_retrieve
      def _retrieve(key, version, sha)
        return unless val = @store.fetch('_sass/' + key)
        return unless val[:version] == version
        return unless val[:sha] == sha
        return val[:contents]
      end

      # @see Base#_store
      def _store(key, version, sha, contents)
        @store.write('_sass/' + key, :version => version, :sha => sha, :contents => contents)
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
haml-3.1.0 vendor/sass/lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.262 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.261 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.259 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.256 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.254 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.253 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.252 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.249 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.246 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.221 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.218 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.217 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.216 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.212 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.214 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.210 lib/sass/cache_stores/active_support.rb
haml-3.1.0.alpha.147 vendor/sass/lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.206 lib/sass/cache_stores/active_support.rb
sass-3.1.0.alpha.205 lib/sass/cache_stores/active_support.rb