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

repository.rb « google_code_import « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 19627c8cd35ade5c24578c7c5ffbe44b18394e11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# frozen_string_literal: true

module Gitlab
  module GoogleCodeImport
    class Repository
      attr_accessor :raw_data

      def initialize(raw_data)
        @raw_data = raw_data
      end

      def valid?
        raw_data.is_a?(Hash) && raw_data["kind"] == "projecthosting#project"
      end

      def id
        raw_data["externalId"]
      end

      def name
        raw_data["name"]
      end

      def summary
        raw_data["summary"]
      end

      def description
        raw_data["description"]
      end

      def git?
        raw_data["versionControlSystem"] == "git"
      end

      def import_url
        raw_data["repositoryUrls"].first
      end

      def issues
        raw_data["issues"] && raw_data["issues"]["items"]
      end
    end
  end
end