Sha256: c7e8c5717db7a655f6446bfe4687862fc8382e227b1884a3a47289d316b661f8

Contents?: true

Size: 575 Bytes

Versions: 21

Compression:

Stored size: 575 Bytes

Contents

require 'pathname'
require 'logger'

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

require 'redis'
require 'rollout'
require 'flipper'
require 'flipper/adapters/rollout'

redis = Redis.new
rollout = Rollout.new(redis)
rollout.activate(:stats)

adapter = Flipper::Adapters::Rollout.new(rollout)
flipper = Flipper.new(adapter)

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

rollout.deactivate(:stats)

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

Version data entries

21 entries across 21 versions & 1 rubygems

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