2016-08-11 07:58:57 -04:00
|
|
|
module Gitlab
|
|
|
|
module Badge
|
|
|
|
module Coverage
|
|
|
|
##
|
|
|
|
# Class that describes coverage badge metadata
|
|
|
|
#
|
2016-08-11 08:08:27 -04:00
|
|
|
class Metadata < Badge::Metadata
|
2016-08-11 07:58:57 -04:00
|
|
|
def initialize(badge)
|
|
|
|
@project = badge.project
|
|
|
|
@ref = badge.ref
|
|
|
|
@job = badge.job
|
|
|
|
end
|
|
|
|
|
2016-08-11 08:08:27 -04:00
|
|
|
def title
|
|
|
|
'coverage report'
|
2016-08-11 07:58:57 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def image_url
|
2017-06-29 13:06:35 -04:00
|
|
|
coverage_project_badges_url(@project, @ref, format: :svg)
|
2016-08-11 07:58:57 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def link_url
|
2017-06-29 13:06:35 -04:00
|
|
|
project_commits_url(@project, @ref)
|
2016-08-11 07:58:57 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|