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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
c858f70d
Commit
c858f70d
authored
Oct 22, 2018
by
gfyoung
Committed by
Rémy Coutable
Oct 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable frozen string for lib/gitlab/*.rb
parent
173b1436
Changes
151
Hide whitespace changes
Inline
Side-by-side
Showing
151 changed files
with
327 additions
and
22 deletions
+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
No files found.
changelogs/unreleased/frozen-string-enable-lib-gitlab.yml
0 → 100644
View file @
c858f70d
---
title
:
Enable frozen string for lib/gitlab/*.rb
merge_request
:
author
:
gfyoung
type
:
performance
lib/backup/manager.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
# Gitlab::Access module
#
# Define allowed roles that can be used
...
...
lib/gitlab/action_rate_limiter.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Allowable
def
can?
(
*
args
)
...
...
lib/gitlab/app_logger.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
AppLogger
<
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/asciidoc.rb
View file @
c858f70d
# frozen_string_literal: true
require
'asciidoctor'
require
'asciidoctor/converter/html5'
require
"asciidoctor-plantuml"
...
...
lib/gitlab/auth.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Auth
MissingPersonalAccessTokenError
=
Class
.
new
(
StandardError
)
...
...
lib/gitlab/background_migration.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
BackgroundMigration
def
self
.
queue
...
...
lib/gitlab/base_doorkeeper_controller.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Blame
attr_accessor
:blob
,
:commit
...
...
lib/gitlab/blob_helper.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
BuildAccess
<
UserAccess
attr_accessor
:user
,
:project
...
...
lib/gitlab/changes_list.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ChangesList
include
Enumerable
...
...
lib/gitlab/chat_name_token.rb
View file @
c858f70d
# frozen_string_literal: true
require
'json'
module
Gitlab
...
...
lib/gitlab/ci_access.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ClosingIssueExtractor
ISSUE_CLOSING_REGEX
=
begin
...
...
lib/gitlab/color_schemes.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab::ConfigHelper
def
gitlab_config_features
Gitlab
.
config
.
gitlab
.
default_projects_features
...
...
lib/gitlab/contributions_calendar.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ContributionsCalendar
attr_reader
:contributor
...
...
lib/gitlab/contributor.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Contributor
attr_accessor
:email
,
:name
,
:commits
,
:additions
,
:deletions
...
...
lib/gitlab/cross_project_access.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
CrossProjectAccess
class
<<
self
...
...
lib/gitlab/current_settings.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
CurrentSettings
class
<<
self
...
...
lib/gitlab/daemon.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Daemon
def
self
.
initialize_instance
(
*
args
)
...
...
lib/gitlab/database.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
DependencyLinker
LINKERS
=
[
...
...
lib/gitlab/downtime_check.rb
View file @
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
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Emoji
extend
self
...
...
lib/gitlab/encoding_helper.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
EncodingHelper
extend
self
...
...
lib/gitlab/environment.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Environment
def
self
.
hostname
...
...
lib/gitlab/environment_logger.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
EnvironmentLogger
<
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/exclusive_lease.rb
View file @
c858f70d
# frozen_string_literal: true
require
'securerandom'
module
Gitlab
...
...
lib/gitlab/exclusive_lease_helpers.rb
View file @
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
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Favicon
class
<<
self
...
...
lib/gitlab/file_detector.rb
View file @
c858f70d
# frozen_string_literal: true
require
'set'
module
Gitlab
...
...
lib/gitlab/file_finder.rb
View file @
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
View file @
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
View file @
c858f70d
# frozen_string_literal: true
require_dependency
'gitlab/encoding_helper'
module
Gitlab
...
...
lib/gitlab/git_access.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
GitAccessWiki
<
GitAccess
ERROR_MESSAGES
=
{
...
...
lib/gitlab/git_logger.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
GitLogger
<
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/git_ref_validator.rb
View file @
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
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
GithubImport
def
self
.
refmap
...
...
lib/gitlab/gl_id.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
GlId
def
self
.
gl_id
(
user
)
...
...
lib/gitlab/gl_repository.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
GlRepository
def
self
.
gl_repository
(
project
,
is_wiki
)
...
...
lib/gitlab/gon_helper.rb
View file @
c858f70d
# frozen_string_literal: true
# rubocop:disable Metrics/AbcSize
module
Gitlab
...
...
lib/gitlab/gpg.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Gpg
extend
self
...
...
lib/gitlab/graphql.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Graphql
StandardGraphqlError
=
Class
.
new
(
StandardError
)
...
...
lib/gitlab/group_hierarchy.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Retrieving of parent or child groups based on a base ActiveRecord relation.
#
...
...
lib/gitlab/highlight.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Highlight
TIMEOUT_BACKGROUND
=
30
.
seconds
...
...
lib/gitlab/http.rb
View file @
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
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
I18n
extend
self
...
...
lib/gitlab/identifier.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
ImportExport
extend
self
...
...
lib/gitlab/import_formatter.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ImportFormatter
def
comment
(
author
,
date
,
body
)
...
...
lib/gitlab/import_sources.rb
View file @
c858f70d
# frozen_string_literal: true
# Gitlab::ImportSources module
#
# Define import sources that can be used
...
...
lib/gitlab/incoming_email.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
IncomingEmail
UNSUBSCRIBE_SUFFIX
=
'+unsubscribe'
.
freeze
...
...
lib/gitlab/insecure_key_fingerprint.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
#
# Calculates the fingerprint of a given key without using
...
...
lib/gitlab/issuable_metadata.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
IssuableMetadata
def
issuable_meta_data
(
issuable_collection
,
collection_type
)
...
...
lib/gitlab/issuable_sorter.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
IssuableSorter
class
<<
self
...
...
lib/gitlab/issuables_count_for_state.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
IssuesLabels
class
<<
self
...
...
lib/gitlab/job_waiter.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
JsonLogger
<
::
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/kubernetes.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Helper methods to do with Kubernetes network services & resources
module
Kubernetes
...
...
lib/gitlab/language_detection.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
LanguageDetection
MAX_LANGUAGES
=
5
...
...
lib/gitlab/lazy.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
LfsToken
attr_accessor
:actor
...
...
lib/gitlab/logger.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Logger
<
::
Logger
def
self
.
file_name
...
...
lib/gitlab/mail_room.rb
View file @
c858f70d
# frozen_string_literal: true
require
'yaml'
require
'json'
require_relative
'redis/queues'
unless
defined?
(
Gitlab
::
Redis
::
Queues
)
...
...
lib/gitlab/markup_helper.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
MarkupHelper
extend
self
...
...
lib/gitlab/metrics.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Metrics
include
Gitlab
::
Metrics
::
InfluxDb
...
...
lib/gitlab/multi_collection_paginator.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
MultiCollectionPaginator
attr_reader
:first_collection
,
:second_collection
,
:per_page
...
...
lib/gitlab/omniauth_initializer.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
OmniauthInitializer
def
initialize
(
devise_config
)
...
...
lib/gitlab/optimistic_locking.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
OptimisticLocking
module_function
...
...
lib/gitlab/other_markup.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Parser/renderer for markups without other special support code.
module
OtherMarkup
...
...
lib/gitlab/otp_key_rotator.rb
View file @
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
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
PagesClient
class
<<
self
...
...
lib/gitlab/pages_transfer.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
PagesTransfer
<
ProjectTransfer
def
root_dir
...
...
lib/gitlab/path_regex.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
PathRegex
extend
self
...
...
lib/gitlab/performance_bar.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
PerformanceBar
ALLOWED_USER_IDS_KEY
=
'performance_bar_allowed_user_ids:v2'
.
freeze
...
...
lib/gitlab/plugin.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Plugin
def
self
.
files
...
...
lib/gitlab/plugin_logger.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
PluginLogger
<
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/polling_interval.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
PollingInterval
HEADER_NAME
=
'Poll-Interval'
.
freeze
...
...
lib/gitlab/popen.rb
View file @
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
View file @
c858f70d
# coding: utf-8
# frozen_string_literal: true
module
Gitlab
module
Profiler
FILTERED_STRING
=
'[FILTERED]'
.
freeze
...
...
lib/gitlab/project_search_results.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ProjectServiceLogger
<
Gitlab
::
JsonLogger
def
self
.
file_name_noext
...
...
lib/gitlab/project_template.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ProjectTemplate
attr_reader
:title
,
:name
,
:description
,
:preview
...
...
lib/gitlab/project_transfer.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Helper methods to interact with Prometheus network services & resources
class
PrometheusClient
...
...
lib/gitlab/protocol_access.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
ProtocolAccess
def
self
.
allowed?
(
protocol
)
...
...
lib/gitlab/proxy_http_connection_adapter.rb
View file @
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
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
QueryLimiting
# Returns true if we should enable tracking of query counts.
...
...
lib/gitlab/recaptcha.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Recaptcha
def
self
.
load_configurations!
...
...
lib/gitlab/reference_counter.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ReferenceCounter
REFERENCE_EXPIRE_TIME
=
600
...
...
lib/gitlab/reference_extractor.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Extract possible GFM references from an arbitrary String for further processing.
class
ReferenceExtractor
<
Banzai
::
ReferenceExtractor
...
...
lib/gitlab/regex.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Regex
extend
self
...
...
lib/gitlab/repo_path.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
RepoPath
NotFoundError
=
Class
.
new
(
StandardError
)
...
...
lib/gitlab/repository_cache.rb
View file @
c858f70d
# frozen_string_literal: true
# Interface to the Redis-backed cache store
module
Gitlab
class
RepositoryCache
...
...
@@ -6,7 +8,7 @@ module Gitlab
def
initialize
(
repository
,
extra_namespace:
nil
,
backend:
Rails
.
cache
)
@repository
=
repository
@namespace
=
"
#{
repository
.
full_path
}
:
#{
repository
.
project
.
id
}
"
@namespace
+=
"
:
#{
extra_namespace
}
"
if
extra_namespace
@namespace
=
"
#{
@namespace
}
:
#{
extra_namespace
}
"
if
extra_namespace
@backend
=
backend
end
...
...
lib/gitlab/repository_cache_adapter.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
RepositoryCacheAdapter
extend
ActiveSupport
::
Concern
...
...
lib/gitlab/repository_check_logger.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
RepositoryCheckLogger
<
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/request_context.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
RequestContext
class
<<
self
...
...
lib/gitlab/request_forgery_protection.rb
View file @
c858f70d
# frozen_string_literal: true
# A module to check CSRF tokens in requests.
# It's used in API helpers and OmniAuth.
# Usage: GitLab::RequestForgeryProtection.call(env)
...
...
lib/gitlab/request_profiler.rb
View file @
c858f70d
# frozen_string_literal: true
require
'fileutils'
module
Gitlab
...
...
lib/gitlab/route_map.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
RouteMap
FormatError
=
Class
.
new
(
StandardError
)
...
...
lib/gitlab/routing.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Routing
extend
ActiveSupport
::
Concern
...
...
@@ -47,7 +49,7 @@ module Gitlab
#
# `request.fullpath` includes the querystring
new_path
=
request
.
path
.
sub
(
%r{/
#{
path
}
(/*)(?!.*
#{
path
}
)}
,
"/-/
#{
path
}
\\
1"
)
new_path
<<
"
?
#{
request
.
query_string
}
"
if
request
.
query_string
.
present?
new_path
=
"
#{
new_path
}
?
#{
request
.
query_string
}
"
if
request
.
query_string
.
present?
new_path
end
...
...
lib/gitlab/search_results.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
SearchResults
class
FoundBlob
...
...
lib/gitlab/seeder.rb
View file @
c858f70d
# frozen_string_literal: true
# :nocov:
module
DeliverNever
def
deliver_later
...
...
lib/gitlab/sentry.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Sentry
def
self
.
enabled?
...
...
lib/gitlab/setup_helper.rb
View file @
c858f70d
# frozen_string_literal: true
require
'toml-rb'
module
Gitlab
...
...
lib/gitlab/shard_health_cache.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
ShardHealthCache
HEALTHY_SHARDS_KEY
=
'gitlab-healthy-shards'
.
freeze
...
...
lib/gitlab/shell.rb
View file @
c858f70d
# frozen_string_literal: true
# Gitaly note: SSH key operations are not part of Gitaly so will never be migrated.
require
'securerandom'
...
...
lib/gitlab/shell_adapter.rb
View file @
c858f70d
# frozen_string_literal: true
# == GitLab Shell mixin
#
# Provide a shortcut to Gitlab::Shell instance by gitlab_shell
...
...
lib/gitlab/sherlock.rb
View file @
c858f70d
# frozen_string_literal: true
require
'securerandom'
module
Gitlab
...
...
lib/gitlab/sidekiq_config.rb
View file @
c858f70d
# frozen_string_literal: true
require
'yaml'
require
'set'
...
...
lib/gitlab/sidekiq_logger.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
SidekiqLogger
<
Gitlab
::
Logger
def
self
.
file_name_noext
...
...
lib/gitlab/sidekiq_status.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
# The SidekiqStatus module and its child classes can be used for checking if a
# Sidekiq job has been processed or not.
...
...
lib/gitlab/sidekiq_versioning.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
SidekiqVersioning
def
self
.
install!
...
...
lib/gitlab/snippet_search_results.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
SnippetSearchResults
<
SearchResults
include
SnippetsHelper
...
...
lib/gitlab/ssh_public_key.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
SSHPublicKey
Technology
=
Struct
.
new
(
:name
,
:key_class
,
:supported_sizes
)
...
...
@@ -26,7 +28,7 @@ module Gitlab
return
key_content
if
parts
.
empty?
parts
.
each_with_object
(
"
#{
ssh_type
}
"
).
with_index
do
|
(
part
,
content
),
index
|
parts
.
each_with_object
(
+
"
#{
ssh_type
}
"
).
with_index
do
|
(
part
,
content
),
index
|
content
<<
part
if
Gitlab
::
SSHPublicKey
.
new
(
content
).
valid?
...
...
lib/gitlab/string_placeholder_replacer.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
StringPlaceholderReplacer
# This method accepts the following paras
...
...
lib/gitlab/string_range_marker.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
StringRangeMarker
attr_accessor
:raw_line
,
:rich_line
,
:html_escaped
...
...
lib/gitlab/string_regex_marker.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
StringRegexMarker
<
StringRangeMarker
# rubocop: disable CodeReuse/ActiveRecord
...
...
lib/gitlab/task_helpers.rb
View file @
c858f70d
# frozen_string_literal: true
require
'rainbow/ext/string'
require
'gitlab/utils/strong_memoize'
...
...
@@ -39,7 +41,7 @@ module Gitlab
File
.
read
(
'/etc/os-release'
).
match
(
/PRETTY_NAME=\"(.+)\"/
)[
1
]
end
os_name
.
try
(
:squish
!
)
os_name
.
try
(
:squish
)
end
# Prompt the user to input something
...
...
lib/gitlab/tcp_checker.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
TcpChecker
attr_reader
:remote_host
,
:remote_port
,
:local_host
,
:local_port
,
:error
...
...
lib/gitlab/template_helper.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
TemplateHelper
def
prepare_template_environment
(
file
)
...
...
lib/gitlab/temporarily_allow.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
TemporarilyAllow
TEMPORARILY_ALLOW_MUTEX
=
Mutex
.
new
...
...
lib/gitlab/themes.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
# Module containing GitLab's application theme definitions and helper methods
# for accessing them.
...
...
lib/gitlab/time_tracking_formatter.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
TimeTrackingFormatter
extend
self
...
...
lib/gitlab/timeless.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Timeless
def
self
.
timeless
(
model
,
&
block
)
...
...
lib/gitlab/tree_summary.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
TreeSummary
include
::
Gitlab
::
Utils
::
StrongMemoize
...
...
lib/gitlab/untrusted_regexp.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
# An untrusted regular expression is any regexp containing patterns sourced
# from user input.
...
...
lib/gitlab/update_path_error.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
UpdatePathError
=
Class
.
new
(
StandardError
)
end
lib/gitlab/upgrader.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
Upgrader
def
execute
...
...
lib/gitlab/uploads_transfer.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
UploadsTransfer
<
ProjectTransfer
def
root_dir
...
...
lib/gitlab/url_blocker.rb
View file @
c858f70d
# frozen_string_literal: true
require
'resolv'
module
Gitlab
...
...
lib/gitlab/url_builder.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
UrlBuilder
include
Gitlab
::
Routing
...
...
lib/gitlab/url_sanitizer.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
UrlSanitizer
ALLOWED_SCHEMES
=
%w[http https ssh git]
.
freeze
...
...
lib/gitlab/usage_data.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
UsageData
class
<<
self
...
...
lib/gitlab/user_access.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
UserAccess
extend
Gitlab
::
Cache
::
RequestCache
...
...
lib/gitlab/utils.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
module
Utils
extend
self
...
...
lib/gitlab/version_info.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
VersionInfo
include
Comparable
...
...
lib/gitlab/visibility_level.rb
View file @
c858f70d
# frozen_string_literal: true
# Gitlab::VisibilityLevel module
#
# Define allowed public modes that can be used for
...
...
lib/gitlab/wiki_file_finder.rb
View file @
c858f70d
# frozen_string_literal: true
module
Gitlab
class
WikiFileFinder
<
FileFinder
attr_reader
:repository
...
...
lib/gitlab/workhorse.rb
View file @
c858f70d
# frozen_string_literal: true
require
'base64'
require
'json'
require
'securerandom'
...
...
@@ -63,7 +65,7 @@ module Gitlab
def
send_git_archive
(
repository
,
ref
:,
format
:,
append_sha
:)
format
||=
'tar.gz'
format
.
downcase!
format
=
format
.
downcase
params
=
repository
.
archive_metadata
(
ref
,
Gitlab
.
config
.
gitlab
.
repository_downloads_path
,
format
,
append_sha:
append_sha
)
raise
"Repository or ref not found"
if
params
.
empty?
...
...
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