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

package_type_enum.rb « packages « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e2b5cf3163e82debd8e1528110b0a5dae9447a21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module Types
  module Packages
    class PackageTypeEnum < BaseEnum
      PACKAGE_TYPE_NAMES = {
        pypi: 'PyPI',
        npm: 'npm'
      }.freeze

      ::Packages::Package.package_types.keys.each do |package_type|
        type_name = PACKAGE_TYPE_NAMES.fetch(package_type.to_sym, package_type.capitalize)
        value package_type.to_s.upcase, "Packages from the #{type_name} package manager", value: package_type.to_s
      end
    end
  end
end