gitlab-org--gitlab-foss/lib/gitlab/issues_labels.rb
Dmitriy Zaporozhets b2a6f4e136
Refactor label rendering and default label set generation
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-29 22:19:47 +03:00

28 lines
746 B
Ruby

module Gitlab
class IssuesLabels
class << self
def generate(project)
red = '#d9534f'
yellow = '#f0ad4e'
blue = '#428bca'
green = '#5cb85c'
labels = [
{ title: "bug", color: red },
{ title: "critical", color: red },
{ title: "confirmed", color: red },
{ title: "documentation", color: yellow },
{ title: "support", color: yellow },
{ title: "discussion", color: blue },
{ title: "suggestion", color: blue },
{ title: "feature", color: green },
{ title: "enhancement", color: green }
]
labels.each do |label|
project.labels.create(label)
end
end
end
end
end