Merge branch 'remove-unnecessary-freeze-in-lib' into 'master'
Avoid calling freeze on already frozen strings in lib See merge request gitlab-org/gitlab-ce!32788
This commit is contained in:
commit
4d542db508
|
@ -5,10 +5,10 @@ module API
|
||||||
include Gitlab::Utils
|
include Gitlab::Utils
|
||||||
include Helpers::Pagination
|
include Helpers::Pagination
|
||||||
|
|
||||||
SUDO_HEADER = "HTTP_SUDO".freeze
|
SUDO_HEADER = "HTTP_SUDO"
|
||||||
GITLAB_SHARED_SECRET_HEADER = "Gitlab-Shared-Secret".freeze
|
GITLAB_SHARED_SECRET_HEADER = "Gitlab-Shared-Secret"
|
||||||
SUDO_PARAM = :sudo
|
SUDO_PARAM = :sudo
|
||||||
API_USER_ENV = 'gitlab.api.user'.freeze
|
API_USER_ENV = 'gitlab.api.user'
|
||||||
|
|
||||||
def declared_params(options = {})
|
def declared_params(options = {})
|
||||||
options = { include_parent_namespaces: false }.merge(options)
|
options = { include_parent_namespaces: false }.merge(options)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
module API
|
module API
|
||||||
module Helpers
|
module Helpers
|
||||||
module Runner
|
module Runner
|
||||||
JOB_TOKEN_HEADER = 'HTTP_JOB_TOKEN'.freeze
|
JOB_TOKEN_HEADER = 'HTTP_JOB_TOKEN'
|
||||||
JOB_TOKEN_PARAM = :token
|
JOB_TOKEN_PARAM = :token
|
||||||
|
|
||||||
def runner_registration_token_valid?
|
def runner_registration_token_valid?
|
||||||
|
|
|
@ -4,7 +4,7 @@ module Backup
|
||||||
class Manager
|
class Manager
|
||||||
ARCHIVES_TO_BACKUP = %w[uploads builds artifacts pages lfs registry].freeze
|
ARCHIVES_TO_BACKUP = %w[uploads builds artifacts pages lfs registry].freeze
|
||||||
FOLDERS_TO_BACKUP = %w[repositories db].freeze
|
FOLDERS_TO_BACKUP = %w[repositories db].freeze
|
||||||
FILE_NAME_SUFFIX = '_gitlab_backup.tar'.freeze
|
FILE_NAME_SUFFIX = '_gitlab_backup.tar'
|
||||||
|
|
||||||
attr_reader :progress
|
attr_reader :progress
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ module Banzai
|
||||||
# HTML filter that renders `color` followed by a color "chip".
|
# HTML filter that renders `color` followed by a color "chip".
|
||||||
#
|
#
|
||||||
class ColorFilter < HTML::Pipeline::Filter
|
class ColorFilter < HTML::Pipeline::Filter
|
||||||
COLOR_CHIP_CLASS = 'gfm-color_chip'.freeze
|
COLOR_CHIP_CLASS = 'gfm-color_chip'
|
||||||
|
|
||||||
def call
|
def call
|
||||||
doc.css('code').each do |node|
|
doc.css('code').each do |node|
|
||||||
|
|
|
@ -5,8 +5,8 @@ module Banzai
|
||||||
# HTML Filter to modify the attributes of external links
|
# HTML Filter to modify the attributes of external links
|
||||||
class ExternalLinkFilter < HTML::Pipeline::Filter
|
class ExternalLinkFilter < HTML::Pipeline::Filter
|
||||||
SCHEMES = ['http', 'https', nil].freeze
|
SCHEMES = ['http', 'https', nil].freeze
|
||||||
RTLO = "\u202E".freeze
|
RTLO = "\u202E"
|
||||||
ENCODED_RTLO = '%E2%80%AE'.freeze
|
ENCODED_RTLO = '%E2%80%AE'
|
||||||
|
|
||||||
def call
|
def call
|
||||||
links.each do |node|
|
links.each do |node|
|
||||||
|
|
|
@ -17,8 +17,8 @@ module Banzai
|
||||||
#
|
#
|
||||||
class FootnoteFilter < HTML::Pipeline::Filter
|
class FootnoteFilter < HTML::Pipeline::Filter
|
||||||
INTEGER_PATTERN = /\A\d+\z/.freeze
|
INTEGER_PATTERN = /\A\d+\z/.freeze
|
||||||
FOOTNOTE_ID_PREFIX = 'fn'.freeze
|
FOOTNOTE_ID_PREFIX = 'fn'
|
||||||
FOOTNOTE_LINK_ID_PREFIX = 'fnref'.freeze
|
FOOTNOTE_LINK_ID_PREFIX = 'fnref'
|
||||||
FOOTNOTE_LI_REFERENCE_PATTERN = /\A#{FOOTNOTE_ID_PREFIX}\d+\z/.freeze
|
FOOTNOTE_LI_REFERENCE_PATTERN = /\A#{FOOTNOTE_ID_PREFIX}\d+\z/.freeze
|
||||||
FOOTNOTE_LINK_REFERENCE_PATTERN = /\A#{FOOTNOTE_LINK_ID_PREFIX}\d+\z/.freeze
|
FOOTNOTE_LINK_REFERENCE_PATTERN = /\A#{FOOTNOTE_LINK_ID_PREFIX}\d+\z/.freeze
|
||||||
FOOTNOTE_START_NUMBER = 1
|
FOOTNOTE_START_NUMBER = 1
|
||||||
|
|
|
@ -11,14 +11,14 @@ module Banzai
|
||||||
#
|
#
|
||||||
class MathFilter < HTML::Pipeline::Filter
|
class MathFilter < HTML::Pipeline::Filter
|
||||||
# Attribute indicating inline or display math.
|
# Attribute indicating inline or display math.
|
||||||
STYLE_ATTRIBUTE = 'data-math-style'.freeze
|
STYLE_ATTRIBUTE = 'data-math-style'
|
||||||
|
|
||||||
# Class used for tagging elements that should be rendered
|
# Class used for tagging elements that should be rendered
|
||||||
TAG_CLASS = 'js-render-math'.freeze
|
TAG_CLASS = 'js-render-math'
|
||||||
|
|
||||||
INLINE_CLASSES = "code math #{TAG_CLASS}".freeze
|
INLINE_CLASSES = "code math #{TAG_CLASS}"
|
||||||
|
|
||||||
DOLLAR_SIGN = '$'.freeze
|
DOLLAR_SIGN = '$'
|
||||||
|
|
||||||
def call
|
def call
|
||||||
doc.css('code').each do |code|
|
doc.css('code').each do |code|
|
||||||
|
|
|
@ -5,7 +5,7 @@ module Banzai
|
||||||
module Filter
|
module Filter
|
||||||
class SuggestionFilter < HTML::Pipeline::Filter
|
class SuggestionFilter < HTML::Pipeline::Filter
|
||||||
# Class used for tagging elements that should be rendered
|
# Class used for tagging elements that should be rendered
|
||||||
TAG_CLASS = 'js-render-suggestion'.freeze
|
TAG_CLASS = 'js-render-suggestion'
|
||||||
|
|
||||||
def call
|
def call
|
||||||
return doc unless suggestions_filter_enabled?
|
return doc unless suggestions_filter_enabled?
|
||||||
|
|
|
@ -10,8 +10,8 @@ module Banzai
|
||||||
class SyntaxHighlightFilter < HTML::Pipeline::Filter
|
class SyntaxHighlightFilter < HTML::Pipeline::Filter
|
||||||
include OutputSafety
|
include OutputSafety
|
||||||
|
|
||||||
PARAMS_DELIMITER = ':'.freeze
|
PARAMS_DELIMITER = ':'
|
||||||
LANG_PARAMS_ATTR = 'data-lang-params'.freeze
|
LANG_PARAMS_ATTR = 'data-lang-params'
|
||||||
|
|
||||||
def call
|
def call
|
||||||
doc.search('pre:not([data-math-style]) > code').each do |node|
|
doc.search('pre:not([data-math-style]) > code').each do |node|
|
||||||
|
|
|
@ -11,8 +11,8 @@ module Banzai
|
||||||
class IssuableExtractor
|
class IssuableExtractor
|
||||||
attr_reader :context
|
attr_reader :context
|
||||||
|
|
||||||
ISSUE_REFERENCE_TYPE = '@data-reference-type="issue"'.freeze
|
ISSUE_REFERENCE_TYPE = '@data-reference-type="issue"'
|
||||||
MERGE_REQUEST_REFERENCE_TYPE = '@data-reference-type="merge_request"'.freeze
|
MERGE_REQUEST_REFERENCE_TYPE = '@data-reference-type="merge_request"'
|
||||||
|
|
||||||
# context - An instance of Banzai::RenderContext.
|
# context - An instance of Banzai::RenderContext.
|
||||||
def initialize(context)
|
def initialize(context)
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
module Bitbucket
|
module Bitbucket
|
||||||
class Connection
|
class Connection
|
||||||
DEFAULT_API_VERSION = '2.0'.freeze
|
DEFAULT_API_VERSION = '2.0'
|
||||||
DEFAULT_BASE_URI = 'https://api.bitbucket.org/'.freeze
|
DEFAULT_BASE_URI = 'https://api.bitbucket.org/'
|
||||||
DEFAULT_QUERY = {}.freeze
|
DEFAULT_QUERY = {}.freeze
|
||||||
|
|
||||||
attr_reader :expires_at, :expires_in, :refresh_token, :token
|
attr_reader :expires_at, :expires_in, :refresh_token, :token
|
||||||
|
|
|
@ -29,13 +29,13 @@ module Gitlab
|
||||||
if result.status.success?
|
if result.status.success?
|
||||||
result.stdout.chomp.freeze
|
result.stdout.chomp.freeze
|
||||||
else
|
else
|
||||||
"Unknown".freeze
|
"Unknown"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
COM_URL = 'https://gitlab.com'.freeze
|
COM_URL = 'https://gitlab.com'
|
||||||
APP_DIRS_PATTERN = %r{^/?(app|config|ee|lib|spec|\(\w*\))}.freeze
|
APP_DIRS_PATTERN = %r{^/?(app|config|ee|lib|spec|\(\w*\))}.freeze
|
||||||
SUBDOMAIN_REGEX = %r{\Ahttps://[a-z0-9]+\.gitlab\.com\z}.freeze
|
SUBDOMAIN_REGEX = %r{\Ahttps://[a-z0-9]+\.gitlab\.com\z}.freeze
|
||||||
VERSION = File.read(root.join("VERSION")).strip.freeze
|
VERSION = File.read(root.join("VERSION")).strip.freeze
|
||||||
|
|
|
@ -8,9 +8,9 @@ require 'google/apis/cloudresourcemanager_v1'
|
||||||
module GoogleApi
|
module GoogleApi
|
||||||
module CloudPlatform
|
module CloudPlatform
|
||||||
class Client < GoogleApi::Auth
|
class Client < GoogleApi::Auth
|
||||||
SCOPE = 'https://www.googleapis.com/auth/cloud-platform'.freeze
|
SCOPE = 'https://www.googleapis.com/auth/cloud-platform'
|
||||||
LEAST_TOKEN_LIFE_TIME = 10.minutes
|
LEAST_TOKEN_LIFE_TIME = 10.minutes
|
||||||
CLUSTER_MASTER_AUTH_USERNAME = 'admin'.freeze
|
CLUSTER_MASTER_AUTH_USERNAME = 'admin'
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def session_key_for_token
|
def session_key_for_token
|
||||||
|
|
|
@ -53,7 +53,7 @@ module Quality
|
||||||
end
|
end
|
||||||
|
|
||||||
def pattern(level)
|
def pattern(level)
|
||||||
@patterns[level] ||= "#{prefix}spec/{#{TEST_LEVEL_FOLDERS.fetch(level).join(',')}}{,/**/}*_spec.rb".freeze
|
@patterns[level] ||= "#{prefix}spec/{#{TEST_LEVEL_FOLDERS.fetch(level).join(',')}}{,/**/}*_spec.rb"
|
||||||
end
|
end
|
||||||
|
|
||||||
def regexp(level)
|
def regexp(level)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
module SystemCheck
|
module SystemCheck
|
||||||
module App
|
module App
|
||||||
class InitScriptUpToDateCheck < SystemCheck::BaseCheck
|
class InitScriptUpToDateCheck < SystemCheck::BaseCheck
|
||||||
SCRIPT_PATH = '/etc/init.d/gitlab'.freeze
|
SCRIPT_PATH = '/etc/init.d/gitlab'
|
||||||
|
|
||||||
set_name 'Init script up-to-date?'
|
set_name 'Init script up-to-date?'
|
||||||
set_skip_reason 'skipped (omnibus-gitlab has no init script)'
|
set_skip_reason 'skipped (omnibus-gitlab has no init script)'
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
module SystemCheck
|
module SystemCheck
|
||||||
module App
|
module App
|
||||||
class RedisVersionCheck < SystemCheck::BaseCheck
|
class RedisVersionCheck < SystemCheck::BaseCheck
|
||||||
MIN_REDIS_VERSION = '2.8.0'.freeze
|
MIN_REDIS_VERSION = '2.8.0'
|
||||||
set_name "Redis version >= #{MIN_REDIS_VERSION}?"
|
set_name "Redis version >= #{MIN_REDIS_VERSION}?"
|
||||||
|
|
||||||
def check?
|
def check?
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
return if Rails.env.production?
|
return if Rails.env.production?
|
||||||
|
|
||||||
namespace :gitlab do
|
namespace :gitlab do
|
||||||
OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference").freeze
|
OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference")
|
||||||
TEMPLATES_DIR = 'lib/gitlab/graphql/docs/templates/'.freeze
|
TEMPLATES_DIR = 'lib/gitlab/graphql/docs/templates/'
|
||||||
|
|
||||||
namespace :graphql do
|
namespace :graphql do
|
||||||
desc 'GitLab | Generate GraphQL docs'
|
desc 'GitLab | Generate GraphQL docs'
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace :gitlab do
|
||||||
include ::EachBatch
|
include ::EachBatch
|
||||||
end
|
end
|
||||||
|
|
||||||
migration = 'LegacyUploadsMigrator'.freeze
|
migration = 'LegacyUploadsMigrator'
|
||||||
batch_size = 5000
|
batch_size = 5000
|
||||||
delay_interval = 5.minutes.to_i
|
delay_interval = 5.minutes.to_i
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue