BigW Consortium Gitlab

metadata.rb 719 Bytes
Newer Older
1 2 3 4 5 6
module Gitlab
  module Badge
    module Coverage
      ##
      # Class that describes coverage badge metadata
      #
7
      class Metadata < Badge::Metadata
8 9 10 11 12 13
        def initialize(badge)
          @project = badge.project
          @ref = badge.ref
          @job = badge.job
        end

14 15
        def title
          'coverage report'
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
        end

        def image_url
          coverage_namespace_project_badges_url(@project.namespace,
                                                @project, @ref,
                                                format: :svg)
        end

        def link_url
          namespace_project_commits_url(@project.namespace, @project, id: @ref)
        end
      end
    end
  end
end