module Flipper::UI
Constants
- Error
All flipper ui errors inherit from this.
- RequestMethodNotSupported
Raised when a request method (get, post, etc.) is called for an action that does not know how to handle it.
Public Class Methods
app(flipper = nil, options = {}) { |builder| ... }
click to toggle source
# File lib/flipper/ui.rb, line 39 def self.app(flipper = nil, options = {}) env_key = options.fetch(:env_key, 'flipper') rack_protection_options = options.fetch(:rack_protection, use: :authenticity_token) app = ->(_) { [200, { 'Content-Type' => 'text/html' }, ['']] } builder = Rack::Builder.new yield builder if block_given? builder.use Rack::Protection, rack_protection_options builder.use Rack::MethodOverride builder.use Flipper::Middleware::SetupEnv, flipper, env_key: env_key builder.use Flipper::UI::Middleware, flipper: flipper, env_key: env_key builder.run app klass = self builder.define_singleton_method(:inspect) { klass.inspect } # pretty rake routes output builder end
configuration()
click to toggle source
# File lib/flipper/ui.rb, line 61 def self.configuration @configuration ||= ::Flipper::UI::Configuration.new end
configure() { |configuration| ... }
click to toggle source
Public: yields configuration instance for customizing UI
text
# File lib/flipper/ui.rb, line 57 def self.configure yield(configuration) end
root()
click to toggle source
# File lib/flipper/ui.rb, line 35 def self.root @root ||= Pathname(__FILE__).dirname.expand_path.join('ui') end