debian-mirror-gitlab/lib/gitlab/badge/pipeline/metadata.rb

30 lines
567 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
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