summaryrefslogtreecommitdiff
path: root/lib/feature.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-07-04 01:41:24 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-07-04 01:41:24 +0800
commit1cecc285cfa7dfb3c34b34f07ab0b51c2a970bde (patch)
treedb5cd7e4e9cedc03bdd402d8409fc390405a3b1b /lib/feature.rb
parent2c74e73f6f994346192acb2e723b026c2ec55f8b (diff)
parent68ac391435684352555ca5c4aca0e018face525a (diff)
downloadgitlab-ce-add-ci_variables-environment_scope.tar.gz
Merge remote-tracking branch 'upstream/master' into add-ci_variables-environment_scopeadd-ci_variables-environment_scope
* upstream/master: (79 commits) Reset @full_path to nil when cache expires add margin between captcha and register button Eagerly create a milestone that is used in a feature spec Adjust readme repo width Resolve "Issue Board -> "Remove from board" button when viewing an issue gives js error and fails" Fix rubocop offenses Make entrypoint and command keys to be array of strings Add issuable-list class to shared mr/issue lists to fix new responsive layout New navigation breadcrumbs Restore timeago translations in renderTimeago. Fix curl example paths (missing the 'files' segment) Automatically hide sidebar on smaller screens Fix typo in IssuesFinder comment Remove placeholder note when award emoji slash command is applied Make setSidebarHeight more efficient with SidebarHeightManager. Update CHANGELOG.md for 9.3.3 Resolve "More actions dropdown hidden by end of diff" Use Gitaly 0.14.0 Improve support for external issue references Make issuables_count_for_state public ...
Diffstat (limited to 'lib/feature.rb')
-rw-r--r--lib/feature.rb22
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index d3d972564af..363f66ba60e 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -12,6 +12,8 @@ class Feature
end
class << self
+ delegate :group, to: :flipper
+
def all
flipper.features.to_a
end
@@ -27,16 +29,24 @@ class Feature
all.map(&:name).include?(feature.name)
end
- def enabled?(key)
- get(key).enabled?
+ def enabled?(key, thing = nil)
+ get(key).enabled?(thing)
+ end
+
+ def enable(key, thing = true)
+ get(key).enable(thing)
+ end
+
+ def disable(key, thing = false)
+ get(key).disable(thing)
end
- def enable(key)
- get(key).enable
+ def enable_group(key, group)
+ get(key).enable_group(group)
end
- def disable(key)
- get(key).disable
+ def disable_group(key, group)
+ get(key).disable_group(group)
end
def flipper