Sha256: 47c51d10f7abc9573013f4a00e08fd851cd2a92b09ef0dde34cc665d667c1272

Contents?: true

Size: 442 Bytes

Versions: 19

Compression:

Stored size: 442 Bytes

Contents

class Sfn::Loader::MemcacheCache
  def initialize(options = {})
    options = options.reverse_merge({:servers => ['127.0.0.1:11211'], :namespace => 'satisfaction', })
    @m = MemCache.new(options.delete(:servers), options)
  end
  
  def put(url, response)
    return nil if response["ETag"].blank?
    
    @m[url.to_s] = Sfn::Loader::CacheRecord.new(url, response["ETag"], response.body)
  end
  
  def get(url)
    @m[url.to_s]
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
nullstyle-ruby-satisfaction-0.4.0 lib/satisfaction/cache/memcache.rb
pius-ruby-satisfaction-0.3.0 lib/satisfaction/cache/memcache.rb
pius-ruby-satisfaction-0.4.0 lib/satisfaction/cache/memcache.rb
pius-ruby-satisfaction-0.4.1 lib/satisfaction/cache/memcache.rb
pius-ruby-satisfaction-0.4.2 lib/satisfaction/cache/memcache.rb
pius-ruby-satisfaction-0.4.3 lib/satisfaction/cache/memcache.rb
pius-ruby-satisfaction-0.4.4 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.7.5 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.7.4 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.7.3 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.7.0 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.6.7 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.6.5 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.6.4 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.6.3 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.6.2 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.6.1 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.3.0 lib/satisfaction/cache/memcache.rb
ruby-satisfaction-0.4.0 lib/satisfaction/cache/memcache.rb