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 'rubocop/code_reuse_helpers.rb')
-rw-r--r--rubocop/code_reuse_helpers.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/rubocop/code_reuse_helpers.rb b/rubocop/code_reuse_helpers.rb
index 6ea12999cae..45cfa7ba78d 100644
--- a/rubocop/code_reuse_helpers.rb
+++ b/rubocop/code_reuse_helpers.rb
@@ -1,7 +1,15 @@
# frozen_string_literal: true
+require 'forwardable'
+
+require_relative '../lib/gitlab_edition'
+
module RuboCop
module CodeReuseHelpers
+ extend Forwardable
+
+ def_delegators :GitlabEdition, :ee?, :jh?
+
# Returns true for a `(send const ...)` node.
def send_to_constant?(node)
node.type == :send && node.children&.first&.type == :const
@@ -180,13 +188,5 @@ module RuboCop
def rails_root
File.expand_path('..', __dir__)
end
-
- def ee?
- File.exist?(File.expand_path('../ee/app/models/license.rb', __dir__)) && !%w[true 1].include?(ENV['FOSS_ONLY'].to_s)
- end
-
- def jh?
- ee? && Dir.exist?(File.expand_path('../jh', __dir__)) && !%w[true 1].include?(ENV['EE_ONLY'].to_s)
- end
end
end