diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /rubocop/code_reuse_helpers.rb | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'rubocop/code_reuse_helpers.rb')
-rw-r--r-- | rubocop/code_reuse_helpers.rb | 16 |
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 |