Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
eb2966fa
Commit
eb2966fa
authored
Mar 02, 2019
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ref slug helper to HasRef module
parent
dc7d0249
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
app/models/ci/bridge.rb
app/models/ci/bridge.rb
+1
-0
app/models/ci/build.rb
app/models/ci/build.rb
+0
-11
app/models/concerns/has_ref.rb
app/models/concerns/has_ref.rb
+11
-0
No files found.
app/models/ci/bridge.rb
View file @
eb2966fa
...
...
@@ -5,6 +5,7 @@ module Ci
include
Ci
::
Processable
include
Importable
include
AfterCommitQueue
include
HasRef
include
Gitlab
::
Utils
::
StrongMemoize
belongs_to
:project
...
...
app/models/ci/build.rb
View file @
eb2966fa
...
...
@@ -398,17 +398,6 @@ module Ci
options
&
.
dig
(
:environment
,
:on_stop
)
end
# A slugified version of the build ref, suitable for inclusion in URLs and
# domain names. Rules:
#
# * Lowercased
# * Anything not matching [a-z0-9-] is replaced with a -
# * Maximum length is 63 bytes
# * First/Last Character is not a hyphen
def
ref_slug
Gitlab
::
Utils
.
slugify
(
ref
.
to_s
)
end
##
# Variables in the environment name scope.
#
...
...
app/models/concerns/has_ref.rb
View file @
eb2966fa
...
...
@@ -14,4 +14,15 @@ module HasRef
Gitlab
::
Git
::
TAG_REF_PREFIX
+
ref
.
to_s
end
end
# A slugified version of the build ref, suitable for inclusion in URLs and
# domain names. Rules:
#
# * Lowercased
# * Anything not matching [a-z0-9-] is replaced with a -
# * Maximum length is 63 bytes
# * First/Last Character is not a hyphen
def
ref_slug
Gitlab
::
Utils
.
slugify
(
ref
.
to_s
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment