summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/ansi2html.rb
diff options
context:
space:
mode:
authorFabio Pitino <fpitino@gitlab.com>2019-06-14 10:20:18 +0100
committerFabio Pitino <fpitino@gitlab.com>2019-06-14 15:43:43 +0100
commitad96cc0ed7d6b02e3dd175cba8e2179d73a47e69 (patch)
tree4a174dc22192f8e411384fc3210283b7052174ae /lib/gitlab/ci/ansi2html.rb
parentcb0616fe01729cd0f2be02b16a87407a87144300 (diff)
downloadgitlab-ce-ad96cc0ed7d6b02e3dd175cba8e2179d73a47e69.tar.gz
Fixing specs
Diffstat (limited to 'lib/gitlab/ci/ansi2html.rb')
-rw-r--r--lib/gitlab/ci/ansi2html.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/ci/ansi2html.rb b/lib/gitlab/ci/ansi2html.rb
index 7f98cfa4f79..083041397dc 100644
--- a/lib/gitlab/ci/ansi2html.rb
+++ b/lib/gitlab/ci/ansi2html.rb
@@ -187,6 +187,10 @@ module Gitlab
)
end
+ def section_to_class_name(section)
+ section.to_s.downcase.gsub(/[^a-z0-9]/, '-')
+ end
+
def handle_new_line
css_classes = []
@@ -208,8 +212,7 @@ module Gitlab
section = scanner[3]
line = scanner.matched[0...-5] # strips \r\033[0K
- # generate section class
- normalized_section = section.to_s.downcase.gsub(/[^a-z0-9]/, '-')
+ normalized_section = section_to_class_name(section)
if action == "start"
handle_section_start(normalized_section, timestamp, line)