Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
c858f70d
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c858f70d
编写于
10月 22, 2018
作者:
G
gfyoung
提交者:
Rémy Coutable
10月 22, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enable frozen string for lib/gitlab/*.rb
上级
173b1436
变更
151
展开全部
隐藏空白更改
内联
并排
Showing
151 changed file
with
327 addition
and
22 deletion
+327
-22
changelogs/unreleased/frozen-string-enable-lib-gitlab.yml
changelogs/unreleased/frozen-string-enable-lib-gitlab.yml
+5
-0
lib/backup/manager.rb
lib/backup/manager.rb
+1
-1
lib/gitlab/access.rb
lib/gitlab/access.rb
+2
-0
lib/gitlab/action_rate_limiter.rb
lib/gitlab/action_rate_limiter.rb
+2
-0
lib/gitlab/allowable.rb
lib/gitlab/allowable.rb
+2
-0
lib/gitlab/app_logger.rb
lib/gitlab/app_logger.rb
+2
-0
lib/gitlab/asciidoc.rb
lib/gitlab/asciidoc.rb
+2
-0
lib/gitlab/auth.rb
lib/gitlab/auth.rb
+2
-0
lib/gitlab/background_migration.rb
lib/gitlab/background_migration.rb
+2
-0
lib/gitlab/base_doorkeeper_controller.rb
lib/gitlab/base_doorkeeper_controller.rb
+2
-0
lib/gitlab/blame.rb
lib/gitlab/blame.rb
+2
-0
lib/gitlab/blob_helper.rb
lib/gitlab/blob_helper.rb
+2
-0
lib/gitlab/build_access.rb
lib/gitlab/build_access.rb
+2
-0
lib/gitlab/changes_list.rb
lib/gitlab/changes_list.rb
+2
-0
lib/gitlab/chat_name_token.rb
lib/gitlab/chat_name_token.rb
+2
-0
lib/gitlab/ci_access.rb
lib/gitlab/ci_access.rb
+2
-0
lib/gitlab/closing_issue_extractor.rb
lib/gitlab/closing_issue_extractor.rb
+2
-0
lib/gitlab/color_schemes.rb
lib/gitlab/color_schemes.rb
+2
-0
lib/gitlab/config_helper.rb
lib/gitlab/config_helper.rb
+2
-0
lib/gitlab/contributions_calendar.rb
lib/gitlab/contributions_calendar.rb
+2
-0
lib/gitlab/contributor.rb
lib/gitlab/contributor.rb
+2
-0
lib/gitlab/cross_project_access.rb
lib/gitlab/cross_project_access.rb
+2
-0
lib/gitlab/current_settings.rb
lib/gitlab/current_settings.rb
+2
-0
lib/gitlab/daemon.rb
lib/gitlab/daemon.rb
+2
-0
lib/gitlab/database.rb
lib/gitlab/database.rb
+7
-5
lib/gitlab/dependency_linker.rb
lib/gitlab/dependency_linker.rb
+2
-0
lib/gitlab/downtime_check.rb
lib/gitlab/downtime_check.rb
+2
-0
lib/gitlab/ee_compat_check.rb
lib/gitlab/ee_compat_check.rb
+2
-0
lib/gitlab/emoji.rb
lib/gitlab/emoji.rb
+2
-0
lib/gitlab/encoding_helper.rb
lib/gitlab/encoding_helper.rb
+2
-0
lib/gitlab/environment.rb
lib/gitlab/environment.rb
+2
-0
lib/gitlab/environment_logger.rb
lib/gitlab/environment_logger.rb
+2
-0
lib/gitlab/exclusive_lease.rb
lib/gitlab/exclusive_lease.rb
+2
-0
lib/gitlab/exclusive_lease_helpers.rb
lib/gitlab/exclusive_lease_helpers.rb
+2
-0
lib/gitlab/fake_application_settings.rb
lib/gitlab/fake_application_settings.rb
+2
-0
lib/gitlab/favicon.rb
lib/gitlab/favicon.rb
+2
-0
lib/gitlab/file_detector.rb
lib/gitlab/file_detector.rb
+2
-0
lib/gitlab/file_finder.rb
lib/gitlab/file_finder.rb
+2
-0
lib/gitlab/file_markdown_link_builder.rb
lib/gitlab/file_markdown_link_builder.rb
+3
-1
lib/gitlab/git.rb
lib/gitlab/git.rb
+2
-0
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+2
-0
lib/gitlab/git_access_wiki.rb
lib/gitlab/git_access_wiki.rb
+2
-0
lib/gitlab/git_logger.rb
lib/gitlab/git_logger.rb
+2
-0
lib/gitlab/git_ref_validator.rb
lib/gitlab/git_ref_validator.rb
+2
-0
lib/gitlab/gitaly_client.rb
lib/gitlab/gitaly_client.rb
+3
-1
lib/gitlab/github_import.rb
lib/gitlab/github_import.rb
+2
-0
lib/gitlab/gl_id.rb
lib/gitlab/gl_id.rb
+2
-0
lib/gitlab/gl_repository.rb
lib/gitlab/gl_repository.rb
+2
-0
lib/gitlab/gon_helper.rb
lib/gitlab/gon_helper.rb
+2
-0
lib/gitlab/gpg.rb
lib/gitlab/gpg.rb
+2
-0
lib/gitlab/graphql.rb
lib/gitlab/graphql.rb
+2
-0
lib/gitlab/group_hierarchy.rb
lib/gitlab/group_hierarchy.rb
+2
-0
lib/gitlab/highlight.rb
lib/gitlab/highlight.rb
+2
-0
lib/gitlab/http.rb
lib/gitlab/http.rb
+2
-0
lib/gitlab/http_io.rb
lib/gitlab/http_io.rb
+9
-6
lib/gitlab/i18n.rb
lib/gitlab/i18n.rb
+2
-0
lib/gitlab/identifier.rb
lib/gitlab/identifier.rb
+2
-0
lib/gitlab/import_export.rb
lib/gitlab/import_export.rb
+2
-0
lib/gitlab/import_formatter.rb
lib/gitlab/import_formatter.rb
+2
-0
lib/gitlab/import_sources.rb
lib/gitlab/import_sources.rb
+2
-0
lib/gitlab/incoming_email.rb
lib/gitlab/incoming_email.rb
+2
-0
lib/gitlab/insecure_key_fingerprint.rb
lib/gitlab/insecure_key_fingerprint.rb
+2
-0
lib/gitlab/issuable_metadata.rb
lib/gitlab/issuable_metadata.rb
+2
-0
lib/gitlab/issuable_sorter.rb
lib/gitlab/issuable_sorter.rb
+2
-0
lib/gitlab/issuables_count_for_state.rb
lib/gitlab/issuables_count_for_state.rb
+2
-0
lib/gitlab/issues_labels.rb
lib/gitlab/issues_labels.rb
+2
-0
lib/gitlab/job_waiter.rb
lib/gitlab/job_waiter.rb
+2
-0
lib/gitlab/json_logger.rb
lib/gitlab/json_logger.rb
+2
-0
lib/gitlab/kubernetes.rb
lib/gitlab/kubernetes.rb
+2
-0
lib/gitlab/language_detection.rb
lib/gitlab/language_detection.rb
+2
-0
lib/gitlab/lazy.rb
lib/gitlab/lazy.rb
+2
-0
lib/gitlab/lfs_token.rb
lib/gitlab/lfs_token.rb
+2
-0
lib/gitlab/logger.rb
lib/gitlab/logger.rb
+2
-0
lib/gitlab/mail_room.rb
lib/gitlab/mail_room.rb
+2
-0
lib/gitlab/markup_helper.rb
lib/gitlab/markup_helper.rb
+2
-0
lib/gitlab/metrics.rb
lib/gitlab/metrics.rb
+2
-0
lib/gitlab/multi_collection_paginator.rb
lib/gitlab/multi_collection_paginator.rb
+2
-0
lib/gitlab/omniauth_initializer.rb
lib/gitlab/omniauth_initializer.rb
+2
-0
lib/gitlab/optimistic_locking.rb
lib/gitlab/optimistic_locking.rb
+2
-0
lib/gitlab/other_markup.rb
lib/gitlab/other_markup.rb
+2
-0
lib/gitlab/otp_key_rotator.rb
lib/gitlab/otp_key_rotator.rb
+2
-0
lib/gitlab/pages.rb
lib/gitlab/pages.rb
+2
-0
lib/gitlab/pages_client.rb
lib/gitlab/pages_client.rb
+2
-0
lib/gitlab/pages_transfer.rb
lib/gitlab/pages_transfer.rb
+2
-0
lib/gitlab/path_regex.rb
lib/gitlab/path_regex.rb
+2
-0
lib/gitlab/performance_bar.rb
lib/gitlab/performance_bar.rb
+2
-0
lib/gitlab/plugin.rb
lib/gitlab/plugin.rb
+2
-0
lib/gitlab/plugin_logger.rb
lib/gitlab/plugin_logger.rb
+2
-0
lib/gitlab/polling_interval.rb
lib/gitlab/polling_interval.rb
+2
-0
lib/gitlab/popen.rb
lib/gitlab/popen.rb
+3
-1
lib/gitlab/profiler.rb
lib/gitlab/profiler.rb
+2
-0
lib/gitlab/project_search_results.rb
lib/gitlab/project_search_results.rb
+5
-2
lib/gitlab/project_service_logger.rb
lib/gitlab/project_service_logger.rb
+2
-0
lib/gitlab/project_template.rb
lib/gitlab/project_template.rb
+2
-0
lib/gitlab/project_transfer.rb
lib/gitlab/project_transfer.rb
+2
-0
lib/gitlab/prometheus_client.rb
lib/gitlab/prometheus_client.rb
+2
-0
lib/gitlab/protocol_access.rb
lib/gitlab/protocol_access.rb
+2
-0
lib/gitlab/proxy_http_connection_adapter.rb
lib/gitlab/proxy_http_connection_adapter.rb
+2
-0
lib/gitlab/query_limiting.rb
lib/gitlab/query_limiting.rb
+2
-0
lib/gitlab/recaptcha.rb
lib/gitlab/recaptcha.rb
+2
-0
lib/gitlab/reference_counter.rb
lib/gitlab/reference_counter.rb
+2
-0
lib/gitlab/reference_extractor.rb
lib/gitlab/reference_extractor.rb
+2
-0
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+2
-0
lib/gitlab/repo_path.rb
lib/gitlab/repo_path.rb
+2
-0
lib/gitlab/repository_cache.rb
lib/gitlab/repository_cache.rb
+3
-1
lib/gitlab/repository_cache_adapter.rb
lib/gitlab/repository_cache_adapter.rb
+2
-0
lib/gitlab/repository_check_logger.rb
lib/gitlab/repository_check_logger.rb
+2
-0
lib/gitlab/request_context.rb
lib/gitlab/request_context.rb
+2
-0
lib/gitlab/request_forgery_protection.rb
lib/gitlab/request_forgery_protection.rb
+2
-0
lib/gitlab/request_profiler.rb
lib/gitlab/request_profiler.rb
+2
-0
lib/gitlab/route_map.rb
lib/gitlab/route_map.rb
+2
-0
lib/gitlab/routing.rb
lib/gitlab/routing.rb
+3
-1
lib/gitlab/search_results.rb
lib/gitlab/search_results.rb
+2
-0
lib/gitlab/seeder.rb
lib/gitlab/seeder.rb
+2
-0
lib/gitlab/sentry.rb
lib/gitlab/sentry.rb
+2
-0
lib/gitlab/setup_helper.rb
lib/gitlab/setup_helper.rb
+2
-0
lib/gitlab/shard_health_cache.rb
lib/gitlab/shard_health_cache.rb
+2
-0
lib/gitlab/shell.rb
lib/gitlab/shell.rb
+2
-0
lib/gitlab/shell_adapter.rb
lib/gitlab/shell_adapter.rb
+2
-0
lib/gitlab/sherlock.rb
lib/gitlab/sherlock.rb
+2
-0
lib/gitlab/sidekiq_config.rb
lib/gitlab/sidekiq_config.rb
+2
-0
lib/gitlab/sidekiq_logger.rb
lib/gitlab/sidekiq_logger.rb
+2
-0
lib/gitlab/sidekiq_status.rb
lib/gitlab/sidekiq_status.rb
+2
-0
lib/gitlab/sidekiq_versioning.rb
lib/gitlab/sidekiq_versioning.rb
+2
-0
lib/gitlab/snippet_search_results.rb
lib/gitlab/snippet_search_results.rb
+2
-0
lib/gitlab/ssh_public_key.rb
lib/gitlab/ssh_public_key.rb
+3
-1
lib/gitlab/string_placeholder_replacer.rb
lib/gitlab/string_placeholder_replacer.rb
+2
-0
lib/gitlab/string_range_marker.rb
lib/gitlab/string_range_marker.rb
+2
-0
lib/gitlab/string_regex_marker.rb
lib/gitlab/string_regex_marker.rb
+2
-0
lib/gitlab/task_helpers.rb
lib/gitlab/task_helpers.rb
+3
-1
lib/gitlab/tcp_checker.rb
lib/gitlab/tcp_checker.rb
+2
-0
lib/gitlab/template_helper.rb
lib/gitlab/template_helper.rb
+2
-0
lib/gitlab/temporarily_allow.rb
lib/gitlab/temporarily_allow.rb
+2
-0
lib/gitlab/themes.rb
lib/gitlab/themes.rb
+2
-0
lib/gitlab/time_tracking_formatter.rb
lib/gitlab/time_tracking_formatter.rb
+2
-0
lib/gitlab/timeless.rb
lib/gitlab/timeless.rb
+2
-0
lib/gitlab/tree_summary.rb
lib/gitlab/tree_summary.rb
+2
-0
lib/gitlab/untrusted_regexp.rb
lib/gitlab/untrusted_regexp.rb
+2
-0
lib/gitlab/update_path_error.rb
lib/gitlab/update_path_error.rb
+2
-0
lib/gitlab/upgrader.rb
lib/gitlab/upgrader.rb
+2
-0
lib/gitlab/uploads_transfer.rb
lib/gitlab/uploads_transfer.rb
+2
-0
lib/gitlab/url_blocker.rb
lib/gitlab/url_blocker.rb
+2
-0
lib/gitlab/url_builder.rb
lib/gitlab/url_builder.rb
+2
-0
lib/gitlab/url_sanitizer.rb
lib/gitlab/url_sanitizer.rb
+2
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+2
-0
lib/gitlab/user_access.rb
lib/gitlab/user_access.rb
+2
-0
lib/gitlab/utils.rb
lib/gitlab/utils.rb
+2
-0
lib/gitlab/version_info.rb
lib/gitlab/version_info.rb
+2
-0
lib/gitlab/visibility_level.rb
lib/gitlab/visibility_level.rb
+2
-0
lib/gitlab/wiki_file_finder.rb
lib/gitlab/wiki_file_finder.rb
+2
-0
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+3
-1
未找到文件。
changelogs/unreleased/frozen-string-enable-lib-gitlab.yml
0 → 100644
浏览文件 @
c858f70d
---
title
:
Enable frozen string for lib/gitlab/*.rb
merge_request
:
author
:
gfyoung
type
:
performance
lib/backup/manager.rb
浏览文件 @
c858f70d
...
...
@@ -164,7 +164,7 @@ module Backup
def
tar_version
tar_version
,
_
=
Gitlab
::
Popen
.
popen
(
%w(tar --version)
)
tar_version
.
force_encoding
(
'locale'
).
split
(
"
\n
"
).
first
tar_version
.
dup
.
force_encoding
(
'locale'
).
split
(
"
\n
"
).
first
end
def
skipped?
(
item
)
...
...
lib/gitlab/access.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# Gitlab::Access module
#
# Define allowed roles that can be used
...
...
lib/gitlab/action_rate_limiter.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# This class implements a simple rate limiter that can be used to throttle
# certain actions. Unlike Rack Attack and Rack::Throttle, which operate at
...
...
lib/gitlab/allowable.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Allowable
def
can?
(
*
args
)
...
...
lib/gitlab/app_logger.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
AppLogger
<
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/asciidoc.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
require
'asciidoctor'
require
'asciidoctor/converter/html5'
require
"asciidoctor-plantuml"
...
...
lib/gitlab/auth.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Auth
MissingPersonalAccessTokenError
=
Class
.
new
(
StandardError
)
...
...
lib/gitlab/background_migration.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
BackgroundMigration
def
self
.
queue
...
...
lib/gitlab/base_doorkeeper_controller.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# This is a base controller for doorkeeper.
# It adds the `can?` helper used in the views.
module
Gitlab
...
...
lib/gitlab/blame.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Blame
attr_accessor
:blob
,
:commit
...
...
lib/gitlab/blob_helper.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# This has been extracted from https://github.com/github/linguist/blob/master/lib/linguist/blob_helper.rb
module
Gitlab
module
BlobHelper
...
...
lib/gitlab/build_access.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
BuildAccess
<
UserAccess
attr_accessor
:user
,
:project
...
...
lib/gitlab/changes_list.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ChangesList
include
Enumerable
...
...
lib/gitlab/chat_name_token.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
require
'json'
module
Gitlab
...
...
lib/gitlab/ci_access.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# For backwards compatibility, generic CI (which is a build without a user) is
# allowed to :build_download_code without any other checks.
...
...
lib/gitlab/closing_issue_extractor.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ClosingIssueExtractor
ISSUE_CLOSING_REGEX
=
begin
...
...
lib/gitlab/color_schemes.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Module containing GitLab's syntax color scheme definitions and helper
# methods for accessing them.
...
...
lib/gitlab/config_helper.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab::ConfigHelper
def
gitlab_config_features
Gitlab
.
config
.
gitlab
.
default_projects_features
...
...
lib/gitlab/contributions_calendar.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ContributionsCalendar
attr_reader
:contributor
...
...
lib/gitlab/contributor.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Contributor
attr_accessor
:email
,
:name
,
:commits
,
:additions
,
:deletions
...
...
lib/gitlab/cross_project_access.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
CrossProjectAccess
class
<<
self
...
...
lib/gitlab/current_settings.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
CurrentSettings
class
<<
self
...
...
lib/gitlab/daemon.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Daemon
def
self
.
initialize_instance
(
*
args
)
...
...
lib/gitlab/database.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Database
# The max value of INTEGER type is the same between MySQL and PostgreSQL:
...
...
@@ -99,11 +101,11 @@ module Gitlab
order
=
"
#{
field
}
#{
direction
}
"
if
postgresql?
order
<<
' NULLS LAST'
order
=
"
#{
order
}
NULLS LAST"
else
# `field IS NULL` will be `0` for non-NULL columns and `1` for NULL
# columns. In the (default) ascending order, `0` comes first.
order
.
prepend
(
"
#{
field
}
IS NULL, "
)
if
direction
==
'ASC'
order
=
"
#{
field
}
IS NULL,
#{
order
}
"
if
direction
==
'ASC'
end
order
...
...
@@ -113,11 +115,11 @@ module Gitlab
order
=
"
#{
field
}
#{
direction
}
"
if
postgresql?
order
<<
' NULLS FIRST'
order
=
"
#{
order
}
NULLS FIRST"
else
# `field IS NULL` will be `0` for non-NULL columns and `1` for NULL
# columns. In the (default) ascending order, `0` comes first.
order
.
prepend
(
"
#{
field
}
IS NULL, "
)
if
direction
==
'DESC'
order
=
"
#{
field
}
IS NULL,
#{
order
}
"
if
direction
==
'DESC'
end
order
...
...
@@ -184,7 +186,7 @@ module Gitlab
EOF
if
return_ids
sql
<<
'RETURNING id'
sql
=
"
#{
sql
}
RETURNING id"
end
result
=
connection
.
execute
(
sql
)
...
...
lib/gitlab/dependency_linker.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
DependencyLinker
LINKERS
=
[
...
...
lib/gitlab/downtime_check.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Checks if a set of migrations requires downtime or not.
class
DowntimeCheck
...
...
lib/gitlab/ee_compat_check.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# rubocop: disable Rails/Output
module
Gitlab
# Checks if a set of migrations requires downtime or not.
...
...
lib/gitlab/emoji.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Emoji
extend
self
...
...
lib/gitlab/encoding_helper.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
EncodingHelper
extend
self
...
...
lib/gitlab/environment.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Environment
def
self
.
hostname
...
...
lib/gitlab/environment_logger.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
EnvironmentLogger
<
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/exclusive_lease.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
require
'securerandom'
module
Gitlab
...
...
lib/gitlab/exclusive_lease_helpers.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# This module provides helper methods which are intregrated with GitLab::ExclusiveLease
module
ExclusiveLeaseHelpers
...
...
lib/gitlab/fake_application_settings.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# This class extends an OpenStruct object by adding predicate methods to mimic
# ActiveRecord access. We rely on the initial values being true or false to
# determine whether to define a predicate method because for a newly-added
...
...
lib/gitlab/favicon.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Favicon
class
<<
self
...
...
lib/gitlab/file_detector.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
require
'set'
module
Gitlab
...
...
lib/gitlab/file_finder.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# This class finds files in a repository by name and content
# the result is joined and sorted by file name
module
Gitlab
...
...
lib/gitlab/file_markdown_link_builder.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# Builds the markdown link of a file
# It needs the methods filename and secure_url (final destination url) to be defined.
module
Gitlab
...
...
@@ -8,7 +10,7 @@ module Gitlab
return
unless
name
=
markdown_name
markdown
=
"[
#{
name
.
gsub
(
']'
,
'\\]'
)
}
](
#{
secure_url
}
)"
markdown
.
prepend
(
"!"
)
if
image_or_video?
||
dangerous?
markdown
=
"!
#{
markdown
}
"
if
image_or_video?
||
dangerous?
markdown
end
...
...
lib/gitlab/git.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
require_dependency
'gitlab/encoding_helper'
module
Gitlab
...
...
lib/gitlab/git_access.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# Check a user's access to perform a git action. All public methods in this
# class return an instance of `GitlabAccessStatus`
module
Gitlab
...
...
lib/gitlab/git_access_wiki.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
GitAccessWiki
<
GitAccess
ERROR_MESSAGES
=
{
...
...
lib/gitlab/git_logger.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
GitLogger
<
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/git_ref_validator.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# Gitaly note: JV: does not need to be migrated, works without a repo.
module
Gitlab
...
...
lib/gitlab/gitaly_client.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
require
'base64'
require
'gitaly'
...
...
@@ -23,7 +25,7 @@ module Gitlab
stacks
=
most_invoked_stack
.
join
(
'\n'
)
if
most_invoked_stack
msg
=
"GitalyClient#
#{
call_site
}
called
#{
invocation_count
}
times from single request. Potential n+1?"
msg
<<
"
\n
The following call site called into Gitaly
#{
max_call_stack
}
times:
\n
#{
stacks
}
\n
"
if
stacks
msg
=
"
#{
msg
}
\n
The following call site called into Gitaly
#{
max_call_stack
}
times:
\n
#{
stacks
}
\n
"
if
stacks
super
(
msg
)
end
...
...
lib/gitlab/github_import.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
GithubImport
def
self
.
refmap
...
...
lib/gitlab/gl_id.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
GlId
def
self
.
gl_id
(
user
)
...
...
lib/gitlab/gl_repository.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
GlRepository
def
self
.
gl_repository
(
project
,
is_wiki
)
...
...
lib/gitlab/gon_helper.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# rubocop:disable Metrics/AbcSize
module
Gitlab
...
...
lib/gitlab/gpg.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Gpg
extend
self
...
...
lib/gitlab/graphql.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Graphql
StandardGraphqlError
=
Class
.
new
(
StandardError
)
...
...
lib/gitlab/group_hierarchy.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Retrieving of parent or child groups based on a base ActiveRecord relation.
#
...
...
lib/gitlab/highlight.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Highlight
TIMEOUT_BACKGROUND
=
30
.
seconds
...
...
lib/gitlab/http.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# This class is used as a proxy for all outbounding http connection
# coming from callbacks, services and hooks. The direct use of the HTTParty
# is discouraged because it can lead to several security problems, like SSRF
...
...
lib/gitlab/http_io.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
##
# This class is compatible with IO class (https://ruby-doc.org/core-2.3.1/IO.html)
# source: https://gitlab.com/snippets/1685610
...
...
@@ -73,8 +75,8 @@ module Gitlab
end
end
def
read
(
length
=
nil
,
outbuf
=
""
)
out
=
""
def
read
(
length
=
nil
,
outbuf
=
nil
)
out
=
[]
length
||=
size
-
tell
...
...
@@ -90,17 +92,18 @@ module Gitlab
length
-=
chunk_data
.
bytesize
end
out
=
out
.
join
# If outbuf is passed, we put the output into the buffer. This supports IO.copy_stream functionality
if
outbuf
outbuf
.
slice!
(
0
,
outbuf
.
bytesize
)
outbuf
<<
out
outbuf
.
replace
(
out
)
end
out
end
def
readline
out
=
""
out
=
[]
until
eof?
data
=
get_chunk
...
...
@@ -116,7 +119,7 @@ module Gitlab
end
end
out
out
.
join
end
def
write
(
data
)
...
...
lib/gitlab/i18n.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
I18n
extend
self
...
...
lib/gitlab/identifier.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# Detect user based on identifier like
# key-13 or user-36 or last commit
module
Gitlab
...
...
lib/gitlab/import_export.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
ImportExport
extend
self
...
...
lib/gitlab/import_formatter.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ImportFormatter
def
comment
(
author
,
date
,
body
)
...
...
lib/gitlab/import_sources.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# Gitlab::ImportSources module
#
# Define import sources that can be used
...
...
lib/gitlab/incoming_email.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
IncomingEmail
UNSUBSCRIBE_SUFFIX
=
'+unsubscribe'
.
freeze
...
...
lib/gitlab/insecure_key_fingerprint.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
#
# Calculates the fingerprint of a given key without using
...
...
lib/gitlab/issuable_metadata.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
IssuableMetadata
def
issuable_meta_data
(
issuable_collection
,
collection_type
)
...
...
lib/gitlab/issuable_sorter.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
IssuableSorter
class
<<
self
...
...
lib/gitlab/issuables_count_for_state.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Class for counting and caching the number of issuables per state.
class
IssuablesCountForState
...
...
lib/gitlab/issues_labels.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
IssuesLabels
class
<<
self
...
...
lib/gitlab/job_waiter.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# JobWaiter can be used to wait for a number of Sidekiq jobs to complete.
#
...
...
lib/gitlab/json_logger.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
JsonLogger
<
::
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/kubernetes.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Helper methods to do with Kubernetes network services & resources
module
Kubernetes
...
...
lib/gitlab/language_detection.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
LanguageDetection
MAX_LANGUAGES
=
5
...
...
lib/gitlab/lazy.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# A class that can be wrapped around an expensive method call so it's only
# executed when actually needed.
...
...
lib/gitlab/lfs_token.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
LfsToken
attr_accessor
:actor
...
...
lib/gitlab/logger.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Logger
<
::
Logger
def
self
.
file_name
...
...
lib/gitlab/mail_room.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
require
'yaml'
require
'json'
require_relative
'redis/queues'
unless
defined?
(
Gitlab
::
Redis
::
Queues
)
...
...
lib/gitlab/markup_helper.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
MarkupHelper
extend
self
...
...
lib/gitlab/metrics.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Metrics
include
Gitlab
::
Metrics
::
InfluxDb
...
...
lib/gitlab/multi_collection_paginator.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
MultiCollectionPaginator
attr_reader
:first_collection
,
:second_collection
,
:per_page
...
...
lib/gitlab/omniauth_initializer.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
OmniauthInitializer
def
initialize
(
devise_config
)
...
...
lib/gitlab/optimistic_locking.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
OptimisticLocking
module_function
...
...
lib/gitlab/other_markup.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Parser/renderer for markups without other special support code.
module
OtherMarkup
...
...
lib/gitlab/otp_key_rotator.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# The +otp_key_base+ param is used to encrypt the User#otp_secret attribute.
#
...
...
lib/gitlab/pages.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Pages
VERSION
=
File
.
read
(
Rails
.
root
.
join
(
"GITLAB_PAGES_VERSION"
)).
strip
.
freeze
...
...
lib/gitlab/pages_client.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
PagesClient
class
<<
self
...
...
lib/gitlab/pages_transfer.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
PagesTransfer
<
ProjectTransfer
def
root_dir
...
...
lib/gitlab/path_regex.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
PathRegex
extend
self
...
...
lib/gitlab/performance_bar.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
PerformanceBar
ALLOWED_USER_IDS_KEY
=
'performance_bar_allowed_user_ids:v2'
.
freeze
...
...
lib/gitlab/plugin.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Plugin
def
self
.
files
...
...
lib/gitlab/plugin_logger.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
PluginLogger
<
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/polling_interval.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
PollingInterval
HEADER_NAME
=
'Poll-Interval'
.
freeze
...
...
lib/gitlab/popen.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
require
'fileutils'
require
'open3'
...
...
@@ -11,7 +13,7 @@ module Gitlab
def
popen
(
cmd
,
path
=
nil
,
vars
=
{},
&
block
)
result
=
popen_with_detail
(
cmd
,
path
,
vars
,
&
block
)
[
result
.
stdout
<<
result
.
stderr
,
result
.
status
&
.
exitstatus
]
[
"
#{
result
.
stdout
}#{
result
.
stderr
}
"
,
result
.
status
&
.
exitstatus
]
end
# Returns Result
...
...
lib/gitlab/profiler.rb
浏览文件 @
c858f70d
# coding: utf-8
# frozen_string_literal: true
module
Gitlab
module
Profiler
FILTERED_STRING
=
'[FILTERED]'
.
freeze
...
...
lib/gitlab/project_search_results.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ProjectSearchResults
<
SearchResults
attr_reader
:project
,
:repository_ref
...
...
@@ -57,7 +59,8 @@ module Gitlab
ref
=
nil
filename
=
nil
basename
=
nil
data
=
""
data
=
[]
startline
=
0
result
.
each_line
.
each_with_index
do
|
line
,
index
|
...
...
@@ -78,7 +81,7 @@ module Gitlab
basename:
basename
,
ref:
ref
,
startline:
startline
,
data:
data
,
data:
data
.
join
,
project_id:
project
?
project
.
id
:
nil
)
end
...
...
lib/gitlab/project_service_logger.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ProjectServiceLogger
<
Gitlab
::
JsonLogger
def
self
.
file_name_noext
...
...
lib/gitlab/project_template.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ProjectTemplate
attr_reader
:title
,
:name
,
:description
,
:preview
...
...
lib/gitlab/project_transfer.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# This class is used to move local, unhashed files owned by projects to their new location
class
ProjectTransfer
...
...
lib/gitlab/prometheus_client.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Helper methods to interact with Prometheus network services & resources
class
PrometheusClient
...
...
lib/gitlab/protocol_access.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
ProtocolAccess
def
self
.
allowed?
(
protocol
)
...
...
lib/gitlab/proxy_http_connection_adapter.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
# This class is part of the Gitlab::HTTP wrapper. Depending on the value
# of the global setting allow_local_requests_from_hooks_and_services this adapter
# will allow/block connection to internal IPs and/or urls.
...
...
lib/gitlab/query_limiting.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
QueryLimiting
# Returns true if we should enable tracking of query counts.
...
...
lib/gitlab/recaptcha.rb
浏览文件 @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Recaptcha
def
self
.
load_configurations!
...
...
lib/gitlab/reference_counter.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/reference_extractor.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/regex.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/repo_path.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/repository_cache.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/repository_cache_adapter.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/repository_check_logger.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/request_context.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/request_forgery_protection.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/request_profiler.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/route_map.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/routing.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/search_results.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/seeder.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/sentry.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/setup_helper.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/shard_health_cache.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/shell.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/shell_adapter.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/sherlock.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/sidekiq_config.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/sidekiq_logger.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/sidekiq_status.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/sidekiq_versioning.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/snippet_search_results.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/ssh_public_key.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/string_placeholder_replacer.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/string_range_marker.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/string_regex_marker.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/task_helpers.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/tcp_checker.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/template_helper.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/temporarily_allow.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/themes.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/time_tracking_formatter.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/timeless.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/tree_summary.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/untrusted_regexp.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/update_path_error.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/upgrader.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/uploads_transfer.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/url_blocker.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/url_builder.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/url_sanitizer.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/usage_data.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/user_access.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/utils.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/version_info.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/visibility_level.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/wiki_file_finder.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
lib/gitlab/workhorse.rb
浏览文件 @
c858f70d
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录