Last active
September 11, 2019 16:30
-
-
Save yodarjun/afe54709534e8afec8ec87da2bce2f60 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/rollout.rb | |
ROLLOUT_OPTIONS = YAML.load_file(Rails.root.join(“config”, “rollout.yml”))[Rails.env] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
# existing code | |
if Rollout.active?('my_new_feature_1') | |
# implement new feature code here | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/rollout.rb | |
class Rollout | |
def self.active?(key) | |
ROLLOUT_OPTIONS[key] || false | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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