Class: Gitlab::BitbucketImport::ProjectCreator
- Inherits:
-
Object
- Object
- Gitlab::BitbucketImport::ProjectCreator
- Defined in:
- lib/gitlab/bitbucket_import/project_creator.rb
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(repo, name, namespace, current_user, credentials) ⇒ ProjectCreator
constructor
A new instance of ProjectCreator.
Constructor Details
#initialize(repo, name, namespace, current_user, credentials) ⇒ ProjectCreator
Returns a new instance of ProjectCreator.
8 9 10 11 12 13 14 |
# File 'lib/gitlab/bitbucket_import/project_creator.rb', line 8 def initialize(repo, name, namespace, current_user, credentials) @repo = repo @name = name @namespace = namespace @current_user = current_user @credentials = credentials end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
6 7 8 |
# File 'lib/gitlab/bitbucket_import/project_creator.rb', line 6 def credentials @credentials end |
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
6 7 8 |
# File 'lib/gitlab/bitbucket_import/project_creator.rb', line 6 def current_user @current_user end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/gitlab/bitbucket_import/project_creator.rb', line 6 def name @name end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
6 7 8 |
# File 'lib/gitlab/bitbucket_import/project_creator.rb', line 6 def namespace @namespace end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
6 7 8 |
# File 'lib/gitlab/bitbucket_import/project_creator.rb', line 6 def repo @repo end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/gitlab/bitbucket_import/project_creator.rb', line 16 def execute ::Projects::CreateService.new( current_user, name: name, path: name, description: repo.description, namespace_id: namespace.id, organization_id: namespace.organization_id, visibility_level: repo.visibility_level, import_type: 'bitbucket', import_source: repo.full_name, import_url: clone_url, import_data: { credentials: credentials }, skip_wiki: skip_wiki ).execute end |