Sha256: 085a8d7d91baa31aa367fd00f25c9aab557a73db00154727fb85b9c7d72be717

Contents?: true

Size: 630 Bytes

Versions: 19

Compression:

Stored size: 630 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/mongo'
Mongo::Logger.logger.level = Logger::INFO
collection = Mongo::Client.new(["127.0.0.1:#{ENV["BOXEN_MONGODB_PORT"] || 27017}"], :database => 'testing')['flipper']
adapter = Flipper::Adapters::Mongo.new(collection)
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-mongo-0.11.0.beta3 examples/mongo/basic.rb
flipper-mongo-0.11.0.beta1 examples/mongo/basic.rb
flipper-mongo-0.10.2 examples/mongo/basic.rb
flipper-mongo-0.10.1 examples/mongo/basic.rb
flipper-mongo-0.10.0 examples/mongo/basic.rb
flipper-mongo-0.9.2 examples/mongo/basic.rb
flipper-mongo-0.9.1 examples/mongo/basic.rb
flipper-mongo-0.9.0 examples/mongo/basic.rb
flipper-mongo-0.9.0.beta1 examples/mongo/basic.rb
flipper-mongo-0.8.0 examples/mongo/basic.rb
flipper-mongo-0.7.5 examples/mongo/basic.rb
flipper-mongo-0.7.4 examples/mongo/basic.rb
flipper-mongo-0.7.3 examples/mongo/basic.rb
flipper-mongo-0.7.2 examples/mongo/basic.rb
flipper-mongo-0.7.1 examples/mongo/basic.rb
flipper-mongo-0.7.0 examples/mongo/basic.rb
flipper-mongo-0.7.0.beta6 examples/mongo/basic.rb
flipper-mongo-0.7.0.beta5 examples/mongo/basic.rb
flipper-mongo-0.7.0.beta4 examples/mongo/basic.rb