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
74616ece
Commit
74616ece
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
a3382bab
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
lib/gitlab/email/handler.rb
lib/gitlab/email/handler.rb
+13
-7
spec/lib/gitlab/email/handler_spec.rb
spec/lib/gitlab/email/handler_spec.rb
+1
-1
No files found.
lib/gitlab/email/handler.rb
View file @
74616ece
...
...
@@ -6,15 +6,21 @@ require 'gitlab/email/handler/unsubscribe_handler'
module
Gitlab
module
Email
module
Handler
HANDLERS
=
[
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 @
74616ece
...
...
@@ -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