Commit 496c6165 authored by Brett Walker's avatar Brett Walker

Move constant definition

parent a4f2de79
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
module Gitlab module Gitlab
module Email module Email
module Handler module Handler
HANDLER_ACTION_BASE_REGEX = /(?<project_slug>.+)-(?<project_id>\d+)-(?<incoming_email_token>.+)/.freeze
def self.handlers def self.handlers
@handlers ||= load_handlers @handlers ||= load_handlers
end end
......
...@@ -11,7 +11,7 @@ module Gitlab ...@@ -11,7 +11,7 @@ module Gitlab
class CreateIssueHandler < BaseHandler class CreateIssueHandler < BaseHandler
include ReplyProcessing include ReplyProcessing
HANDLER_REGEX = /\A#{HANDLER_ACTION_BASE_REGEX}-issue\z/.freeze HANDLER_REGEX = /\A#{Gitlab::Email::Handler::HANDLER_ACTION_BASE_REGEX}-issue\z/.freeze
HANDLER_REGEX_LEGACY = /\A(?<project_path>[^\+]*)\+(?<incoming_email_token>.*)\z/.freeze HANDLER_REGEX_LEGACY = /\A(?<project_path>[^\+]*)\+(?<incoming_email_token>.*)\z/.freeze
def initialize(mail, mail_key) def initialize(mail, mail_key)
......
...@@ -12,7 +12,7 @@ module Gitlab ...@@ -12,7 +12,7 @@ module Gitlab
class CreateMergeRequestHandler < BaseHandler class CreateMergeRequestHandler < BaseHandler
include ReplyProcessing include ReplyProcessing
HANDLER_REGEX = /\A#{HANDLER_ACTION_BASE_REGEX}-merge-request\z/.freeze HANDLER_REGEX = /\A#{Gitlab::Email::Handler::HANDLER_ACTION_BASE_REGEX}-merge-request\z/.freeze
HANDLER_REGEX_LEGACY = /\A(?<project_path>[^\+]*)\+merge-request\+(?<incoming_email_token>.*)/.freeze HANDLER_REGEX_LEGACY = /\A(?<project_path>[^\+]*)\+merge-request\+(?<incoming_email_token>.*)/.freeze
def initialize(mail, mail_key) def initialize(mail, mail_key)
......
...@@ -6,8 +6,6 @@ module Gitlab ...@@ -6,8 +6,6 @@ module Gitlab
module ReplyProcessing module ReplyProcessing
private private
HANDLER_ACTION_BASE_REGEX = /(?<project_slug>.+)-(?<project_id>\d+)-(?<incoming_email_token>.+)/.freeze
attr_reader :project_id, :project_slug, :project_path, :incoming_email_token attr_reader :project_id, :project_slug, :project_path, :incoming_email_token
def author def author
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment