2016-09-13 17:45:13 +05:30
|
|
|
module Gitlab
|
|
|
|
module Badge
|
2017-09-10 17:25:29 +05:30
|
|
|
module Pipeline
|
2016-09-13 17:45:13 +05:30
|
|
|
##
|
2017-09-10 17:25:29 +05:30
|
|
|
# Class that describes pipeline badge metadata
|
2016-09-13 17:45:13 +05:30
|
|
|
#
|
|
|
|
class Metadata < Badge::Metadata
|
|
|
|
def initialize(badge)
|
|
|
|
@project = badge.project
|
|
|
|
@ref = badge.ref
|
|
|
|
end
|
|
|
|
|
|
|
|
def title
|
2017-09-10 17:25:29 +05:30
|
|
|
'pipeline status'
|
2016-09-13 17:45:13 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def image_url
|
2017-09-10 17:25:29 +05:30
|
|
|
pipeline_project_badges_url(@project, @ref, format: :svg)
|
2016-09-13 17:45:13 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def link_url
|
2017-09-10 17:25:29 +05:30
|
|
|
project_commits_url(@project, id: @ref)
|
2016-09-13 17:45:13 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|