issues_labels.rb 746 字节
Newer Older
1
module Gitlab
2
  class IssuesLabels
3
    class << self
4
      def generate(project)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
        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: "enhancement", color: green }
        ]
20

21
        labels.each do |params|
22
          ::Labels::FindOrCreateService.new(project.owner, project).execute(params)
23
        end
24 25 26 27
      end
    end
  end
end