Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add some enabled features for example

  • Loading branch information...
commit c6dbc027be04cb3f50f63822690b96eeac36c061 1 parent 4e4c296
@jnunemaker authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 examples/basic.ru
View
8 examples/basic.ru
@@ -10,9 +10,17 @@ $:.unshift(lib_path)
require 'flipper-ui'
require 'flipper/adapters/memory'
+Flipper.register(:admins) { |actor| actor.admin? }
+
adapter = Flipper::Adapters::Memory.new({})
flipper = Flipper.new(adapter)
+flipper[:search_performance].enable
+flipper[:gauges_tracking].enable
+flipper[:secrets].enable flipper.group(:admins)
+flipper[:logging].enable flipper.random(5)
+flipper[:new_cache].enable flipper.actors(15)
+
use Flipper::UI::Middleware, flipper
run lambda { |env|
[200, {'Content-Type' => 'text/html'}, ['Go here for <a href="/flipper">Flipper!</a>']]
Please sign in to comment.
Something went wrong with that request. Please try again.