No commit activity in last 3 years
No release in over 3 years
Use ActiveSupport::Cache::Store as the backend for Flipper (https://github.com/jnunemaker/flipper)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.2.0
 Project Readme

flipper-cache_store

Flipper adapter for ActiveSupport::Cache::Store children

Currently only works with Flipper 0.2.*

Installation

Add to your Gemfile:

gem 'flipper-cache_store', '~> 0.0.1'

Examples

With MemoryStore:

  cache = ActiveSupport::Cache::MemoryStore.new
  adapter = Flipper::Adapters::CacheStore.new(cache)
  Flipper.new(adapter)

Use it with your Rails cache!:

  # config/initializers/flipper.rb
  Rails.instance_eval do
    def flipper
      @flipper ||= begin
        adapter = Flipper::Adapters::CacheStore.new(Rails.cache)
        Flipper.new(adapter)
      end
    end
  end

  # elsewhere
  Rails.flipper

NOTE: if Rails.cache is an LRU cache, be warying of potential key expiration issues

TODO

Flipper 0.3 support