From cb3e6b9c1b020378b5f94b4c38319a2dc961de01 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 29 Oct 2019 18:06:15 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- lib/gitlab/ci/ansi2json/converter.rb | 103 +++++++++++++++++++++----------- lib/gitlab/ci/ansi2json/line.rb | 7 ++- lib/gitlab/ci/ansi2json/state.rb | 4 +- lib/gitlab/ci/config/entry/commands.rb | 4 +- lib/gitlab/ci/config/entry/script.rb | 6 +- lib/gitlab/config/entry/validators.rb | 28 +++++++++ lib/google_api/cloud_platform/client.rb | 4 +- 7 files changed, 115 insertions(+), 41 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/ci/ansi2json/converter.rb b/lib/gitlab/ci/ansi2json/converter.rb index 8d25b66af9c..908e560999e 100644 --- a/lib/gitlab/ci/ansi2json/converter.rb +++ b/lib/gitlab/ci/ansi2json/converter.rb @@ -22,11 +22,11 @@ module Gitlab start_offset = @state.offset - @state.set_current_line!(style: Style.new(@state.inherited_style)) + @state.new_line!( + style: Style.new(@state.inherited_style)) stream.each_line do |line| - s = StringScanner.new(line) - convert_line(s) + consume_line(line) end # This must be assigned before flushing the current line @@ -52,26 +52,43 @@ module Gitlab private - def convert_line(scanner) - until scanner.eos? - - if scanner.scan(Gitlab::Regex.build_trace_section_regex) - handle_section(scanner) - elsif scanner.scan(/\e([@-_])(.*?)([@-~])/) - handle_sequence(scanner) - elsif scanner.scan(/\e(([@-_])(.*?)?)?$/) - break - elsif scanner.scan(/