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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
8184ce7f
Commit
8184ce7f
authored
Aug 15, 2018
by
gfyoung
Committed by
Stan Hu
Aug 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable frozen in app/mailers/**/*.rb
parent
3a8e1fe9
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
56 additions
and
12 deletions
+56
-12
app/mailers/abuse_report_mailer.rb
app/mailers/abuse_report_mailer.rb
+2
-0
app/mailers/base_mailer.rb
app/mailers/base_mailer.rb
+2
-0
app/mailers/devise_mailer.rb
app/mailers/devise_mailer.rb
+6
-3
app/mailers/email_rejection_mailer.rb
app/mailers/email_rejection_mailer.rb
+2
-0
app/mailers/emails/issues.rb
app/mailers/emails/issues.rb
+2
-0
app/mailers/emails/members.rb
app/mailers/emails/members.rb
+2
-0
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+2
-0
app/mailers/emails/notes.rb
app/mailers/emails/notes.rb
+2
-0
app/mailers/emails/pages_domains.rb
app/mailers/emails/pages_domains.rb
+2
-0
app/mailers/emails/pipelines.rb
app/mailers/emails/pipelines.rb
+5
-3
app/mailers/emails/profile.rb
app/mailers/emails/profile.rb
+2
-0
app/mailers/emails/projects.rb
app/mailers/emails/projects.rb
+2
-0
app/mailers/notify.rb
app/mailers/notify.rb
+10
-6
app/mailers/previews/devise_mailer_preview.rb
app/mailers/previews/devise_mailer_preview.rb
+2
-0
app/mailers/previews/email_rejection_mailer_preview.rb
app/mailers/previews/email_rejection_mailer_preview.rb
+2
-0
app/mailers/previews/notify_preview.rb
app/mailers/previews/notify_preview.rb
+2
-0
app/mailers/previews/repository_check_mailer_preview.rb
app/mailers/previews/repository_check_mailer_preview.rb
+2
-0
app/mailers/repository_check_mailer.rb
app/mailers/repository_check_mailer.rb
+2
-0
changelogs/unreleased/frozen-string-enable-app-mailers.yml
changelogs/unreleased/frozen-string-enable-app-mailers.yml
+5
-0
No files found.
app/mailers/abuse_report_mailer.rb
View file @
8184ce7f
# frozen_string_literal: true
class
AbuseReportMailer
<
BaseMailer
class
AbuseReportMailer
<
BaseMailer
def
notify
(
abuse_report_id
)
def
notify
(
abuse_report_id
)
return
unless
deliverable?
return
unless
deliverable?
...
...
app/mailers/base_mailer.rb
View file @
8184ce7f
# frozen_string_literal: true
class
BaseMailer
<
ActionMailer
::
Base
class
BaseMailer
<
ActionMailer
::
Base
around_action
:render_with_default_locale
around_action
:render_with_default_locale
...
...
app/mailers/devise_mailer.rb
View file @
8184ce7f
# frozen_string_literal: true
class
DeviseMailer
<
Devise
::
Mailer
class
DeviseMailer
<
Devise
::
Mailer
default
from:
"
#{
Gitlab
.
config
.
gitlab
.
email_display_name
}
<
#{
Gitlab
.
config
.
gitlab
.
email_from
}
>"
default
from:
"
#{
Gitlab
.
config
.
gitlab
.
email_display_name
}
<
#{
Gitlab
.
config
.
gitlab
.
email_from
}
>"
default
reply_to:
Gitlab
.
config
.
gitlab
.
email_reply_to
default
reply_to:
Gitlab
.
config
.
gitlab
.
email_reply_to
...
@@ -9,8 +11,9 @@ class DeviseMailer < Devise::Mailer
...
@@ -9,8 +11,9 @@ class DeviseMailer < Devise::Mailer
protected
protected
def
subject_for
(
key
)
def
subject_for
(
key
)
subject
=
super
subject
=
[
super
]
subject
<<
" |
#{
Gitlab
.
config
.
gitlab
.
email_subject_suffix
}
"
if
Gitlab
.
config
.
gitlab
.
email_subject_suffix
.
present?
subject
<<
Gitlab
.
config
.
gitlab
.
email_subject_suffix
if
Gitlab
.
config
.
gitlab
.
email_subject_suffix
.
present?
subject
subject
.
join
(
' | '
)
end
end
end
end
app/mailers/email_rejection_mailer.rb
View file @
8184ce7f
# frozen_string_literal: true
class
EmailRejectionMailer
<
BaseMailer
class
EmailRejectionMailer
<
BaseMailer
def
rejection
(
reason
,
original_raw
,
can_retry
=
false
)
def
rejection
(
reason
,
original_raw
,
can_retry
=
false
)
@reason
=
reason
@reason
=
reason
...
...
app/mailers/emails/issues.rb
View file @
8184ce7f
# frozen_string_literal: true
module
Emails
module
Emails
module
Issues
module
Issues
def
new_issue_email
(
recipient_id
,
issue_id
,
reason
=
nil
)
def
new_issue_email
(
recipient_id
,
issue_id
,
reason
=
nil
)
...
...
app/mailers/emails/members.rb
View file @
8184ce7f
# frozen_string_literal: true
module
Emails
module
Emails
module
Members
module
Members
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
...
...
app/mailers/emails/merge_requests.rb
View file @
8184ce7f
# frozen_string_literal: true
module
Emails
module
Emails
module
MergeRequests
module
MergeRequests
def
new_merge_request_email
(
recipient_id
,
merge_request_id
,
reason
=
nil
)
def
new_merge_request_email
(
recipient_id
,
merge_request_id
,
reason
=
nil
)
...
...
app/mailers/emails/notes.rb
View file @
8184ce7f
# frozen_string_literal: true
module
Emails
module
Emails
module
Notes
module
Notes
def
note_commit_email
(
recipient_id
,
note_id
)
def
note_commit_email
(
recipient_id
,
note_id
)
...
...
app/mailers/emails/pages_domains.rb
View file @
8184ce7f
# frozen_string_literal: true
module
Emails
module
Emails
module
PagesDomains
module
PagesDomains
def
pages_domain_enabled_email
(
domain
,
recipient
)
def
pages_domain_enabled_email
(
domain
,
recipient
)
...
...
app/mailers/emails/pipelines.rb
View file @
8184ce7f
# frozen_string_literal: true
module
Emails
module
Emails
module
Pipelines
module
Pipelines
def
pipeline_success_email
(
pipeline
,
recipients
)
def
pipeline_success_email
(
pipeline
,
recipients
)
...
@@ -39,10 +41,10 @@ module Emails
...
@@ -39,10 +41,10 @@ module Emails
end
end
def
pipeline_subject
(
status
)
def
pipeline_subject
(
status
)
commit
=
@pipeline
.
short_sha
commit
=
[
@pipeline
.
short_sha
]
commit
<<
"
in
#{
@merge_request
.
to_reference
}
"
if
@merge_request
commit
<<
"in
#{
@merge_request
.
to_reference
}
"
if
@merge_request
subject
(
"Pipeline #
#{
@pipeline
.
id
}
has
#{
status
}
for
#{
@pipeline
.
ref
}
"
,
commit
)
subject
(
"Pipeline #
#{
@pipeline
.
id
}
has
#{
status
}
for
#{
@pipeline
.
ref
}
"
,
commit
.
join
(
' '
)
)
end
end
end
end
end
end
app/mailers/emails/profile.rb
View file @
8184ce7f
# frozen_string_literal: true
module
Emails
module
Emails
module
Profile
module
Profile
def
new_user_email
(
user_id
,
token
=
nil
)
def
new_user_email
(
user_id
,
token
=
nil
)
...
...
app/mailers/emails/projects.rb
View file @
8184ce7f
# frozen_string_literal: true
module
Emails
module
Emails
module
Projects
module
Projects
def
project_was_moved_email
(
project_id
,
user_id
,
old_path_with_namespace
)
def
project_was_moved_email
(
project_id
,
user_id
,
old_path_with_namespace
)
...
...
app/mailers/notify.rb
View file @
8184ce7f
# frozen_string_literal: true
class
Notify
<
BaseMailer
class
Notify
<
BaseMailer
include
ActionDispatch
::
Routing
::
PolymorphicRoutes
include
ActionDispatch
::
Routing
::
PolymorphicRoutes
include
GitlabRoutingHelper
include
GitlabRoutingHelper
...
@@ -92,12 +94,14 @@ class Notify < BaseMailer
...
@@ -92,12 +94,14 @@ class Notify < BaseMailer
# >> subject('Lorem ipsum', 'Dolor sit amet')
# >> subject('Lorem ipsum', 'Dolor sit amet')
# => "Lorem ipsum | Dolor sit amet"
# => "Lorem ipsum | Dolor sit amet"
def
subject
(
*
extra
)
def
subject
(
*
extra
)
subject
=
""
subject
=
[]
subject
<<
"
#{
@project
.
name
}
| "
if
@project
subject
<<
"
#{
@group
.
name
}
| "
if
@group
subject
<<
@project
.
name
if
@project
subject
<<
extra
.
join
(
' | '
)
if
extra
.
present?
subject
<<
@group
.
name
if
@group
subject
<<
" |
#{
Gitlab
.
config
.
gitlab
.
email_subject_suffix
}
"
if
Gitlab
.
config
.
gitlab
.
email_subject_suffix
.
present?
subject
.
concat
(
extra
)
if
extra
.
present?
subject
subject
<<
Gitlab
.
config
.
gitlab
.
email_subject_suffix
if
Gitlab
.
config
.
gitlab
.
email_subject_suffix
.
present?
subject
.
join
(
' | '
)
end
end
# Return a string suitable for inclusion in the 'Message-Id' mail header.
# Return a string suitable for inclusion in the 'Message-Id' mail header.
...
...
app/mailers/previews/devise_mailer_preview.rb
View file @
8184ce7f
# frozen_string_literal: true
class
DeviseMailerPreview
<
ActionMailer
::
Preview
class
DeviseMailerPreview
<
ActionMailer
::
Preview
def
confirmation_instructions_for_signup
def
confirmation_instructions_for_signup
DeviseMailer
.
confirmation_instructions
(
unsaved_user
,
'faketoken'
,
{})
DeviseMailer
.
confirmation_instructions
(
unsaved_user
,
'faketoken'
,
{})
...
...
app/mailers/previews/email_rejection_mailer_preview.rb
View file @
8184ce7f
# frozen_string_literal: true
class
EmailRejectionMailerPreview
<
ActionMailer
::
Preview
class
EmailRejectionMailerPreview
<
ActionMailer
::
Preview
def
rejection
def
rejection
EmailRejectionMailer
.
rejection
(
"some rejection reason"
,
"From: someone@example.com
\n
raw email here"
).
message
EmailRejectionMailer
.
rejection
(
"some rejection reason"
,
"From: someone@example.com
\n
raw email here"
).
message
...
...
app/mailers/previews/notify_preview.rb
View file @
8184ce7f
# frozen_string_literal: true
class
NotifyPreview
<
ActionMailer
::
Preview
class
NotifyPreview
<
ActionMailer
::
Preview
def
note_merge_request_email_for_individual_note
def
note_merge_request_email_for_individual_note
note_email
(
:note_merge_request_email
)
do
note_email
(
:note_merge_request_email
)
do
...
...
app/mailers/previews/repository_check_mailer_preview.rb
View file @
8184ce7f
# frozen_string_literal: true
class
RepositoryCheckMailerPreview
<
ActionMailer
::
Preview
class
RepositoryCheckMailerPreview
<
ActionMailer
::
Preview
def
notify
def
notify
RepositoryCheckMailer
.
notify
(
3
).
message
RepositoryCheckMailer
.
notify
(
3
).
message
...
...
app/mailers/repository_check_mailer.rb
View file @
8184ce7f
# frozen_string_literal: true
class
RepositoryCheckMailer
<
BaseMailer
class
RepositoryCheckMailer
<
BaseMailer
def
notify
(
failed_count
)
def
notify
(
failed_count
)
@message
=
@message
=
...
...
changelogs/unreleased/frozen-string-enable-app-mailers.yml
0 → 100644
View file @
8184ce7f
---
title
:
Enable frozen in app/mailers/**/*.rb
merge_request
:
21147
author
:
gfyoung
type
:
performance
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