2020-09-16 14:09:47 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
class Gitpod
|
|
|
|
class << self
|
|
|
|
def feature_available?
|
|
|
|
# The gitpod_bundle feature could be conditionally applied, so check if `!off?`
|
2020-10-06 14:08:49 -04:00
|
|
|
!feature.off? || feature_enabled?
|
2020-09-16 14:09:47 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def feature_enabled?(actor = nil)
|
2020-10-06 14:08:49 -04:00
|
|
|
Feature.enabled?(:gitpod, actor, default_enabled: true)
|
2020-09-16 14:09:47 -04:00
|
|
|
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
|