Sha256: 535a5eef26e250a7d182e4f0712781fdd37603a4e61c71bf1984623afcc31648

Contents?: true

Size: 1.92 KB

Versions: 10

Compression:

Stored size: 1.92 KB

Contents

#
# Usage:
#   # if you want it to not reload and be really fast
#   bin/rackup examples/ui/basic.ru -p 9999
#
#   # if you want reloading
#   bin/shotgun examples/ui/basic.ru -p 9999
#
#   http://localhost:9999/
#
require 'bundler/setup'
require "flipper/ui"
require "flipper/adapters/pstore"

Flipper.register(:admins) { |actor|
  actor.respond_to?(:admin?) && actor.admin?
}

Flipper.register(:early_access) { |actor|
  actor.respond_to?(:early?) && actor.early?
}

Flipper::UI.configure do |config|
  # config.banner_text = 'Production Environment'
  # config.banner_class = 'danger'
  config.feature_creation_enabled = true
  config.feature_removal_enabled = true
  config.cloud_recommendation = true
  # config.show_feature_description_in_list = true
  config.descriptions_source = lambda do |_keys|
    {
      "search_performance_another_long_thing" => "Just to test feature name length.",
      "gauges_tracking" => "Should we track page views with gaug.es.",
      "unused" => "Not used.",
      "suits" => "Are suits necessary in business?",
      "secrets" => "Secrets are lies.",
      "logging" => "Log all the things.",
      "new_cache" => "Like the old cache but newer.",
      "a/b" => "Why would someone use a slash? I don't know but someone did. Let's make this really long so they regret using slashes. Please don't use slashes.",
    }
  end
end

# You can uncomment these to get some default data:
# Flipper.enable(:search_performance_another_long_thing)
# Flipper.disable(:gauges_tracking)
# Flipper.disable(:unused)
# Flipper.enable_actor(:suits, Flipper::Actor.new('1'))
# Flipper.enable_actor(:suits, Flipper::Actor.new('6'))
# Flipper.enable_group(:secrets, :admins)
# Flipper.enable_group(:secrets, :early_access)
# Flipper.enable_percentage_of_time(:logging, 5)
# Flipper.enable_percentage_of_actors(:new_cache, 15)
# Flipper.add("a/b")

run Flipper::UI.app { |builder|
  builder.use Rack::Session::Cookie, secret: "_super_secret"
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
flipper-ui-0.25.2 examples/ui/basic.ru
flipper-ui-0.25.1 examples/ui/basic.ru
flipper-ui-0.25.0 examples/ui/basic.ru
flipper-ui-0.24.1 examples/ui/basic.ru
flipper-ui-0.24.0 examples/ui/basic.ru
flipper-ui-0.23.1 examples/ui/basic.ru
flipper-ui-0.23.0 examples/ui/basic.ru
flipper-ui-0.22.2 examples/ui/basic.ru
flipper-ui-0.22.1 examples/ui/basic.ru
flipper-ui-0.22.0 examples/ui/basic.ru