From c8bb359f8e4ba720ebe4b59b0ea0ad4fe8afa8c7 Mon Sep 17 00:00:00 2001 From: Stefan Hanreich Date: Sat, 24 Jun 2017 22:40:53 +0200 Subject: [PATCH] chaining the methods in ref_slug --- app/models/ci/build.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index ffe8f5a28ae..b6bfbd8e0d2 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -189,9 +189,10 @@ module Ci # * Maximum length is 63 bytes # * First/Last Character is not a hyphen def ref_slug - slugified = ref.to_s.downcase - slugified.gsub!(/[^a-z0-9]/, '-') - slugified[0..62].gsub(/(\A-+|-+\z)/, '') + ref.to_s + .downcase + .gsub(/[^a-z0-9]/, '-')[0..62] + .gsub(/(\A-+|-+\z)/, '') end # Variables whose value does not depend on other variables