Enable frozen string for lib/gitlab/*.rb
This commit is contained in:
parent
173b1436b1
commit
c858f70d07
151 changed files with 327 additions and 22 deletions
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Enable frozen string for lib/gitlab/*.rb
|
||||
merge_request:
|
||||
author: gfyoung
|
||||
type: performance
|
|
@ -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)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Gitlab::Access module
|
||||
#
|
||||
# Define allowed roles that can be used
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Allowable
|
||||
def can?(*args)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class AppLogger < Gitlab::Logger
|
||||
def self.file_name_noext
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'asciidoctor'
|
||||
require 'asciidoctor/converter/html5'
|
||||
require "asciidoctor-plantuml"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Auth
|
||||
MissingPersonalAccessTokenError = Class.new(StandardError)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module BackgroundMigration
|
||||
def self.queue
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# This is a base controller for doorkeeper.
|
||||
# It adds the `can?` helper used in the views.
|
||||
module Gitlab
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class Blame
|
||||
attr_accessor :blob, :commit
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class BuildAccess < UserAccess
|
||||
attr_accessor :user, :project
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class ChangesList
|
||||
include Enumerable
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'json'
|
||||
|
||||
module Gitlab
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class ClosingIssueExtractor
|
||||
ISSUE_CLOSING_REGEX = begin
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
# Module containing GitLab's syntax color scheme definitions and helper
|
||||
# methods for accessing them.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab::ConfigHelper
|
||||
def gitlab_config_features
|
||||
Gitlab.config.gitlab.default_projects_features
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class ContributionsCalendar
|
||||
attr_reader :contributor
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class Contributor
|
||||
attr_accessor :email, :name, :commits, :additions, :deletions
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class CrossProjectAccess
|
||||
class << self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module CurrentSettings
|
||||
class << self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class Daemon
|
||||
def self.initialize_instance(*args)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module DependencyLinker
|
||||
LINKERS = [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
# Checks if a set of migrations requires downtime or not.
|
||||
class DowntimeCheck
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# rubocop: disable Rails/Output
|
||||
module Gitlab
|
||||
# Checks if a set of migrations requires downtime or not.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Emoji
|
||||
extend self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module EncodingHelper
|
||||
extend self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Environment
|
||||
def self.hostname
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class EnvironmentLogger < Gitlab::Logger
|
||||
def self.file_name_noext
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'securerandom'
|
||||
|
||||
module Gitlab
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
# This module provides helper methods which are intregrated with GitLab::ExclusiveLease
|
||||
module ExclusiveLeaseHelpers
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class Favicon
|
||||
class << self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'set'
|
||||
|
||||
module Gitlab
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_dependency 'gitlab/encoding_helper'
|
||||
|
||||
module Gitlab
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class GitAccessWiki < GitAccess
|
||||
ERROR_MESSAGES = {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class GitLogger < Gitlab::Logger
|
||||
def self.file_name_noext
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Gitaly note: JV: does not need to be migrated, works without a repo.
|
||||
|
||||
module Gitlab
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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 << "\nThe following call site called into Gitaly #{max_call_stack} times:\n#{stacks}\n" if stacks
|
||||
msg = "#{msg}\nThe following call site called into Gitaly #{max_call_stack} times:\n#{stacks}\n" if stacks
|
||||
|
||||
super(msg)
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module GithubImport
|
||||
def self.refmap
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module GlId
|
||||
def self.gl_id(user)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module GlRepository
|
||||
def self.gl_repository(project, is_wiki)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
|
||||
module Gitlab
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Gpg
|
||||
extend self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Graphql
|
||||
StandardGraphqlError = Class.new(StandardError)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
# Retrieving of parent or child groups based on a base ActiveRecord relation.
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class Highlight
|
||||
TIMEOUT_BACKGROUND = 30.seconds
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module I18n
|
||||
extend self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Detect user based on identifier like
|
||||
# key-13 or user-36 or last commit
|
||||
module Gitlab
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module ImportExport
|
||||
extend self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class ImportFormatter
|
||||
def comment(author, date, body)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Gitlab::ImportSources module
|
||||
#
|
||||
# Define import sources that can be used
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module IncomingEmail
|
||||
UNSUBSCRIBE_SUFFIX = '+unsubscribe'.freeze
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
#
|
||||
# Calculates the fingerprint of a given key without using
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module IssuableMetadata
|
||||
def issuable_meta_data(issuable_collection, collection_type)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module IssuableSorter
|
||||
class << self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
# Class for counting and caching the number of issuables per state.
|
||||
class IssuablesCountForState
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class IssuesLabels
|
||||
class << self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
# JobWaiter can be used to wait for a number of Sidekiq jobs to complete.
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class JsonLogger < ::Gitlab::Logger
|
||||
def self.file_name_noext
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
# Helper methods to do with Kubernetes network services & resources
|
||||
module Kubernetes
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class LanguageDetection
|
||||
MAX_LANGUAGES = 5
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class LfsToken
|
||||
attr_accessor :actor
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class Logger < ::Logger
|
||||
def self.file_name
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'yaml'
|
||||
require 'json'
|
||||
require_relative 'redis/queues' unless defined?(Gitlab::Redis::Queues)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module MarkupHelper
|
||||
extend self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Metrics
|
||||
include Gitlab::Metrics::InfluxDb
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class MultiCollectionPaginator
|
||||
attr_reader :first_collection, :second_collection, :per_page
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class OmniauthInitializer
|
||||
def initialize(devise_config)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module OptimisticLocking
|
||||
module_function
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
# Parser/renderer for markups without other special support code.
|
||||
module OtherMarkup
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
# The +otp_key_base+ param is used to encrypt the User#otp_secret attribute.
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Pages
|
||||
VERSION = File.read(Rails.root.join("GITLAB_PAGES_VERSION")).strip.freeze
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class PagesClient
|
||||
class << self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class PagesTransfer < ProjectTransfer
|
||||
def root_dir
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module PathRegex
|
||||
extend self
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module PerformanceBar
|
||||
ALLOWED_USER_IDS_KEY = 'performance_bar_allowed_user_ids:v2'.freeze
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Plugin
|
||||
def self.files
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class PluginLogger < Gitlab::Logger
|
||||
def self.file_name_noext
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class PollingInterval
|
||||
HEADER_NAME = 'Poll-Interval'.freeze
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
# coding: utf-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Profiler
|
||||
FILTERED_STRING = '[FILTERED]'.freeze
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class ProjectServiceLogger < Gitlab::JsonLogger
|
||||
def self.file_name_noext
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
class ProjectTemplate
|
||||
attr_reader :title, :name, :description, :preview
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
# This class is used to move local, unhashed files owned by projects to their new location
|
||||
class ProjectTransfer
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
# Helper methods to interact with Prometheus network services & resources
|
||||
class PrometheusClient
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module ProtocolAccess
|
||||
def self.allowed?(protocol)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module QueryLimiting
|
||||
# Returns true if we should enable tracking of query counts.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module Recaptcha
|
||||
def self.load_configurations!
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue