Sha256: 07c923cdc60defa2bd6bfd991cecbddb5b7520749f8334aa2d613a400555fd8a

Contents?: true

Size: 565 Bytes

Versions: 31

Compression:

Stored size: 565 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['REDIS_URL']
  options[:url] = ENV['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

31 entries across 31 versions & 1 rubygems

Version Path
flipper-redis-0.20.4 examples/redis/basic.rb
flipper-redis-0.20.3 examples/redis/basic.rb
flipper-redis-0.20.2 examples/redis/basic.rb
flipper-redis-0.20.1 examples/redis/basic.rb
flipper-redis-0.20.0 examples/redis/basic.rb
flipper-redis-0.20.0.beta3 examples/redis/basic.rb
flipper-redis-0.20.0.beta2 examples/redis/basic.rb
flipper-redis-0.20.0.beta1 examples/redis/basic.rb
flipper-redis-0.19.1 examples/redis/basic.rb
flipper-redis-0.19.0 examples/redis/basic.rb
flipper-redis-0.18.0 examples/redis/basic.rb
flipper-redis-0.17.2 examples/redis/basic.rb
flipper-redis-0.17.1 examples/redis/basic.rb
flipper-redis-0.16.2 examples/redis/basic.rb
flipper-redis-0.16.1 examples/redis/basic.rb
flipper-redis-0.16.0 examples/redis/basic.rb
flipper-redis-0.15.0 examples/redis/basic.rb
flipper-redis-0.14.0 examples/redis/basic.rb
flipper-redis-0.13.0 examples/redis/basic.rb
flipper-redis-0.13.0.beta1 examples/redis/basic.rb