2086483b24
First commit in probably 2, for resolve gitlab-org/gitlab-ce#15582. This commit is renaming files and classes from build to pipeline. Also wording is editted to pipeline. Given `pipeline` had more characters than `build`, I've made the field a bit wider. The width now matchers the one for the coverage badge, so they look nice when in a table format, or in a list. As soon as this commit is merged to master, and released, the build.svg is deprecated, meaning that all users which already placed a badge should update it. However, to make sure it keeps working tests are added for this case.
27 lines
536 B
Ruby
27 lines
536 B
Ruby
module Gitlab
|
|
module Badge
|
|
module Pipeline
|
|
##
|
|
# Class that describes pipeline badge metadata
|
|
#
|
|
class Metadata < Badge::Metadata
|
|
def initialize(badge)
|
|
@project = badge.project
|
|
@ref = badge.ref
|
|
end
|
|
|
|
def title
|
|
'pipeline status'
|
|
end
|
|
|
|
def image_url
|
|
pipeline_project_badges_url(@project, @ref, format: :svg)
|
|
end
|
|
|
|
def link_url
|
|
project_commits_url(@project, id: @ref)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|