2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-09-13 17:45:13 +05:30
|
|
|
module Gitlab
|
|
|
|
module Badge
|
|
|
|
module Coverage
|
|
|
|
##
|
|
|
|
# Class that describes coverage badge metadata
|
|
|
|
#
|
|
|
|
class Metadata < Badge::Metadata
|
|
|
|
def initialize(badge)
|
|
|
|
@project = badge.project
|
|
|
|
@ref = badge.ref
|
|
|
|
@job = badge.job
|
|
|
|
end
|
|
|
|
|
|
|
|
def title
|
|
|
|
'coverage report'
|
|
|
|
end
|
|
|
|
|
|
|
|
def image_url
|
2017-09-10 17:25:29 +05:30
|
|
|
coverage_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, @ref)
|
2016-09-13 17:45:13 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|