-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement feature grouping and translations. Closes #17.
- Loading branch information
1 parent
590f2ae
commit 51cc858
Showing
31 changed files
with
816 additions
and
266 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
## 2.3.0 | ||
|
||
* Support for Rails API only apps. | ||
* Features can now be grouped in the dashboard. | ||
* Features can now be added to Rails engines and loaded with an initializer. | ||
* The dashboard (including features and strategies) can be translated. | ||
* Removed Rails asset pipeline dependency. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
en: | ||
flipflop: | ||
title: "%{application} Features" | ||
feature: "Feature" | ||
description: "Description" | ||
|
||
feature_states: | ||
enabled: "on" | ||
disabled: "off" | ||
|
||
clear: "clear" | ||
|
||
# You can optionally translate the names of the chosen features, feature | ||
# groups and strategies: | ||
|
||
groups: | ||
default: "Other features" | ||
|
||
# groups: | ||
# design_improvements: "Design improvements" | ||
|
||
# features: | ||
# world_domination: "World domination" | ||
# world_domination_description: "Take over the world!" | ||
|
||
# strategies: | ||
# cookie: "Cookie" | ||
# active_record: "Active record" | ||
# default: "Default" | ||
# lambda: "Lambda" | ||
# query_string: "Query string" | ||
# redis: "Redis" | ||
# session: "Session" | ||
# test: "Test" |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
module Flipflop | ||
class FeatureDefinition | ||
attr_reader :key, :default, :description | ||
attr_reader :key, :name, :title, :description, :default, :group | ||
|
||
def initialize(key, **options) | ||
@key = key | ||
@name = @key.to_s.freeze | ||
@title = @name.humanize.freeze | ||
@description = options.delete(:description).freeze | ||
@default = !!options.delete(:default) || false | ||
@description = options.delete(:description) || key.to_s.humanize + "." | ||
end | ||
|
||
def name | ||
key.to_s | ||
@group = options.delete(:group).freeze | ||
end | ||
end | ||
end |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Flipflop | ||
class GroupDefinition | ||
attr_reader :key, :name, :title | ||
|
||
def initialize(key) | ||
@key = key | ||
@name = @key.to_s.freeze | ||
@title = @name.humanize.freeze | ||
end | ||
end | ||
end |
This file contains 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
Oops, something went wrong.