Sha256: 76053a6c8d9f823f3c88b9d2637e0856c11a40a5b4844039af7ae07b37249811

Contents?: true

Size: 577 Bytes

Versions: 19

Compression:

Stored size: 577 Bytes

Contents

require 'pathname'
require 'logger'

root_path = Pathname(__FILE__).dirname.join('..').expand_path
lib_path  = root_path.join('lib')
$:.unshift(lib_path)

require 'flipper/adapters/redis'
options = {}
if ENV['BOXEN_REDIS_URL']
  options[:url] = ENV['BOXEN_REDIS_URL']
end
client = Redis.new(options)
adapter = Flipper::Adapters::Redis.new(client)
flipper = Flipper.new(adapter)

flipper[:stats].enable

if flipper[:stats].enabled?
  puts "Enabled!"
else
  puts "Disabled!"
end

flipper[:stats].disable

if flipper[:stats].enabled?
  puts "Enabled!"
else
  puts "Disabled!"
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
flipper-redis-0.11.0.beta3 examples/redis/basic.rb
flipper-redis-0.11.0.beta1 examples/redis/basic.rb
flipper-redis-0.10.2 examples/redis/basic.rb
flipper-redis-0.10.1 examples/redis/basic.rb
flipper-redis-0.10.0 examples/redis/basic.rb
flipper-redis-0.9.2 examples/redis/basic.rb
flipper-redis-0.9.1 examples/redis/basic.rb
flipper-redis-0.9.0 examples/redis/basic.rb
flipper-redis-0.9.0.beta1 examples/redis/basic.rb
flipper-redis-0.8.0 examples/redis/basic.rb
flipper-redis-0.7.5 examples/redis/basic.rb
flipper-redis-0.7.4 examples/redis/basic.rb
flipper-redis-0.7.3 examples/redis/basic.rb
flipper-redis-0.7.2 examples/redis/basic.rb
flipper-redis-0.7.1 examples/redis/basic.rb
flipper-redis-0.7.0 examples/redis/basic.rb
flipper-redis-0.7.0.beta6 examples/redis/basic.rb
flipper-redis-0.7.0.beta5 examples/redis/basic.rb
flipper-redis-0.7.0.beta4 examples/redis/basic.rb