BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
863d8e5a
Commit
863d8e5a
authored
May 23, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use split and try to unify error raising
parent
c64cd113
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
create_issue_handler.rb
lib/gitlab/email/handler/create_issue_handler.rb
+9
-9
create_note_handler.rb
lib/gitlab/email/handler/create_note_handler.rb
+1
-1
receiver.rb
lib/gitlab/email/receiver.rb
+0
-2
No files found.
lib/gitlab/email/handler/create_issue_handler.rb
View file @
863d8e5a
...
...
@@ -5,8 +5,16 @@ module Gitlab
module
Email
module
Handler
class
CreateIssueHandler
<
BaseHandler
attr_reader
:project_namespace
,
:authentication_token
def
initialize
(
mail
,
mail_key
)
super
(
mail
,
mail_key
)
@project_namespace
,
@authentication_token
=
mail_key
&&
mail_key
.
split
(
'+'
,
2
)
end
def
can_handle?
!!
project
!!
(
project_namespace
&&
project
)
end
def
execute
...
...
@@ -28,14 +36,6 @@ module Gitlab
end
private
def
authentication_token
mail_key
[
/[^\+]+$/
]
end
def
project_namespace
mail_key
[
/^[^\+]+/
]
end
def
create_issue
Issues
::
CreateService
.
new
(
project
,
...
...
lib/gitlab/email/handler/create_note_handler.rb
View file @
863d8e5a
...
...
@@ -6,7 +6,7 @@ module Gitlab
module
Handler
class
CreateNoteHandler
<
BaseHandler
def
can_handle?
!!
sent_notification
!!
(
mail_key
&&
sent_notification
)
end
def
execute
...
...
lib/gitlab/email/receiver.rb
View file @
863d8e5a
...
...
@@ -28,8 +28,6 @@ module Gitlab
mail
=
build_mail
mail_key
=
extract_mail_key
(
mail
)
raise
SentNotificationNotFoundError
unless
mail_key
if
handler
=
Handler
.
for
(
mail
,
mail_key
)
handler
.
execute
elsif
mail_key
=~
%r{/|
\+
}
...
...
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