diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-01 15:11:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-01 15:11:01 +0300 |
commit | 08b3b98051f56cfc1774db5c92c183cf33ed8bdd (patch) | |
tree | d93e764b9ac3fd30eaf827a1017fbb40a7abf40c /lib/atlassian/jira_issue_key_extractor.rb | |
parent | a928c5170fa58e4aef91ebca6c4fc9ec7cea812e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/atlassian/jira_issue_key_extractor.rb')
-rw-r--r-- | lib/atlassian/jira_issue_key_extractor.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/atlassian/jira_issue_key_extractor.rb b/lib/atlassian/jira_issue_key_extractor.rb new file mode 100644 index 00000000000..f1b432787ac --- /dev/null +++ b/lib/atlassian/jira_issue_key_extractor.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Atlassian + class JiraIssueKeyExtractor + def self.has_keys?(*text) + new(*text).issue_keys.any? + end + + def initialize(*text) + @text = text.join(' ') + end + + def issue_keys + @text.scan(Gitlab::Regex.jira_issue_key_regex).uniq + end + end +end |