Class: Gitlab::GitoriousImport::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/gitorious_import/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo_list) ⇒ Client

Returns a new instance of Client


6
7
8
# File 'lib/gitlab/gitorious_import/client.rb', line 6

def initialize(repo_list)
  @repo_list = repo_list
end

Instance Attribute Details

#repo_listObject (readonly)

Returns the value of attribute repo_list


4
5
6
# File 'lib/gitlab/gitorious_import/client.rb', line 4

def repo_list
  @repo_list
end

Instance Method Details

#authorize_url(redirect_uri) ⇒ Object


10
11
12
# File 'lib/gitlab/gitorious_import/client.rb', line 10

def authorize_url(redirect_uri)
  "#{GITORIOUS_HOST}/gitlab-import?callback_url=#{redirect_uri}"
end

#repo(id) ⇒ Object


18
19
20
# File 'lib/gitlab/gitorious_import/client.rb', line 18

def repo(id)
  repos.find { |repo| repo.id == id }
end

#reposObject


14
15
16
# File 'lib/gitlab/gitorious_import/client.rb', line 14

def repos
  @repos ||= repo_names.map { |full_name| GitoriousImport::Repository.new(full_name) }
end