jnunemaker/flipper — pull request #22 by ryanlower (2013-02-28 03:38:31+00:00)
Title: Allow setting of feature state defaults that are used when the adapter is down

Motivation: when using the redis adapter we don't want redis down-ness to cause application down-ness . Obviously we could wrap & rescue all our `.enabled?` calls (or patch the adapter etc) but it seemed that this might be something other people find useful

This is a initial stab at adding this functionality:
```ruby
flipper = Flipper.new adapter
flipper.feature_defaults = { stats: true }

flipper[:stats].enabled? # will return true if adapter.get raises
flipper[:search].enabled? # will raise if adapter.get raises
```

Another direction would be to add a something that wraps a regular adapter. Something like:
```ruby
redis_adapter = Fliper::Adapters::Redis.new(...)
adapter = Flipper::RescueAndDefault.new(redis_adapter,
defaults: { stats: true })
```

Alternatively perhaps this is too use case specific and shouldn't be included in the core gem?