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
Boxiang Sun
gitlab-ce
Commits
d5ee813e
Commit
d5ee813e
authored
Jul 04, 2018
by
gfyoung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable frozen string in apps/validators/*.rb
Partially addresses #47424.
parent
7c540395
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
36 additions
and
1 deletion
+36
-1
app/uploaders/attachment_uploader.rb
app/uploaders/attachment_uploader.rb
+2
-0
app/uploaders/avatar_uploader.rb
app/uploaders/avatar_uploader.rb
+2
-0
app/uploaders/favicon_uploader.rb
app/uploaders/favicon_uploader.rb
+2
-0
app/uploaders/file_mover.rb
app/uploaders/file_mover.rb
+2
-0
app/uploaders/file_uploader.rb
app/uploaders/file_uploader.rb
+3
-1
app/uploaders/gitlab_uploader.rb
app/uploaders/gitlab_uploader.rb
+2
-0
app/uploaders/job_artifact_uploader.rb
app/uploaders/job_artifact_uploader.rb
+2
-0
app/uploaders/legacy_artifact_uploader.rb
app/uploaders/legacy_artifact_uploader.rb
+2
-0
app/uploaders/lfs_object_uploader.rb
app/uploaders/lfs_object_uploader.rb
+2
-0
app/uploaders/namespace_file_uploader.rb
app/uploaders/namespace_file_uploader.rb
+2
-0
app/uploaders/object_storage.rb
app/uploaders/object_storage.rb
+2
-0
app/uploaders/personal_file_uploader.rb
app/uploaders/personal_file_uploader.rb
+2
-0
app/uploaders/records_uploads.rb
app/uploaders/records_uploads.rb
+2
-0
app/uploaders/uploader_helper.rb
app/uploaders/uploader_helper.rb
+2
-0
app/uploaders/workhorse.rb
app/uploaders/workhorse.rb
+2
-0
changelogs/unreleased/frozen-string-enable-app-uploaders.yml
changelogs/unreleased/frozen-string-enable-app-uploaders.yml
+5
-0
No files found.
app/uploaders/attachment_uploader.rb
View file @
d5ee813e
# frozen_string_literal: true
class
AttachmentUploader
<
GitlabUploader
class
AttachmentUploader
<
GitlabUploader
include
RecordsUploads
::
Concern
include
RecordsUploads
::
Concern
include
ObjectStorage
::
Concern
include
ObjectStorage
::
Concern
...
...
app/uploaders/avatar_uploader.rb
View file @
d5ee813e
# frozen_string_literal: true
class
AvatarUploader
<
GitlabUploader
class
AvatarUploader
<
GitlabUploader
include
UploaderHelper
include
UploaderHelper
include
RecordsUploads
::
Concern
include
RecordsUploads
::
Concern
...
...
app/uploaders/favicon_uploader.rb
View file @
d5ee813e
# frozen_string_literal: true
class
FaviconUploader
<
AttachmentUploader
class
FaviconUploader
<
AttachmentUploader
EXTENSION_WHITELIST
=
%w[png ico]
.
freeze
EXTENSION_WHITELIST
=
%w[png ico]
.
freeze
...
...
app/uploaders/file_mover.rb
View file @
d5ee813e
# frozen_string_literal: true
class
FileMover
class
FileMover
attr_reader
:secret
,
:file_name
,
:model
,
:update_field
attr_reader
:secret
,
:file_name
,
:model
,
:update_field
...
...
app/uploaders/file_uploader.rb
View file @
d5ee813e
# frozen_string_literal: true
# This class breaks the actual CarrierWave concept.
# This class breaks the actual CarrierWave concept.
# Every uploader should use a base_dir that is model agnostic so we can build
# Every uploader should use a base_dir that is model agnostic so we can build
# back URLs from base_dir-relative paths saved in the `Upload` model.
# back URLs from base_dir-relative paths saved in the `Upload` model.
...
@@ -117,7 +119,7 @@ class FileUploader < GitlabUploader
...
@@ -117,7 +119,7 @@ class FileUploader < GitlabUploader
end
end
def
markdown_link
def
markdown_link
markdown
=
"[
#{
markdown_name
}
](
#{
secure_url
}
)"
markdown
=
+
"[
#{
markdown_name
}
](
#{
secure_url
}
)"
markdown
.
prepend
(
"!"
)
if
image_or_video?
||
dangerous?
markdown
.
prepend
(
"!"
)
if
image_or_video?
||
dangerous?
markdown
markdown
end
end
...
...
app/uploaders/gitlab_uploader.rb
View file @
d5ee813e
# frozen_string_literal: true
class
GitlabUploader
<
CarrierWave
::
Uploader
::
Base
class
GitlabUploader
<
CarrierWave
::
Uploader
::
Base
class_attribute
:options
class_attribute
:options
...
...
app/uploaders/job_artifact_uploader.rb
View file @
d5ee813e
# frozen_string_literal: true
class
JobArtifactUploader
<
GitlabUploader
class
JobArtifactUploader
<
GitlabUploader
extend
Workhorse
::
UploadPath
extend
Workhorse
::
UploadPath
include
ObjectStorage
::
Concern
include
ObjectStorage
::
Concern
...
...
app/uploaders/legacy_artifact_uploader.rb
View file @
d5ee813e
# frozen_string_literal: true
class
LegacyArtifactUploader
<
GitlabUploader
class
LegacyArtifactUploader
<
GitlabUploader
extend
Workhorse
::
UploadPath
extend
Workhorse
::
UploadPath
include
ObjectStorage
::
Concern
include
ObjectStorage
::
Concern
...
...
app/uploaders/lfs_object_uploader.rb
View file @
d5ee813e
# frozen_string_literal: true
class
LfsObjectUploader
<
GitlabUploader
class
LfsObjectUploader
<
GitlabUploader
extend
Workhorse
::
UploadPath
extend
Workhorse
::
UploadPath
include
ObjectStorage
::
Concern
include
ObjectStorage
::
Concern
...
...
app/uploaders/namespace_file_uploader.rb
View file @
d5ee813e
# frozen_string_literal: true
class
NamespaceFileUploader
<
FileUploader
class
NamespaceFileUploader
<
FileUploader
# Re-Override
# Re-Override
def
self
.
root
def
self
.
root
...
...
app/uploaders/object_storage.rb
View file @
d5ee813e
# frozen_string_literal: true
require
'fog/aws'
require
'fog/aws'
require
'carrierwave/storage/fog'
require
'carrierwave/storage/fog'
...
...
app/uploaders/personal_file_uploader.rb
View file @
d5ee813e
# frozen_string_literal: true
class
PersonalFileUploader
<
FileUploader
class
PersonalFileUploader
<
FileUploader
# Re-Override
# Re-Override
def
self
.
root
def
self
.
root
...
...
app/uploaders/records_uploads.rb
View file @
d5ee813e
# frozen_string_literal: true
module
RecordsUploads
module
RecordsUploads
module
Concern
module
Concern
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
...
...
app/uploaders/uploader_helper.rb
View file @
d5ee813e
# frozen_string_literal: true
# Extra methods for uploader
# Extra methods for uploader
module
UploaderHelper
module
UploaderHelper
IMAGE_EXT
=
%w[png jpg jpeg gif bmp tiff ico]
.
freeze
IMAGE_EXT
=
%w[png jpg jpeg gif bmp tiff ico]
.
freeze
...
...
app/uploaders/workhorse.rb
View file @
d5ee813e
# frozen_string_literal: true
module
Workhorse
module
Workhorse
module
UploadPath
module
UploadPath
def
workhorse_upload_path
def
workhorse_upload_path
...
...
changelogs/unreleased/frozen-string-enable-app-uploaders.yml
0 → 100644
View file @
d5ee813e
---
title
:
Enable frozen string in apps/validators/*.rb
merge_request
:
20382
author
:
gfyoung
type
:
other
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