debian-mirror-gitlab/lib/gitlab/gitorious_import/project_creator.rb

28 lines
704 B
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
module Gitlab
module GitoriousImport
class ProjectCreator
attr_reader :repo, :namespace, :current_user
def initialize(repo, namespace, current_user)
@repo = repo
@namespace = namespace
@current_user = current_user
end
def execute
2015-12-23 02:04:40 +05:30
::Projects::CreateService.new(
current_user,
2015-04-26 12:48:37 +05:30
name: repo.name,
path: repo.path,
description: repo.description,
namespace_id: namespace.id,
visibility_level: Gitlab::VisibilityLevel::PUBLIC,
import_type: "gitorious",
import_source: repo.full_name,
import_url: repo.import_url
).execute
end
end
end
end