Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create install script #32

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions feature_flagger.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "fakeredis"
spec.add_development_dependency "rails", "~> 4.2.2"
end
16 changes: 16 additions & 0 deletions lib/generators/feature_flagger/install/install_generator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'rails/generators'
module FeatureFlagger
module Generators
class InstallGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)

def generate_rollout
copy_file "rollout.yml", "#{Rails.root}/config/rollout.yml"
end

def generate_feature_flagger
copy_file "feature_flagger.rb", "#{Rails.root}/config/initializers/feature_flagger.rb"
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# File for Feature Flagger configure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File for Feature Flagger configuration

# https://github.com/ResultadosDigitais/feature_flagger#configuration

# require 'redis-namespace'
require 'feature_flagger'

FeatureFlagger.configure do |config|
# namespaced = ::Redis::Namespace.new("feature_flagger", redis: $redis)
# config.storage = FeatureFlagger::Storage::Redis.new(namespaced)
end
2 changes: 2 additions & 0 deletions lib/generators/feature_flagger/install/templates/rollout.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Add here declare a rollout.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Add here your rollout settings.
#
# Example:
#
# user:
#   account_settings:
#     language_options:
#       description: "When this rollout is active the user can see language options Account page."
#
# More info: https://github.com/ResultadosDigitais/feature_flagger#configuration

# https://github.com/ResultadosDigitais/feature_flagger#configuration