From 235fe67bdbc7f177a6f4b213bb1780f043944246 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Thu, 7 Feb 2019 14:38:32 +0000 Subject: Move the ee? helper method into the helper --- danger/changelog/Dangerfile | 6 +----- danger/plugins/helper.rb | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/danger/changelog/Dangerfile b/danger/changelog/Dangerfile index 530c6638653..63b2f6f5c5c 100644 --- a/danger/changelog/Dangerfile +++ b/danger/changelog/Dangerfile @@ -16,16 +16,12 @@ consider adding any of the %s labels. #{SEE_DOC} MSG -def ee? - ENV['CI_PROJECT_NAME'] == 'gitlab-ee' || File.exist?('../../CHANGELOG-EE.md') -end - def ee_changelog?(changelog_path) changelog_path =~ /unreleased-ee/ end def ce_port_changelog?(changelog_path) - ee? && !ee_changelog?(changelog_path) + helper.ee? && !ee_changelog?(changelog_path) end def check_changelog(path) diff --git a/danger/plugins/helper.rb b/danger/plugins/helper.rb index 1a2710463ad..09ee50a2ef0 100644 --- a/danger/plugins/helper.rb +++ b/danger/plugins/helper.rb @@ -31,6 +31,11 @@ module Danger .sort end + # @return [Boolean] + def ee? + ENV['CI_PROJECT_NAME'] == 'gitlab-ee' || File.exist?('../../CHANGELOG-EE.md') + end + # @return [Hash>] def changes_by_category all_changed_files.inject(Hash.new { |h, k| h[k] = [] }) do |hsh, file| -- cgit v1.2.1