2016-07-28 08:35:02 -04:00
|
|
|
module Gitlab
|
|
|
|
module Badge
|
2016-08-10 08:12:31 -04:00
|
|
|
module Build
|
2016-07-28 08:35:02 -04:00
|
|
|
##
|
|
|
|
# Class that describes build badge metadata
|
|
|
|
#
|
2016-08-11 08:08:27 -04:00
|
|
|
class Metadata < Badge::Metadata
|
2016-08-11 05:16:14 -04:00
|
|
|
def initialize(badge)
|
|
|
|
@project = badge.project
|
|
|
|
@ref = badge.ref
|
2016-07-28 08:35:02 -04:00
|
|
|
end
|
|
|
|
|
2016-08-11 08:08:27 -04:00
|
|
|
def title
|
|
|
|
'build status'
|
2016-07-28 08:35:02 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def image_url
|
2017-06-29 13:06:35 -04:00
|
|
|
build_project_badges_url(@project, @ref, format: :svg)
|
2016-07-28 08:35:02 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def link_url
|
2017-06-29 13:06:35 -04:00
|
|
|
project_commits_url(@project, id: @ref)
|
2016-07-28 08:35:02 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|