Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/badge/pipeline/metadata.rb')
-rw-r--r--lib/gitlab/ci/badge/pipeline/metadata.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/gitlab/ci/badge/pipeline/metadata.rb b/lib/gitlab/ci/badge/pipeline/metadata.rb
new file mode 100644
index 00000000000..2aa08476336
--- /dev/null
+++ b/lib/gitlab/ci/badge/pipeline/metadata.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module Gitlab::Ci
+ module Badge
+ module Pipeline
+ ##
+ # Class that describes pipeline badge metadata
+ #
+ class Metadata < Badge::Metadata
+ def initialize(badge)
+ @project = badge.project
+ @ref = badge.ref
+ end
+
+ def title
+ 'pipeline status'
+ end
+
+ def image_url
+ pipeline_project_badges_url(@project, @ref, format: :svg)
+ end
+
+ def link_url
+ project_commits_url(@project, id: @ref)
+ end
+ end
+ end
+ end
+end