summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hanreich <stefanhani@gmail.com>2017-06-24 22:40:53 +0200
committerStefan Hanreich <stefanhani@gmail.com>2017-06-24 22:40:53 +0200
commitc8bb359f8e4ba720ebe4b59b0ea0ad4fe8afa8c7 (patch)
tree5838125f7825ba4dcb2c72cea62ec2f0e0e17207
parent071603a0a59ff315b1d6b1ee2996b37a37cb3c75 (diff)
downloadgitlab-ce-c8bb359f8e4ba720ebe4b59b0ea0ad4fe8afa8c7.tar.gz
chaining the methods in ref_slug
-rw-r--r--app/models/ci/build.rb7
1 files 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