Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/gitpod.rb')
-rw-r--r--lib/gitlab/gitpod.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/gitlab/gitpod.rb b/lib/gitlab/gitpod.rb
new file mode 100644
index 00000000000..11b54db72ea
--- /dev/null
+++ b/lib/gitlab/gitpod.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+module Gitlab
+ class Gitpod
+ class << self
+ def feature_conditional?
+ feature.conditional?
+ end
+
+ def feature_available?
+ # The gitpod_bundle feature could be conditionally applied, so check if `!off?`
+ !feature.off?
+ end
+
+ def feature_enabled?(actor = nil)
+ feature.enabled?(actor)
+ end
+
+ def feature_and_settings_enabled?(actor = nil)
+ feature_enabled?(actor) && Gitlab::CurrentSettings.gitpod_enabled
+ end
+
+ private
+
+ def feature
+ Feature.get(:gitpod) # rubocop:disable Gitlab/AvoidFeatureGet
+ end
+ end
+ end
+end