2015-04-03 09:29:27 -04:00
|
|
|
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
|
2015-04-14 08:50:56 -04:00
|
|
|
|
|
|
|
def issues
|
|
|
|
raw_data["issues"] && raw_data["issues"]["items"]
|
|
|
|
end
|
2015-04-03 09:29:27 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|