mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-15 23:56:09 +10:00
25 lines
389 B
Ruby
25 lines
389 B
Ruby
module Gitlab
|
|
module Badge
|
|
##
|
|
# Build badge
|
|
#
|
|
class Build
|
|
def initialize(project, ref)
|
|
@image = ::Ci::ImageForBuildService.new.execute(project, ref: ref)
|
|
end
|
|
|
|
def to_s
|
|
@image[:name].sub(/\.svg$/, '')
|
|
end
|
|
|
|
def type
|
|
'image/svg+xml'
|
|
end
|
|
|
|
def data
|
|
File.read(@image[:path])
|
|
end
|
|
end
|
|
end
|
|
end
|