Skip to content

Instantly share code, notes, and snippets.

@skatkov
Forked from yodarjun/config-rollout.rb
Created December 4, 2025 15:35
Show Gist options
  • Select an option

  • Save skatkov/5411017b02d53fe125956be55d23e9a2 to your computer and use it in GitHub Desktop.

Select an option

Save skatkov/5411017b02d53fe125956be55d23e9a2 to your computer and use it in GitHub Desktop.
# config/initializers/rollout.rb
ROLLOUT_OPTIONS = YAML.load_file(Rails.root.join(“config”, “rollout.yml”))[Rails.env]
...
# existing code
if Rollout.active?('my_new_feature_1')
# implement new feature code here
end
# lib/rollout.rb
class Rollout
def self.active?(key)
ROLLOUT_OPTIONS[key] || false
end
end
# config/rollout.yml
development:
my_new_feature_1: true
my_new_feature_2: true
test:
my_new_feature_1: true
my_new_feature_2: true
production:
my_new_feature_1: false
my_new_feature_2: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment