Skip to content
Snippets Groups Projects
Commit 297bf17a authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Merge branch 'frozen-string-enable-app-uploaders' into 'master'

Enable frozen string in apps/uploaders/*.rb

See merge request gitlab-org/gitlab-ce!20382
parents 45aef6ff d5ee813e
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Showing
with 36 additions and 1 deletion
# frozen_string_literal: true
class AttachmentUploader < GitlabUploader
include RecordsUploads::Concern
include ObjectStorage::Concern
Loading
Loading
# frozen_string_literal: true
class AvatarUploader < GitlabUploader
include UploaderHelper
include RecordsUploads::Concern
Loading
Loading
# frozen_string_literal: true
class FaviconUploader < AttachmentUploader
EXTENSION_WHITELIST = %w[png ico].freeze
 
Loading
Loading
# frozen_string_literal: true
class FileMover
attr_reader :secret, :file_name, :model, :update_field
 
Loading
Loading
# frozen_string_literal: true
# This class breaks the actual CarrierWave concept.
# 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.
Loading
Loading
@@ -117,7 +119,7 @@ class FileUploader < GitlabUploader
end
 
def markdown_link
markdown = "[#{markdown_name}](#{secure_url})"
markdown = +"[#{markdown_name}](#{secure_url})"
markdown.prepend("!") if image_or_video? || dangerous?
markdown
end
Loading
Loading
# frozen_string_literal: true
class GitlabUploader < CarrierWave::Uploader::Base
class_attribute :options
 
Loading
Loading
# frozen_string_literal: true
class JobArtifactUploader < GitlabUploader
extend Workhorse::UploadPath
include ObjectStorage::Concern
Loading
Loading
# frozen_string_literal: true
class LegacyArtifactUploader < GitlabUploader
extend Workhorse::UploadPath
include ObjectStorage::Concern
Loading
Loading
# frozen_string_literal: true
class LfsObjectUploader < GitlabUploader
extend Workhorse::UploadPath
include ObjectStorage::Concern
Loading
Loading
# frozen_string_literal: true
class NamespaceFileUploader < FileUploader
# Re-Override
def self.root
Loading
Loading
# frozen_string_literal: true
require 'fog/aws'
require 'carrierwave/storage/fog'
 
Loading
Loading
# frozen_string_literal: true
class PersonalFileUploader < FileUploader
# Re-Override
def self.root
Loading
Loading
# frozen_string_literal: true
module RecordsUploads
module Concern
extend ActiveSupport::Concern
Loading
Loading
# frozen_string_literal: true
# Extra methods for uploader
module UploaderHelper
IMAGE_EXT = %w[png jpg jpeg gif bmp tiff ico].freeze
Loading
Loading
# frozen_string_literal: true
module Workhorse
module UploadPath
def workhorse_upload_path
Loading
Loading
---
title: Enable frozen string in apps/validators/*.rb
merge_request: 20382
author: gfyoung
type: other
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment