class FeatureFlagFactory
Constants
- FEATURES_FOR_DEVELOPMENT
Public Class Methods
Source
# File app/lib/feature_flag_factory.rb, line 4 def self.call names = YAML.safe_load( File.read(Rails.root.join("config/feature_flags.yml")) ).keys Flipper::Adapters::Strict.with_sync_mode do names.each { Flipper.add(it) unless Flipper.exist?(it) } end Flipper.features.each do |feature| feature.remove unless feature.name.to_s.in?(names) end end
Source
# File app/lib/feature_flag_factory.rb, line 25 def self.enable_for_development!(check_rails_env: true) if check_rails_env && !(Rails.env.development? || Rails.env.end_to_end?) raise "These flags should only be enabled in development or end_to_end." end FEATURES_FOR_DEVELOPMENT.each { Flipper.enable(it) } end