Commit 5186d6fa authored by gfyoung's avatar gfyoung

Enable frozen string for lib/gitlab/ci/**/*.rb

Enables frozen string for all remaining files
in lib/gitlab/ci.

Partially addresses #47424.
parent 908a1957
---
title: Enable frozen string for remaining lib/gitlab/ci/**/*.rb
merge_request:
author: gfyoung
type: performance
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# frozen_string_literal: true
module Gitlab
module Ci
module Status
......
# 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
......@@ -66,8 +68,8 @@ module Gitlab
end
end
def read(length = nil, outbuf = "")
out = ""
def read(length = nil, outbuf = nil)
out = []
length ||= size - tell
......@@ -83,17 +85,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 = chunk_slice_from_offset
......@@ -109,7 +112,7 @@ module Gitlab
end
end
out
out.join
end
def write(data)
......
# frozen_string_literal: true
module Gitlab
module Ci
class Trace
......
# frozen_string_literal: true
module Gitlab
module Ci
class Trace
......@@ -129,8 +131,7 @@ module Gitlab
debris = ''
until (buf = read_backward(BUFFER_SIZE)).empty?
buf += debris
debris, *lines = buf.each_line.to_a
debris, *lines = (buf + debris).each_line.to_a
lines.reverse_each do |line|
yield(line.force_encoding(Encoding.default_external))
end
......
# frozen_string_literal: true
module Gitlab
module Ci
module Variables
......
# frozen_string_literal: true
module Gitlab
module Ci
module Variables
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment