Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
37d8f324
Commit
37d8f324
authored
Aug 23, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE-specific lines from Gitlab::Email::Handler
parent
fdaeeec0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
10 deletions
+40
-10
ee/lib/ee/gitlab/email/handler.rb
ee/lib/ee/gitlab/email/handler.rb
+23
-0
lib/gitlab/email/handler.rb
lib/gitlab/email/handler.rb
+16
-9
spec/lib/gitlab/email/handler_spec.rb
spec/lib/gitlab/email/handler_spec.rb
+1
-1
No files found.
ee/lib/ee/gitlab/email/handler.rb
0 → 100644
View file @
37d8f324
require
'gitlab/email/handler/ee/service_desk_handler'
module
EE
module
Gitlab
module
Email
module
Handler
extend
ActiveSupport
::
Concern
class_methods
do
extend
::
Gitlab
::
Utils
::
Override
override
:load_handlers
def
load_handlers
[
::
Gitlab
::
Email
::
Handler
::
EE
::
ServiceDeskHandler
,
*
super
]
end
end
end
end
end
end
lib/gitlab/email/handler.rb
View file @
37d8f324
...
...
@@ -3,21 +3,28 @@ require 'gitlab/email/handler/create_note_handler'
require
'gitlab/email/handler/create_issue_handler'
require
'gitlab/email/handler/unsubscribe_handler'
require
'
gitlab/email/handler/ee/service_desk_
handler'
require
'
ee/gitlab/email/
handler'
module
Gitlab
module
Email
module
Handler
HANDLERS
=
[
EE
::
ServiceDeskHandler
,
prepend
::
EE
::
Gitlab
::
Email
::
Handler
def
self
.
handlers
@handlers
||=
load_handlers
end
def
self
.
load_handlers
[
UnsubscribeHandler
,
CreateNoteHandler
,
CreateMergeRequestHandler
,
CreateIssueHandler
].
freeze
]
end
def
self
.
for
(
mail
,
mail_key
)
HANDLERS
.
find
do
|
klass
|
handlers
.
find
do
|
klass
|
handler
=
klass
.
new
(
mail
,
mail_key
)
break
handler
if
handler
.
can_handle?
end
...
...
spec/lib/gitlab/email/handler_spec.rb
View file @
37d8f324
...
...
@@ -40,7 +40,7 @@ describe Gitlab::Email::Handler do
end
def
ce_handlers
@ce_handlers
||=
Gitlab
::
Email
::
Handler
::
HANDLERS
.
reject
do
|
handler
|
@ce_handlers
||=
Gitlab
::
Email
::
Handler
.
handlers
.
reject
do
|
handler
|
handler
.
name
.
start_with?
(
'Gitlab::Email::Handler::EE::'
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment